diff --git a/develop/doc/html/.buildinfo b/develop/doc/html/.buildinfo index 6ba660a27..9eb7fd109 100644 --- a/develop/doc/html/.buildinfo +++ b/develop/doc/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: 83bbed787a8fde5047710da3d607efdd +config: afd159402e484544a21d1f24da56a8cc tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/develop/doc/html/_downloads/a17e372b9fcd3d6d9436c0013af6cf2d/histogram.cpp b/develop/doc/html/_downloads/a17e372b9fcd3d6d9436c0013af6cf2d/histogram.cpp index b1b489642..229b8d9b6 100644 --- a/develop/doc/html/_downloads/a17e372b9fcd3d6d9436c0013af6cf2d/histogram.cpp +++ b/develop/doc/html/_downloads/a17e372b9fcd3d6d9436c0013af6cf2d/histogram.cpp @@ -1,49 +1,52 @@ // -// Copyright 2005-2007 Adobe Systems Incorporated +// Copyright 2020 Debabrata Mandal // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // + #include -#include +#include +#include -#include -#include - -// Example file to demonstrate a way to compute histogram +#include using namespace boost::gil; -template -void gray_image_hist(GrayView const& img_view, R& hist) +/* +This file explains how to use the histogram class and some of its features +that can be applied for a variety of tasks. +*/ + +int main() { - for (auto it = img_view.begin(); it != img_view.end(); ++it) - ++hist[*it]; + // Create a histogram class. Use uint or unsigned short as the default axes type in most cases. + histogram h; - // Alternatively, prefer the algorithm with lambda - // for_each_pixel(img_view, [&hist](gray8_pixel_t const& pixel) { - // ++hist[pixel]; - // }); -} + // Fill histogram with GIL images (of any color space) + gray8_image_t g; + read_image("test_adaptive.png", g, png_tag{}); -template -void get_hist(const V& img_view, R& hist) { - gray_image_hist(color_converted_view(img_view), hist); -} + fill_histogram + ( + view(g), // Input image view + h, // Histogram to be filled + 1, // Histogram bin widths + false, // Specify whether to accumulate over the values already present in h (default = false) + true, // Specify whether to have a sparse or continuous histogram (default = true) + false, // Specify if image mask is to be specified + {{}}, // Mask as a 2D vector. Used only if prev argument specified + {0}, // Lower limit on the values in histogram (default numeric_limit::min() on axes) + {255}, // Upper limit on the values in histogram (default numeric_limit::max() on axes) + true // Use specified limits if this is true (default is false) + ); -int main() { - rgb8_image_t img; - read_image("test.jpg", img, jpeg_tag()); + // Normalize the histogram + h.normalize(); - int histogram[256]; - std::fill(histogram,histogram + 256, 0); - get_hist(const_view(img), histogram); - - std::fstream histo_file("out-histogram.txt", std::ios::out); - for(std::size_t ii = 0; ii < 256; ++ii) - histo_file << histogram[ii] << std::endl; - histo_file.close(); + // Get a cumulative histogram from the histogram + auto h2 = cumulative_histogram(h); return 0; } diff --git a/develop/doc/html/_downloads/f4c32f08ec375899f01a3efd07a22e4b/mandelbrot.cpp b/develop/doc/html/_downloads/f4c32f08ec375899f01a3efd07a22e4b/mandelbrot.cpp index 0bcfc2ea1..1aa5a9089 100644 --- a/develop/doc/html/_downloads/f4c32f08ec375899f01a3efd07a22e4b/mandelbrot.cpp +++ b/develop/doc/html/_downloads/f4c32f08ec375899f01a3efd07a22e4b/mandelbrot.cpp @@ -40,7 +40,7 @@ struct mandelbrot_fn t=pow(t,0.2); value_type ret; - for (int k=0; k::value; ++k) + for (std::size_t k=0; k::value; ++k) ret[k]=(typename channel_type

::type)(_in_color[k]*t + _out_color[k]*(1-t)); return ret; } diff --git a/develop/doc/html/_images/barbara.jpg b/develop/doc/html/_images/barbara.jpg new file mode 100644 index 000000000..3dad19747 Binary files /dev/null and b/develop/doc/html/_images/barbara.jpg differ diff --git a/develop/doc/html/_images/church.jpg b/develop/doc/html/_images/church.jpg new file mode 100644 index 000000000..c0beb7c65 Binary files /dev/null and b/develop/doc/html/_images/church.jpg differ diff --git a/develop/doc/html/_images/he_chart.png b/develop/doc/html/_images/he_chart.png new file mode 100644 index 000000000..217c89ef1 Binary files /dev/null and b/develop/doc/html/_images/he_chart.png differ diff --git a/develop/doc/html/_images/matching.jpg b/develop/doc/html/_images/matching.jpg new file mode 100644 index 000000000..d03e07a04 Binary files /dev/null and b/develop/doc/html/_images/matching.jpg differ diff --git a/develop/doc/html/_images/matching_out.jpg b/develop/doc/html/_images/matching_out.jpg new file mode 100644 index 000000000..869043acc Binary files /dev/null and b/develop/doc/html/_images/matching_out.jpg differ diff --git a/develop/doc/html/_sources/image_processing/contrast_enhancement/histogram_equalization.rst.txt b/develop/doc/html/_sources/image_processing/contrast_enhancement/histogram_equalization.rst.txt new file mode 100644 index 000000000..0874c1c4b --- /dev/null +++ b/develop/doc/html/_sources/image_processing/contrast_enhancement/histogram_equalization.rst.txt @@ -0,0 +1,100 @@ +.. _he: + +###################### +Histogram Equalization +###################### + +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. + +An ideal image would be the one having a flat histogram. + +Although care should be taken before applying a non-linear transformation on the image +histogram, there are good mathematical reasons why a flat histogram is the desired goal. + +A simple scenario would be an image with pixels concentrated in an interval, in which case +histogram equalization transforms pixels to achieve a flat histogram image. Thus enhancing +the image contrast. + +.. figure:: he_chart.png + :width: 200px + :align: center + :height: 100px + :alt: Could not load image. + :figclass: align-center + + Pixels concentrated in an interval spread out. + +Algorithm +--------- + +#. First calculate the histogram corresponding to input image. +#. If it is a multi channeled image (e.g. RGB), convert it to a independent color space + (like YCbCr, HSV etc.). +#. Then calculate the cumulative histogram over the input image. +#. Normalize the histogram to bring bin values between 0-1. For multi-channeled images + normalize each channel independently (by the number of pixels in image). +#. If the histogram of image is H(p\ :sub:`x`\) p\ :sub:`x`\ in [0, 255], then apply + the transformation p\ :sub:`x'`\ = H(p\ :sub:`x`\), p\ :sub:`x'`\ is pixel in output + image. + +**Explanation** + +Since we will be transforming the image to match a flat histogram, we match +the cumulative histogram of the image to the cumulative histogram of a flat histogram. + +Cumulative histogram of flat image is H(p\ :sub:`x'`\) = p\ :sub:`x'` . + +Hence, + + => H(p\ :sub:`x'`\) = H(p\ :sub:`x`\) + + => p\ :sub:`x'`\ = H(p\ :sub:`x`\) + +Results +------- +The algorithm is applied on a few standard images. One of the transformations in shown below: + +**Grayscale Image** + +.. figure:: barbara.jpg + :width: 512px + :align: center + :height: 256px + :alt: Could not load image. + :figclass: align-center + +**RGB** + +.. figure:: church.jpg + :width: 900px + :align: center + :height: 300px + :alt: Could not load image. + :figclass: align-center + + +Demo +---- + +Usage Syntax: + + .. code-block:: cpp + + 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> mask(inp_img.height(), vector(inp_img.width(), true)); + histogram_equalization(view(inp_img), view(dst_img), true, mask); + + .. tip:: Convert an RGB image to a channel independent color space + before trying the histogram equalization algorithm. + diff --git a/develop/doc/html/_sources/image_processing/contrast_enhancement/histogram_matching.rst.txt b/develop/doc/html/_sources/image_processing/contrast_enhancement/histogram_matching.rst.txt new file mode 100644 index 000000000..be7883a0c --- /dev/null +++ b/develop/doc/html/_sources/image_processing/contrast_enhancement/histogram_matching.rst.txt @@ -0,0 +1,87 @@ +.. _hm: + +################## +Histogram Matching +################## + +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 +features in either image. + +The famous histogram equalization is a special case of this algorithm when the reference image +is expected to have a uniform histogram. + + +Algorithm +--------- + +#. Calculate the histogram corresponding to input image and reference image. +#. If it is a multi channeled image (e.g. RGB), convert both to an independent color space + (like YCbCr, HSV etc.). +#. Then calculate the cumulative histogram over the input image and reference image. +#. Normalize both the histogram to bring bin values between 0-1. For multi-channeled images + normalize each channel independently (by the number of pixels in image). +#. If the cumulative histogram of input image is H(p\ :sub:`x`\) and of reference image is R(p\ :sub:`x'`\) + p\ :sub:`x`\ & p\ :sub:`x'`\ in [0, 255], then apply the transformation + p\ :sub:`x'`\ = R\ :sup:`-1`\ (H(p\ :sub:`x`\ )) + +**Explanation** + +Since we will be transforming the image to match a reference image, we match +the cumulative histogram of the image to the cumulative histogram of the reference histogram. + +Hence, + + => R(p\ :sub:`x'`\) = H(p\ :sub:`x`\ ) + + => p\ :sub:`x'`\ = R\ :sup:`-1`\ (H(p\ :sub:`x`\ )) + +Results +------- +The algorithm is applied on a few standard images. One of the transformations in shown below: + +**Original Image(left) & Reference Image(right)** + +.. figure:: matching.jpg + :width: 600px + :align: center + :height: 300px + :alt: Could not load image. + :figclass: align-center + +**Histogram matched Image** + +.. figure:: matching_out.jpg + :width: 300px + :align: center + :height: 300px + :alt: Could not load image. + :figclass: align-center + + +Demo +---- + +Usage Syntax: + + .. code-block:: cpp + + 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> mask(inp_img.height(), vector(inp_img.width(), true)); + histogram_matching(view(inp_img), view(ref_image), view(dst_img), true, mask); + + .. tip:: Convert an RGB image to a channel independent color space + before trying the histogram matching algorithm. + diff --git a/develop/doc/html/_sources/index.rst.txt b/develop/doc/html/_sources/index.rst.txt index 737cdaaba..2a52bd6fa 100644 --- a/develop/doc/html/_sources/index.rst.txt +++ b/develop/doc/html/_sources/index.rst.txt @@ -1,7 +1,7 @@ Boost Generic Image Library =========================== -The Generic Image Library (GIL) is a C++11 library that abstracts image +The Generic Image Library (GIL) is a C++11 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. diff --git a/develop/doc/html/_sources/installation.rst.txt b/develop/doc/html/_sources/installation.rst.txt index 175d1d400..d81064515 100644 --- a/develop/doc/html/_sources/installation.rst.txt +++ b/develop/doc/html/_sources/installation.rst.txt @@ -1,9 +1,9 @@ Installation ============ -The latest version of GIL can be downloaded from https://github.com/boostorg/gil. +The latest version of Boost.GIL can be downloaded from https://github.com/boostorg/gil. -The GIL is a header-only library. Meaning, it consists of header files only, +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 to link against. @@ -13,5 +13,22 @@ to link against. which requires client libraries implementing popular image formats like libpng, libjpeg, etc. -In order to use GIL, including ``boost/gil.hpp`` and telling your compiler +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 +--------- + +The Boost.GIL library source code should successfully compile with any +compiler with complete C++11 support. + +.. note:: + + We are planning to drop support for require C++14 support in Boost 1.76 or later, + or selectively drop support for GCC 5 due to its issues with inheriting constructors, + see `discussion for PR #526 `_. + +For the actual list of currently tested compilers, check results of the library CI +builds linked from the `README.md `_ +or inspect the CI services configuration files in the `develop branch `_ +of the library repository. diff --git a/develop/doc/html/_static/basic.css b/develop/doc/html/_static/basic.css index be19270e4..0807176ec 100644 --- a/develop/doc/html/_static/basic.css +++ b/develop/doc/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-2019 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -15,12 +15,6 @@ div.clearer { clear: both; } -div.section::after { - display: block; - content: ''; - clear: left; -} - /* -- relbar ---------------------------------------------------------------- */ div.related { @@ -237,16 +231,6 @@ a.headerlink { visibility: hidden; } -a.brackets:before, -span.brackets > a:before{ - content: "["; -} - -a.brackets:after, -span.brackets > a:after { - content: "]"; -} - h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, @@ -295,12 +279,6 @@ img.align-center, .figure.align-center, object.align-center { margin-right: auto; } -img.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - .align-left { text-align: left; } @@ -309,10 +287,6 @@ img.align-default, .figure.align-default { text-align: center; } -.align-default { - text-align: center; -} - .align-right { text-align: right; } @@ -322,27 +296,21 @@ img.align-default, .figure.align-default { div.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; - padding: 7px; + padding: 7px 7px 0 7px; background-color: #ffe; width: 40%; float: right; - clear: right; - overflow-x: auto; } p.sidebar-title { font-weight: bold; } -div.admonition, div.topic, blockquote { - clear: left; -} - /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; - padding: 7px; + padding: 7px 7px 0 7px; margin: 10px 0 10px 0; } @@ -364,6 +332,10 @@ div.admonition dt { font-weight: bold; } +div.admonition dl { + margin-bottom: 0; +} + p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; @@ -374,28 +346,9 @@ div.body p.centered { margin-top: 25px; } -/* -- content of sidebars/topics/admonitions -------------------------------- */ - -div.sidebar > :last-child, -div.topic > :last-child, -div.admonition > :last-child { - margin-bottom: 0; -} - -div.sidebar::after, -div.topic::after, -div.admonition::after, -blockquote::after { - display: block; - content: ''; - clear: both; -} - /* -- tables ---------------------------------------------------------------- */ table.docutils { - margin-top: 10px; - margin-bottom: 10px; border: 0; border-collapse: collapse; } @@ -405,11 +358,6 @@ table.align-center { margin-right: auto; } -table.align-default { - margin-left: auto; - margin-right: auto; -} - table caption span.caption-number { font-style: italic; } @@ -443,16 +391,6 @@ table.citation td { border-bottom: none; } -th > :first-child, -td > :first-child { - margin-top: 0px; -} - -th > :last-child, -td > :last-child { - margin-bottom: 0px; -} - /* -- figures --------------------------------------------------------------- */ div.figure { @@ -495,10 +433,6 @@ table.field-list td, table.field-list th { /* -- hlist styles ---------------------------------------------------------- */ -table.hlist { - margin: 1em 0; -} - table.hlist td { vertical-align: top; } @@ -526,78 +460,11 @@ ol.upperroman { list-style: upper-roman; } -:not(li) > ol > li:first-child > :first-child, -:not(li) > ul > li:first-child > :first-child { - margin-top: 0px; -} - -:not(li) > ol > li:last-child > :last-child, -:not(li) > ul > li:last-child > :last-child { - margin-bottom: 0px; -} - -ol.simple ol p, -ol.simple ul p, -ul.simple ol p, -ul.simple ul p { - margin-top: 0; -} - -ol.simple > li:not(:first-child) > p, -ul.simple > li:not(:first-child) > p { - margin-top: 0; -} - -ol.simple p, -ul.simple p { - margin-bottom: 0; -} - -dl.footnote > dt, -dl.citation > dt { - float: left; - margin-right: 0.5em; -} - -dl.footnote > dd, -dl.citation > dd { - margin-bottom: 0em; -} - -dl.footnote > dd:after, -dl.citation > dd:after { - content: ""; - clear: both; -} - -dl.field-list { - display: grid; - grid-template-columns: fit-content(30%) auto; -} - -dl.field-list > dt { - font-weight: bold; - word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; -} - -dl.field-list > dt:after { - content: ":"; -} - -dl.field-list > dd { - padding-left: 0.5em; - margin-top: 0em; - margin-left: 0em; - margin-bottom: 0em; -} - dl { margin-bottom: 15px; } -dd > :first-child { +dd p { margin-top: 0px; } @@ -611,11 +478,6 @@ dd { margin-left: 30px; } -dl > dd:last-child, -dl > dd:last-child > :last-child { - margin-bottom: 0; -} - dt:target, span.highlighted { background-color: #fbe54e; } @@ -675,12 +537,6 @@ dl.glossary dt { font-style: oblique; } -.classifier:before { - font-style: normal; - margin: 0.5em; - content: ":"; -} - abbr, acronym { border-bottom: dotted 1px; cursor: help; @@ -693,10 +549,6 @@ pre { overflow-y: hidden; /* fixes display issues on Chrome browsers */ } -pre, div[class*="highlight-"] { - clear: both; -} - span.pre { -moz-hyphens: none; -ms-hyphens: none; @@ -704,57 +556,22 @@ span.pre { hyphens: none; } -div[class*="highlight-"] { - margin: 1em 0; -} - td.linenos pre { + padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { - display: block; -} - -table.highlighttable tbody { - display: block; -} - -table.highlighttable tr { - display: flex; + margin-left: 0.5em; } table.highlighttable td { - margin: 0; - padding: 0; -} - -table.highlighttable td.linenos { - padding-right: 0.5em; -} - -table.highlighttable td.code { - flex: 1; - overflow: hidden; -} - -.highlight .hll { - display: block; -} - -div.highlight pre, -table.highlighttable pre { - margin: 0; -} - -div.code-block-caption + div { - margin-top: 0; + padding: 0 0.5em 0 0.5em; } div.code-block-caption { - margin-top: 1em; padding: 2px 5px; font-size: small; } @@ -763,10 +580,8 @@ div.code-block-caption code { background-color: transparent; } -table.highlighttable td.linenos, -span.linenos, -div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; +div.code-block-caption + div > div.highlight > pre { + margin-top: 0; } div.code-block-caption span.caption-number { @@ -778,7 +593,11 @@ div.code-block-caption span.caption-text { } div.literal-block-wrapper { - margin: 1em 0; + padding: 1em 1em 0; +} + +div.literal-block-wrapper div.highlight { + margin: 0; } code.descname { @@ -829,7 +648,8 @@ span.eqno { } span.eqno a.headerlink { - position: absolute; + position: relative; + left: 0px; z-index: 1; } diff --git a/develop/doc/html/_static/classic.css b/develop/doc/html/_static/classic.css index dcae94623..8c6dae44c 100644 --- a/develop/doc/html/_static/classic.css +++ b/develop/doc/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-2019 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,11 +13,6 @@ /* -- page layout ----------------------------------------------------------- */ -html { - /* CSS hack for macOS's scrollbar (see #1125) */ - background-color: #FFFFFF; -} - body { font-family: sans-serif; font-size: 100%; @@ -224,8 +219,8 @@ p.admonition-title:after { pre { padding: 5px; - background-color: unset; - color: unset; + background-color: #eeffcc; + color: #333333; line-height: 120%; border: 1px solid #ac9; border-left: none; @@ -238,7 +233,7 @@ code { font-size: 0.95em; } -th, dl.field-list > dt { +th { background-color: #ede; } diff --git a/develop/doc/html/_static/doctools.js b/develop/doc/html/_static/doctools.js index 144884ea6..344db17dd 100644 --- a/develop/doc/html/_static/doctools.js +++ b/develop/doc/html/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -87,13 +87,14 @@ jQuery.fn.highlightText = function(text, className) { node.nextSibling)); node.nodeValue = val.substr(0, pos); if (isInSVG) { + var bbox = span.getBBox(); var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; + 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); + var parentOfText = node.parentNode.parentNode; addItems.push({ "parent": node.parentNode, "target": rect}); @@ -283,12 +284,10 @@ var Documentation = { }, initOnKeyListeners: function() { - $(document).keydown(function(event) { + $(document).keyup(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) { + // don't navigate when in search box or textarea + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { switch (event.keyCode) { case 37: // left var prevHref = $('link[rel="prev"]').prop('href'); diff --git a/develop/doc/html/_static/documentation_options.js b/develop/doc/html/_static/documentation_options.js index 2fa8c97fe..d28647eb8 100644 --- a/develop/doc/html/_static/documentation_options.js +++ b/develop/doc/html/_static/documentation_options.js @@ -3,10 +3,8 @@ var DOCUMENTATION_OPTIONS = { VERSION: '', LANGUAGE: 'None', 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, }; \ No newline at end of file diff --git a/develop/doc/html/_static/jquery-3.5.1.js b/develop/doc/html/_static/jquery-3.5.1.js deleted file mode 100644 index 50937333b..000000000 --- a/develop/doc/html/_static/jquery-3.5.1.js +++ /dev/null @@ -1,10872 +0,0 @@ -/*! - * jQuery JavaScript Library v3.5.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2020-05-04T22:49Z - */ -( 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. - return typeof obj === "function" && typeof obj.nodeType !== "number"; - }; - - -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.5.1", - - // 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.5 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2020-03-14 - */ -( 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.namespaceURI, - docElem = ( 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 master Deferred - master = 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 ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.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 - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - 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(); - return 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: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } -}, 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; - }, - - 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! - 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"; - tr.style.height = "1px"; - trChild.style.height = "9px"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; - - 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; - 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 ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + 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 - if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { - 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( " + @@ -86,11 +87,11 @@ in interleaved form:

at the end of rows.

The Generic Image Library (GIL) provides models for images that vary in:

    -
  • Structure (planar vs. interleaved)

  • -
  • Color space and presence of alpha (RGB, RGBA, CMYK, etc.)

  • -
  • Channel depth (8-bit, 16-bit, etc.)

  • -
  • Order of channels (RGB vs. BGR, etc.)

  • -
  • Row alignment policy (no alignment, word-alignment, etc.)

  • +
  • Structure (planar vs. interleaved)
  • +
  • Color space and presence of alpha (RGB, RGBA, CMYK, etc.)
  • +
  • Channel depth (8-bit, 16-bit, etc.)
  • +
  • Order of channels (RGB vs. BGR, etc.)
  • +
  • Row alignment policy (no alignment, word-alignment, etc.)

It also supports user-defined models of images, and images whose parameters are specified at run-time. GIL abstracts image representation from algorithms @@ -113,8 +114,8 @@ read the sections in order.

\ No newline at end of file diff --git a/develop/doc/html/design/channel.html b/develop/doc/html/design/channel.html index c625e5217..fb3cf9095 100644 --- a/develop/doc/html/design/channel.html +++ b/develop/doc/html/design/channel.html @@ -20,6 +20,7 @@ + @@ -69,9 +70,9 @@

Channel

@@ -80,30 +81,30 @@ 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
+    typename value_type      = T;        // use channel_traits<T>::value_type to access it
     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
-    typename const_pointer   = const T*; // use channel_traits<T>::const_pointer 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
+    typename const_pointer   = const T*; // use channel_traits<T>::const_pointer to access it
     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 min_value();                // use channel_traits<T>::min_value to access it
+    static T max_value();                // use channel_traits<T>::min_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
+
template <typename T>
+struct channel_traits
 {
     typedef T         value_type;
     typedef T&        reference;
@@ -111,13 +112,13 @@ Therefore the associated types and range information are defined in
     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>
+
concept ChannelsCompatibleConcept<ChannelConcept T1, ChannelConcept T2>
 {
     where SameType<T1::value_type, T2::value_type>;
 };
@@ -125,9 +126,9 @@ Therefore the associated types and range information are defined in
 

A channel may be convertible to another channel:

template <ChannelConcept Src, ChannelValueConcept Dst>
-concept ChannelConvertibleConcept
+concept ChannelConvertibleConcept
 {
-    Dst channel_convert(Src);
+    Dst channel_convert(Src);
 };
 
@@ -143,13 +144,13 @@ to native C++ references, it may not have a default constructor.

Note also that algorithms may impose additional requirements on channels, such as support for arithmetic operations.

@@ -162,8 +163,8 @@ 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; } };
+
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;
 
@@ -236,16 +237,16 @@ 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);
 
@@ -262,8 +263,8 @@ channel-level algorithms that GIL provides:

\ No newline at end of file diff --git a/develop/doc/html/design/color_base.html b/develop/doc/html/design/color_base.html index 8e7f6e224..2d6c9197d 100644 --- a/develop/doc/html/design/color_base.html +++ b/develop/doc/html/design/color_base.html @@ -20,6 +20,7 @@ + @@ -69,9 +70,9 @@

Color Base

@@ -84,18 +85,18 @@ 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>
+
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;
+  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;
+  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);
@@ -109,10 +110,10 @@ channel iterators.

}; -concept MutableColorBaseConcept<ColorBaseConcept T> +concept MutableColorBaseConcept<ColorBaseConcept T> : Assignable<T>, Swappable<T> { - template <int K> struct 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<T,K>::type at_c(T); @@ -121,29 +122,29 @@ channel iterators.

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; }; -concept MutableHomogeneousColorBaseConcept<MutableColorBaseConcept CB> +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> +concept HomogeneousColorBaseValueConcept<typename T> : MutableHomogeneousColorBaseConcept<T>, Regular<T> { }; -concept ColorBasesCompatibleConcept<ColorBaseConcept C1, ColorBaseConcept C2> +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): @@ -174,8 +175,8 @@ elements (paired semantically) are convertible to each other.

all have the same type).

namespace detail
 {
-  template <typename Element, typename Layout, int K>
-  struct homogeneous_color_base;
+  template <typename Element, typename Layout, int K>
+  struct homogeneous_color_base;
 }
 
@@ -189,74 +190,74 @@ planar pixel iterator. Another model of
// Metafunction returning an mpl::int_ 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)
+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)
+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 @@ -267,23 +268,23 @@ 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 <int K> struct element_recursion
   {
-    template <typename P1,typename P2>
+    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);
+      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 <> struct element_recursion<0>
   {
-    template <typename P1,typename P2>
+    template <typename P1,typename P2>
     static bool static_equal(const P1&, const P2&) { return true; }
   };
 }
 
-template <typename P1,typename 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> >();
@@ -309,8 +310,8 @@ color base require that they all have the same color space.

\ No newline at end of file diff --git a/develop/doc/html/design/color_space.html b/develop/doc/html/design/color_space.html index 1a224be80..4dc26f899 100644 --- a/develop/doc/html/design/color_space.html +++ b/develop/doc/html/design/color_space.html @@ -20,6 +20,7 @@ + @@ -69,8 +70,8 @@

Color Space and Layout

@@ -81,11 +82,11 @@ containing the types of all elements in the color space.

Two color spaces are considered compatible if they are equal (i.e. have the same set of colors in the same order).

@@ -93,36 +94,35 @@ same set of colors in the same order).

Models

GIL currently provides the following color spaces:

    -
  • gray_t

  • -
  • rgb_t

  • -
  • rgba_t

  • -
  • cmyk_t

  • +
  • gray_t
  • +
  • rgb_t
  • +
  • rgba_t
  • +
  • cmyk_t

It also provides unnamed N-channel color spaces of two to five channels:

    -
  • devicen_t<2>

  • -
  • devicen_t<3>

  • -
  • devicen_t<4>

  • -
  • devicen_t<5>

  • +
  • devicen_t<2>
  • +
  • devicen_t<3>
  • +
  • devicen_t<4>
  • +
  • devicen_t<5>

Besides the standard layouts, it also provides:

    -
  • bgr_layout_t

  • -
  • bgra_layout_t

  • -
  • abgr_layout_t

  • -
  • argb_layout_t

  • +
  • bgr_layout_t
  • +
  • bgra_layout_t
  • +
  • abgr_layout_t
  • +
  • argb_layout_t

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

.. code-block:: cpp
 
-

struct red_t {}; +

struct red_t {}; struct green_t {}; struct blue_t {}; struct alpha_t {}; -rgba_t = using mpl::vector4<red_t, green_t, blue_t, alpha_t>;

-
+rgba_t = using mpl::vector4<red_t, green_t, blue_t, alpha_t>;

The ordering of the channels in the color space definition specifies their semantic order. For example, red_t is the first semantic channel of rgba_t. While there is a unique semantic ordering of the channels in a @@ -133,10 +133,10 @@ A color space and its associated mapping are often used together.

Thus they are grouped in GIL’s layout:

template
 <
-    typename ColorSpace,
-    typename ChannelMapping = mpl::range_c<int, 0, mpl::size<ColorSpace>::value>
+    typename ColorSpace,
+    typename ChannelMapping = mpl::range_c<int, 0, mpl::size<ColorSpace>::value>
 >
-struct layout
+struct layout
 {
   using color_space_t = ColorSpace;
   using channel_mapping_t = ChannelMapping;
@@ -164,8 +164,8 @@ A color space and its associated mapping are often used together.

\ No newline at end of file diff --git a/develop/doc/html/design/concepts.html b/develop/doc/html/design/concepts.html index 3e1291c3e..dce1b4347 100644 --- a/develop/doc/html/design/concepts.html +++ b/develop/doc/html/design/concepts.html @@ -20,6 +20,7 @@ + @@ -82,40 +83,40 @@ 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>
+
auto concept DefaultConstructible<typename T>
 {
     T::T();
 };
 
-auto concept CopyConstructible<typename T>
+auto concept CopyConstructible<typename T>
 {
     T::T(T);
     T::~T();
 };
 
-auto concept Assignable<typename T, typename U = T>
+auto concept Assignable<typename T, typename U = T>
 {
-    typename result_type;
+    typename result_type;
     result_type operator=(T&, U);
 };
 
-auto concept EqualityComparable<typename T, typename U = T>
+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>
+auto concept Swappable<typename T>
 {
-    void swap(T& t, T& u);
+    void swap(T& t, T& u);
 };
 

Here are some additional basic concepts that GIL needs:

-
auto concept Regular<typename T> :
+
auto concept Regular<typename T> :
     DefaultConstructible<T>,
     CopyConstructible<T>,
     EqualityComparable<T>,
@@ -123,9 +124,9 @@ Most of them are defined at the
     Swappable<T>
 {};
 
-auto concept Metafunction<typename T>
+auto concept Metafunction<typename T>
 {
-    typename type;
+    typename type;
 };
 
@@ -142,8 +143,8 @@ Most of them are defined at the
\ No newline at end of file diff --git a/develop/doc/html/design/conclusions.html b/develop/doc/html/design/conclusions.html index 5a058557d..90fe047e1 100644 --- a/develop/doc/html/design/conclusions.html +++ b/develop/doc/html/design/conclusions.html @@ -20,6 +20,7 @@ + @@ -69,11 +70,11 @@

Conclusions

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

@@ -120,8 +121,8 @@ raw pixel data from another image library.

\ No newline at end of file diff --git a/develop/doc/html/design/dynamic_image.html b/develop/doc/html/design/dynamic_image.html index e0e561b02..45ffdb340 100644 --- a/develop/doc/html/design/dynamic_image.html +++ b/develop/doc/html/design/dynamic_image.html @@ -20,6 +20,7 @@ + @@ -94,7 +95,7 @@ What type is the image loading code supposed to return?

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); +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)); @@ -120,10 +121,10 @@ a never valueless variant type, compatible with using size_type = std::size_t; any_image_view(); - template <typename T> explicit any_image_view(const T& obj); + 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); + 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 @@ -145,11 +146,11 @@ a never valueless variant type, compatible with 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); + 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); + 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); @@ -213,7 +214,7 @@ code, for example, uses the GIL I/O extension to turn an image on disk upside down:

#include <boost\gil\extension\io\jpeg_dynamic_io.hpp>
 
-template <typename Image>    // Could be rgb8_image_t or any_image<...>
+template <typename Image>    // Could be rgb8_image_t or any_image<...>
 void save_180rot(const std::string& file_name)
 {
   Image img;
@@ -227,28 +228,28 @@ 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
 {
   // the function, wrapped inside a function object
-  template <typename Result> struct rotated180_view_fn
+  template <typename Result> struct rotated180_view_fn
   {
       typedef Result result_type;
-      template <typename View> result_type operator()(const View& src) const
+      template <typename View> result_type operator()(const View& src) const
 {
-          return result_type(rotated180_view(src));
+          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 // Models MPL Random Access Container of models of ImageViewConcept
-typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type rotated180_view(const any_image_view<ViewTypes>& src)
+template <typename ViewTypes> inline // Models MPL Random Access Container of models of ImageViewConcept
+typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type rotated180_view(const any_image_view<ViewTypes>& src)
 {
-  return apply_operation(src,detail::rotated180_view_fn<typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type>());
+  return apply_operation(src,detail::rotated180_view_fn<typename dynamic_xy_step_type<any_image_view<ViewTypes> >::type>());
 }
 
@@ -273,8 +274,8 @@ uniformly as a collection and store them in the same container.

\ No newline at end of file diff --git a/develop/doc/html/design/examples.html b/develop/doc/html/design/examples.html index 92b5d1e61..0c4993763 100644 --- a/develop/doc/html/design/examples.html +++ b/develop/doc/html/design/examples.html @@ -20,6 +20,7 @@ + @@ -69,10 +70,10 @@

Examples

@@ -104,20 +105,20 @@ pixel references:

Here is how to use pixels in generic code:

-
template <typename GrayPixel, typename 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;
+  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;
+  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));
@@ -146,16 +147,16 @@ 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
 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)
+
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> >();
+  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());
+  typename DstImage::view_t centerImg=subimage_view(view(result), k,k,src.width(),src.height());
   std::copy(src.begin(), src.end(), centerImg.begin());
 }
 
@@ -165,7 +166,7 @@ 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>
+
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);
@@ -190,17 +191,17 @@ taking into account both static and run-time parameters.

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>
+
template <typename GrayView, typename R>
 void grayimage_histogram(const GrayView& img, R& hist)
 {
-  for (typename GrayView::iterator it=img.begin(); it!=img.end(); ++it)
+  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>
+
template <typename GrayView, typename R>
 void grayimage_histogram(const GrayView& v, R& hist)
 {
   for_each_pixel(v, ++var(hist)[_1]);
@@ -210,7 +211,7 @@ this more compactly:

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>
+
template <typename View, typename R>
 void luminosity_histogram(const View& v, R& hist)
 {
   grayimage_histogram(color_converted_view<gray8_pixel_t>(v),hist);
@@ -263,8 +264,8 @@ channel depth. They could be either planar or interleaved.

\ No newline at end of file diff --git a/develop/doc/html/design/extending.html b/develop/doc/html/design/extending.html index 863a94f21..4ac2e4f77 100644 --- a/develop/doc/html/design/extending.html +++ b/develop/doc/html/design/extending.html @@ -20,6 +20,7 @@ + @@ -69,11 +70,11 @@

Extending

@@ -120,16 +121,16 @@ 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
+  template <typename SrcP, typename DstP>  // Model PixelConcept
   void operator()(const SrcP& src, DstP& dst) const
   {
       default_color_converter_impl<SrcColorSpace,gray_t>()(src,dst);
@@ -138,13 +139,13 @@ remains the same:

}; // 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 + 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; + typedef typename color_space_type<SrcP>::type SrcColorSpace; + typedef typename color_space_type<DstP>::type DstColorSpace; my_color_converter_impl<SrcColorSpace,DstColorSpace>()(src,dst); } }; @@ -168,8 +169,8 @@ pixel access). First we need to define a model of PixelDereferenceAdaptorConcept; a function object that will be 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)
+
template <typename SrcConstRefP,  // const reference to the source pixel
+        typename DstP>          // Destination pixel value (models PixelValueConcept)
 class color_convert_deref_fn
 {
 public:
@@ -192,23 +193,23 @@ called when we dereference a pixel iterator. It will call
 

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
+
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 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;
+  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()); }
+  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()); }
 };
 

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)
+
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);
 }
@@ -233,8 +234,8 @@ defines the Mandelbrot set.

\ No newline at end of file diff --git a/develop/doc/html/design/image.html b/develop/doc/html/design/image.html index 8bc51703e..9c242f80f 100644 --- a/develop/doc/html/design/image.html +++ b/develop/doc/html/design/image.html @@ -20,6 +20,7 @@ + @@ -69,8 +70,8 @@

Image

@@ -83,13 +84,13 @@ 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>
+
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;
+  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);
@@ -104,10 +105,10 @@ concept:

Two-dimensional images have additional requirements:

-
concept RandomAccess2DImageConcept<RandomAccessNDImageConcept Img>
+
concept RandomAccess2DImageConcept<RandomAccessNDImageConcept Img>
 {
-  typename x_coord_t = const_view_t::x_coord_t;
-  typename y_coord_t = const_view_t::y_coord_t;
+  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);
@@ -121,21 +122,21 @@ concept:

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

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

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

@@ -145,9 +146,9 @@ because immutable images are not very useful.

(the pixel) and models ImageConcept:

 template
  <
-     typename Pixel, // Models PixelValueConcept
+     typename Pixel, // Models PixelValueConcept
      bool IsPlanar,  // planar or interleaved image
-     typename A=std::allocator<unsigned char>
+     typename A=std::allocator<unsigned char>
  >
 class image;
 
@@ -174,8 +175,8 @@ there are no padding bits at the end of rows of packed images.

\ No newline at end of file diff --git a/develop/doc/html/design/image_view.html b/develop/doc/html/design/image_view.html index f58a11109..59d826573 100644 --- a/develop/doc/html/design/image_view.html +++ b/develop/doc/html/design/image_view.html @@ -20,6 +20,7 @@ + @@ -69,13 +70,12 @@

Image View

    -
  • Overview

  • -
  • Models

  • -
  • Algorithms

    - @@ -89,30 +89,30 @@ 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!)
    -  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;      // for pixel-based views, the pixel 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;
    -      typename iterator; where RandomAccessTraversalConcept<iterator>;   // iterator along D-th axis.
    +  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);
    +  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;
    @@ -136,22 +136,22 @@ the following concept:

    reference operator()(View,const point_t&) const; }; -concept MutableRandomAccessNDImageViewConcept<RandomAccessNDImageViewConcept View> +concept MutableRandomAccessNDImageViewConcept<RandomAccessNDImageViewConcept View> { where Mutable<reference>; };

    Two-dimensional image views have the following extra requirements:

    -
    concept RandomAccess2DImageViewConcept<RandomAccessNDImageViewConcept View>
    +
    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;
    @@ -178,33 +178,33 @@ the following concept:

    y_iterator View::y_at(x_coord_t,y_coord_t) const; }; -concept MutableRandomAccess2DImageViewConcept<RandomAccess2DImageViewConcept 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>
    +
    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;
     };
     
     
    -concept MutableImageViewConcept<ImageViewConcept 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>
    +
    concept ViewsCompatibleConcept<ImageViewConcept V1, ImageViewConcept V2>
     {
       where PixelsCompatibleConcept<V1::value_type, V2::value_type>;
       where V1::num_dimensions == V2::num_dimensions;
    @@ -215,15 +215,15 @@ number of dimensions:

    height). Many algorithms taking multiple views require that they be pairwise compatible.

    @@ -234,7 +234,7 @@ templated over a model of MutablePixelLocatorConcept, it models MutableImageViewConcept). Synopsis:

    // Locator models PixelLocatorConcept, could be MutablePixelLocatorConcept
    -template <typename Locator>
    +template <typename Locator>
     class image_view
     {
     public:
    @@ -262,14 +262,14 @@ 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>
    +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>
    +template <typename Iterator>
     image_view<...> planar_rgb_view(
         ptrdiff_t width, ptrdiff_t height,
         IC r, IC g, IC b, ptrdiff_t rowsize);
    @@ -285,24 +285,24 @@ 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
    +template <typename SrcView, // Models ImageViewConcept
    +        typename DstP,    // Models PixelConcept
    +        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
    +template <typename SrcView>
    +struct nth_channel_view_type
     {
       typedef ... type;
     };
    @@ -310,29 +310,29 @@ to get the derived types:

    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,
    +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,
    +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>
    +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
    +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);
     
    -template <typename View>
    +template <typename View>
     nth_channel_view_type<View>::view_t                                           nth_channel_view(const View& view, int n);
     
    @@ -340,12 +340,12 @@ to get the derived types:

    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)
    +
    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));
    +  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));
     }
     
    @@ -382,30 +382,30 @@ 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>
    +template <typename V1, typename V2>
     void copy_pixels(const V1& src, const V2& dst);
    -template <typename V1, typename V2>
    +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>
    +template <typename V, typename Value>
     void fill_pixels(const V& dst, const Value& val);
    -template <typename V, typename Value>
    +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>
    +template <typename V, typename F>
     F for_each_pixel(const V& view, F fun);
    -template <typename V, typename F>
    +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>
    +template <typename V, typename F>
     void generate_pixels(const V& dst, F fun);
     
     // Equivalent of std::transform with one source
    @@ -413,9 +413,9 @@ the nested loops and take views (as opposed to ranges) as input.

    // 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> +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> +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 @@ -424,22 +424,22 @@ 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> +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> +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> +template <typename V1, typename V2> void copy_and_convert_pixels(const V1& src, const V2& dst); -template <typename V1, typename V2, typename ColorConverter> +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> +template <typename V1, typename V2> bool equal_pixels(const V1& view1, const V2& view2);
    @@ -486,8 +486,8 @@ development and is not optimized for speed

    \ No newline at end of file diff --git a/develop/doc/html/design/index.html b/develop/doc/html/design/index.html index 977f04ad3..8abafc718 100644 --- a/develop/doc/html/design/index.html +++ b/develop/doc/html/design/index.html @@ -20,6 +20,7 @@ + @@ -101,8 +102,8 @@ structure and basic elements of the Generic Image Library (GIL).

    \ No newline at end of file diff --git a/develop/doc/html/design/metafunctions.html b/develop/doc/html/design/metafunctions.html index af5eda102..b50eff285 100644 --- a/develop/doc/html/design/metafunctions.html +++ b/develop/doc/html/design/metafunctions.html @@ -20,6 +20,7 @@ + @@ -69,13 +70,13 @@

    Metafunctions

    @@ -111,29 +112,29 @@ to interleaved). _s 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; };
     
    @@ -141,45 +142,45 @@ direction, and is mutable:

    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; };
    +        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; };
    +        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; };
    +        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; };
    +        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; };
    +        typename Layout, typename Alloc=std::allocator<unsigned char> >
    +struct bit_aligned_image5_type { typedef ... type; };
     
    @@ -189,17 +190,17 @@ bit-aligned images with up to five channels:

    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
    +
    template <typename XIterator>
    +struct type_from_x_iterator
     {
       typedef ... step_iterator_t;
       typedef ... xy_locator_t;
    @@ -214,13 +215,13 @@ views. Types can also be constructed from horizontal iterator:

    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; };
     
    @@ -228,30 +229,30 @@ built on top of them:

    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
     };
    @@ -261,7 +262,7 @@ type by changing one or more of its properties:

    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, mpl::true_>::type;
    +
    using VT = typename derived_view_type<View, boost::use_default, gray_t, mpl::true_>::type;
     
    @@ -301,8 +302,8 @@ is basic, but a color converted view or a virtual view is not.

    \ No newline at end of file diff --git a/develop/doc/html/design/pixel.html b/develop/doc/html/design/pixel.html index cf2c7000c..ad6e7d6ca 100644 --- a/develop/doc/html/design/pixel.html +++ b/develop/doc/html/design/pixel.html @@ -20,6 +20,7 @@ + @@ -69,9 +70,9 @@

    Pixel

    @@ -94,37 +95,37 @@ 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>
    +
    concept PixelBasedConcept<typename T>
     {
    -  typename color_space_type<T>;
    +  typename color_space_type<T>;
           where Metafunction<color_space_type<T> >;
           where ColorSpaceConcept<color_space_type<T>::type>;
    -  typename channel_mapping_type<T>;
    +  typename channel_mapping_type<T>;
           where Metafunction<channel_mapping_type<T> >;
           where ChannelMappingConcept<channel_mapping_type<T>::type>;
    -  typename is_planar<T>;
    +  typename is_planar<T>;
           where Metafunction<is_planar<T> >;
           where SameType<is_planar<T>::type, bool>;
     };
     
    -concept HomogeneousPixelBasedConcept<PixelBasedConcept T>
    +concept HomogeneousPixelBasedConcept<PixelBasedConcept T>
     {
    -  typename channel_type<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>
    +
    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>;
    +  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> }
    @@ -135,27 +136,27 @@ access their color space, channel mapping, number of channels, and
           bool operator!=(const P&, const P2&);
     };
     
    -concept MutablePixelConcept<typename P> : PixelConcept<P>, MutableColorBaseConcept<P>
    +concept MutablePixelConcept<typename P> : PixelConcept<P>, MutableColorBaseConcept<P>
     {
       where is_mutable==true;
     };
     
    -concept HomogeneousPixelConcept<PixelConcept P> : HomogeneousColorBaseConcept<P>, HomogeneousPixelBasedConcept<P>
    +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); }
    +  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>
    +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); }
    +  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>
    +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>;
    @@ -168,9 +169,9 @@ 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
    +concept PixelConvertibleConcept
     {
    -  void color_convert(const SrcPixel&, DstPixel&);
    +  void color_convert(const SrcPixel&, DstPixel&);
     };
     
    @@ -178,17 +179,17 @@ modeling the following concept:

    analogous to that for channels and color bases - pixel reference proxies model both, but only pixel values model the latter.

    @@ -198,7 +199,7 @@ both, but only pixel values model the latter.

    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;
    @@ -221,7 +222,7 @@ 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;
    @@ -347,8 +348,8 @@ different color spaces and channel types:

    \ No newline at end of file diff --git a/develop/doc/html/design/pixel_iterator.html b/develop/doc/html/design/pixel_iterator.html index 3cb5ca686..9d77e6f6b 100644 --- a/develop/doc/html/design/pixel_iterator.html +++ b/develop/doc/html/design/pixel_iterator.html @@ -20,6 +20,7 @@ + @@ -69,25 +70,21 @@

    Pixel Iterator

      -
    • Overview

    • -
    • Fundamental Iterator

      -
        -
      • Models

      • +
      • Overview
      • +
      • Fundamental Iterator
      • -
      • Iterator Adaptor

        -
          -
        • Models

        • +
        • Iterator Adaptor
        • -
        • Pixel Dereference Adaptor

          -
            -
          • Models

          • +
          • Pixel Dereference Adaptor
          • -
          • Step Iterator

            - @@ -103,25 +100,25 @@ (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>
            +
            concept PixelIteratorConcept<RandomAccessTraversalIteratorConcept Iterator>
                 : PixelBasedConcept<Iterator>
             {
               where PixelValueConcept<value_type>;
            -  typename const_iterator_type<It>::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> {};
             
            @@ -134,8 +131,8 @@ 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;
            @@ -147,13 +144,13 @@ 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>
            +
            template <typename T>
            +struct inc : public std::unary_function<T,T>
             {
            -  T operator()(T x) const { return ++x; }
            +  T operator()(T x) const { return ++x; }
             };
             
            -template <typename ChannelPtr, typename ColorSpace>
            +template <typename ChannelPtr, typename ColorSpace>
             planar_pixel_iterator<ChannelPtr,ColorSpace>&
             planar_pixel_iterator<ChannelPtr,ColorSpace>::operator++()
             {
            @@ -175,16 +172,16 @@ byte and the bit offset.

            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>
            +
            concept IteratorAdaptorConcept<RandomAccessTraversalIteratorConcept Iterator>
             {
               where SameType<is_iterator_adaptor<Iterator>::type, mpl::true_>;
             
            -  typename iterator_adaptor_get_base<Iterator>;
            +  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;
            +  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>;
             
            @@ -192,29 +189,29 @@ type, and a metafunction to rebind to another base iterator:

            }; template <boost_concepts::Mutable_ForwardIteratorConcept Iterator> -concept MutableIteratorAdaptorConcept : IteratorAdaptorConcept<Iterator> {}; +concept MutableIteratorAdaptorConcept : IteratorAdaptorConcept<Iterator> {};

            Models

            GIL provides several models of IteratorAdaptorConcept:

              -
            • memory_based_step_iterator<Iterator>: An iterator adaptor that changes +

            • memory_based_step_iterator<Iterator>: An iterator adaptor that changes the fundamental step of the base iterator -(see Step Iterator)

            • -
            • dereference_iterator_adaptor<Iterator,Fn>: An iterator that applies a +(see Step Iterator)

            • +
            • dereference_iterator_adaptor<Iterator,Fn>: An iterator that applies a unary function Fn upon dereferencing. It is used, for example, for on-the-fly color conversion. It can be used to construct a shallow image “view” that pretends to have a different color space or channel depth. See Image View for more. The unary function Fn must -model PixelDereferenceAdaptorConcept (see below).

            • +model PixelDereferenceAdaptorConcept (see below).
            @@ -224,15 +221,15 @@ model PixelDerefere 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:
            +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
            +  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;
             
               where Convertible<value_type, result_type>;
            @@ -243,13 +240,13 @@ dereferencing a pixel iterator. Its argument type could be anything (usually a
             

            Models

            GIL provides several models of PixelDereferenceAdaptorConcept:

              -
            • color_convert_deref_fn: a function object that performs color conversion

            • -
            • detail::nth_channel_deref_fn: a function object that returns a grayscale -pixel corresponding to the n-th channel of a given pixel

            • -
            • deref_compose: a function object that composes two models of +

            • color_convert_deref_fn: a function object that performs color conversion
            • +
            • detail::nth_channel_deref_fn: a function object that returns a grayscale +pixel corresponding to the n-th channel of a given pixel
            • +
            • deref_compose: a function object that composes two models of PixelDereferenceAdaptorConcept. Similar to std::unary_compose, except it needs to pull the additional typedefs required by -PixelDereferenceAdaptorConcept

            • +PixelDereferenceAdaptorConcept

            GIL uses pixel dereference adaptors to implement image views that perform color conversion upon dereferencing, or that return the N-th channel of the @@ -266,20 +263,20 @@ adaptor Fn

              -
            • a single-channel view of the red channel of an RGB interleaved image

            • -
            • left-to-right flipped image (step = -fundamental_step)

            • -
            • subsampled view, taking every N-th pixel (step = N*fundamental_step)

            • -
            • traversal in vertical direction (step = number of bytes per row)

            • -
            • any combination of the above (steps are multiplied)

            • +
            • a single-channel view of the red channel of an RGB interleaved image
            • +
            • left-to-right flipped image (step = -fundamental_step)
            • +
            • subsampled view, taking every N-th pixel (step = N*fundamental_step)
            • +
            • traversal in vertical direction (step = number of bytes per row)
            • +
            • any combination of the above (steps are multiplied)

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

            -
            concept StepIteratorConcept<boost_concepts::ForwardTraversalConcept Iterator>
            +
            concept StepIteratorConcept<boost_concepts::ForwardTraversalConcept Iterator>
             {
               template <Integral D> void Iterator::set_step(D step);
             };
             
            -concept MutableStepIteratorConcept<boost_concepts::Mutable_ForwardIteratorConcept Iterator>
            +concept MutableStepIteratorConcept<boost_concepts::Mutable_ForwardIteratorConcept Iterator>
                 : StepIteratorConcept<Iterator>
             {};
             
            @@ -299,26 +296,26 @@ 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
            +
            concept MemoryBasedIteratorConcept
             <
                 boost_concepts::RandomAccessTraversalConcept Iterator
             >
             {
            -  typename byte_to_memunit<Iterator>; where metafunction<byte_to_memunit<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); }
            +  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>
            +
            concept HasDynamicXStepTypeConcept<typename T>
             {
            -  typename dynamic_x_step_type<T>;
            +  typename dynamic_x_step_type<T>;
                   where Metafunction<dynamic_x_step_type<T> >;
             };
             
            @@ -326,12 +323,12 @@ type that allows for dynamically specified horizontal step:

            All models of pixel iterators, locators and image views that GIL provides support HasDynamicXStepTypeConcept.

            @@ -347,8 +344,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, @@ -371,8 +368,8 @@ but not MemoryBased

            \ No newline at end of file diff --git a/develop/doc/html/design/pixel_locator.html b/develop/doc/html/design/pixel_locator.html index b3bc328a8..e6f46cc4a 100644 --- a/develop/doc/html/design/pixel_locator.html +++ b/develop/doc/html/design/pixel_locator.html @@ -20,6 +20,7 @@ + @@ -69,9 +70,9 @@

            Pixel Locator

            @@ -82,30 +83,30 @@ 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 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;
             
               // 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;
            -      typename iterator; where RandomAccessTraversalConcept<iterator>; // iterator along D-th axis.
            +  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;
               };
             
               // 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&);
            @@ -126,24 +127,24 @@ N-dimensional locators model the following concept:

            template <size_t D> axis<D>::iterator Loc::axis_iterator(const difference_type&) const; }; -template <typename Loc> -concept MutableRandomAccessNDLocatorConcept - : RandomAccessNDLocatorConcept<Loc> +template <typename Loc> +concept MutableRandomAccessNDLocatorConcept + : RandomAccessNDLocatorConcept<Loc> { where Mutable<reference>; };

            Two-dimensional locators have additional requirements:

            -
            concept RandomAccess2DLocatorConcept<RandomAccessNDLocatorConcept Loc>
            +
            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);
            @@ -171,16 +172,16 @@ N-dimensional locators model the following concept:

            y_coord_t Loc::y_distance_to(const Loc& loc2, x_coord_t x_diff) const; }; -concept MutableRandomAccess2DLocatorConcept<RandomAccess2DLocatorConcept 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>
            +
            concept HasDynamicYStepTypeConcept<typename T>
             {
            -  typename dynamic_y_step_type<T>;
            +  typename dynamic_y_step_type<T>;
                   where Metafunction<dynamic_y_step_type<T> >;
             };
             
            @@ -190,9 +191,9 @@ 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>
            +
            concept HasTransposedTypeConcept<typename T>
             {
            -  typename transposed_type<T>;
            +  typename transposed_type<T>;
                   where Metafunction<transposed_type<T> >;
             };
             
            @@ -200,30 +201,30 @@ view). Such locators and views must be transposable:

            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>
            +
            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> {};
             
            @@ -236,7 +237,7 @@ that have their pixels in memory. It takes a model of MutableStepIteratorConcept, it models MutablePixelLocatorConcept).

            // StepIterator models StepIteratorConcept, MemoryBasedIteratorConcept
            -template <typename StepIterator>
            +template <typename StepIterator>
             class memory_based_2d_locator;
             
            @@ -251,12 +252,12 @@ iterator to use for horizontal direction, i.e. for iterating over the pixels on the same row. Using the fundamental and step iterators gives us four 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)

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

            • +
            • 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)
            • +
            • memory_based_step_iterator<planar_pixel_iterator<T*,C> > - for planar +images with non-standard step

            Of course, one could provide their own custom x-iterator. One such example described later is an iterator adaptor that performs color conversion when @@ -286,12 +287,12 @@ required by PixelLo they need to provide other models of PixelLocatorConcept.

            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
            +above=loc.cache_location(0,-1);  // remember relative locations of neighbors above and below
             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)
            -*loc=(loc(0,-1)+loc(0,1))/2;     // set pixel (10,24) to the average of (10,23) and (10,25) (grayscale pixels only)
            +*loc=(loc(0,-1)+loc(0,1))/2;     // set pixel (10,24) to the average of (10,23) and (10,25) (grayscale pixels only)
             *loc=(loc[above]+loc[below])/2;  // the same, but faster using cached relative neighbor locations
             
            @@ -316,7 +317,7 @@ the natural memory-friendly order left-to-right inside 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
            +
            template <typename Locator>  // Models PixelLocatorConcept
             class iterator_from_2d
             {
             public:
            @@ -357,8 +358,8 @@ using the x-iterators directly.

            \ No newline at end of file diff --git a/develop/doc/html/design/point.html b/develop/doc/html/design/point.html index 9c335c7d2..2d91672d0 100644 --- a/develop/doc/html/design/point.html +++ b/develop/doc/html/design/point.html @@ -20,6 +20,7 @@ + @@ -69,8 +70,8 @@

            Point

            @@ -78,27 +79,27 @@

            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;
             
                 // 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>
            +
            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);
            @@ -108,10 +109,10 @@ in which both dimensions are of the same type:

            @@ -133,8 +134,8 @@ coordinate type.

            \ No newline at end of file diff --git a/develop/doc/html/design/technicalities.html b/develop/doc/html/design/technicalities.html index 2a472b2f3..d078be996 100644 --- a/develop/doc/html/design/technicalities.html +++ b/develop/doc/html/design/technicalities.html @@ -20,6 +20,7 @@ + @@ -69,7 +70,7 @@

            Technicalities

            @@ -80,16 +81,16 @@ a planar pixel (pla 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
            +
            struct rgb_planar_pixel_iterator
             {
              typedef my_reference_proxy<T> reference;
            - reference operator*() const { return reference(red,green,blue); }
            + 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
            +
            template <typename Pixel>    // Models MutablePixelConcept
             void invert_pixel(Pixel& p);
             
             rgb_planar_pixel_iterator myIt;
            @@ -99,10 +100,10 @@ function that takes a mutable pixel:

            C++ does not allow for matching a temporary object against a non-constant reference. The solution is to:

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

            • +
            • Use const qualifier on all members of the reference proxy object:
            -
            template <typename T>
            -struct my_reference_proxy
            +
            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; }
            @@ -111,11 +112,11 @@ reference. The solution is to:

              -
            • Use different classes to denote mutable and constant reference -(maybe based on the constness of the template parameter)

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

            • +
            • Use different classes to denote mutable and constant reference +(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>
            +
            struct iterator_traits<rgb_planar_pixel_iterator>
             {
               typedef const my_reference_proxy<T> reference;
             };
            @@ -130,7 +131,7 @@ way for these STL algorithms to use your overload is if you define it
             in the std namespace:

            namespace std
             {
            - template <typename T>
            + template <typename T>
              void swap(my_reference_proxy<T>& x, my_reference_proxy<T>& y)
              {
                 my_value<T> tmp=x;
            @@ -158,8 +159,8 @@ suggesting the above solution.

            \ No newline at end of file diff --git a/develop/doc/html/genindex.html b/develop/doc/html/genindex.html index d5cffec4e..0cdcfe030 100644 --- a/develop/doc/html/genindex.html +++ b/develop/doc/html/genindex.html @@ -1,5 +1,6 @@ + @@ -20,6 +21,7 @@ + @@ -74,8 +76,8 @@
            \ No newline at end of file diff --git a/develop/doc/html/image_processing/affine-region-detectors.html b/develop/doc/html/image_processing/affine-region-detectors.html index 3eff817ec..4bc16b202 100644 --- a/develop/doc/html/image_processing/affine-region-detectors.html +++ b/develop/doc/html/image_processing/affine-region-detectors.html @@ -20,6 +20,7 @@ + @@ -79,8 +80,8 @@ or any other stable features.

            Available detectors

            At the moment, the following detectors are implemented

              -
            • Harris detector

            • -
            • Hessian detector

            • +
            • Harris detector
            • +
            • Hessian detector

            @@ -90,13 +91,13 @@ or any other stable features.

            Harris and Hessian

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

            -
            +
            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:

            -
            +
            Moravec window edge case

            Moravec window edge case

            @@ -106,10 +107,10 @@ particular direction.

            work.

            The algorithms have the same structure:

              -
            1. Compute image derivatives

            2. -
            3. Compute Weighted sum

            4. -
            5. Compute response

            6. -
            7. Threshold (optional)

            8. +
            9. Compute image derivatives
            10. +
            11. Compute Weighted sum
            12. +
            13. Compute response
            14. +
            15. Threshold (optional)

            Harris and Hessian differ in what derivatives they compute. Harris computes the following derivatives:

            @@ -161,8 +162,8 @@ detector.” In Alvey vision conference, vol. 15, no. 50, pp. 10-5244.
            \ No newline at end of file diff --git a/develop/doc/html/image_processing/basics.html b/develop/doc/html/image_processing/basics.html index acb5424d5..95ddf6405 100644 --- a/develop/doc/html/image_processing/basics.html +++ b/develop/doc/html/image_processing/basics.html @@ -20,6 +20,7 @@ + @@ -122,8 +123,8 @@ gets sharper depending on it’s sigma value.

            \ No newline at end of file diff --git a/develop/doc/html/image_processing/contrast_enhancement/histogram_equalization.html b/develop/doc/html/image_processing/contrast_enhancement/histogram_equalization.html new file mode 100644 index 000000000..172a881e2 --- /dev/null +++ b/develop/doc/html/image_processing/contrast_enhancement/histogram_equalization.html @@ -0,0 +1,152 @@ + + + + + + + + Histogram Equalization - Boost.GIL documentation + + + + + + + + + + + + +
            + + + + + + + +
            +

            C++ Boost

            +
            +

            +
            + + +
            +
            +
            +
            + + +
            +

            Histogram Equalization

            +
            +

            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.

            +

            An ideal image would be the one having a flat histogram.

            +

            Although care should be taken before applying a non-linear transformation on the image +histogram, there are good mathematical reasons why a flat histogram is the desired goal.

            +

            A simple scenario would be an image with pixels concentrated in an interval, in which case +histogram equalization transforms pixels to achieve a flat histogram image. Thus enhancing +the image contrast.

            +
            +Could not load image. +

            Pixels concentrated in an interval spread out.

            +
            +
            +
            +

            Algorithm

            +
              +
            1. First calculate the histogram corresponding to input image.
            2. +
            3. If it is a multi channeled image (e.g. RGB), convert it to a independent color space +(like YCbCr, HSV etc.).
            4. +
            5. Then calculate the cumulative histogram over the input image.
            6. +
            7. Normalize the histogram to bring bin values between 0-1. For multi-channeled images +normalize each channel independently (by the number of pixels in image).
            8. +
            9. If the histogram of image is H(px) px in [0, 255], then apply +the transformation px’ = H(px), px’ is pixel in output +image.
            10. +
            +

            Explanation

            +

            Since we will be transforming the image to match a flat histogram, we match +the cumulative histogram of the image to the cumulative histogram of a flat histogram.

            +

            Cumulative histogram of flat image is H(px’) = px’ .

            +

            Hence,

            +
            +

            => H(px’) = H(px)

            +

            => px’ = H(px)

            +
            +
            +
            +

            Results

            +

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

            +

            Grayscale Image

            +
            +Could not load image. +
            +

            RGB

            +
            +Could not load image. +
            +
            +
            +

            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));
            +
            +// 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);
            +
            +
            +
            +

            Tip

            +

            Convert an RGB image to a channel independent color space +before trying the histogram equalization algorithm.

            +
            +
            +
            +
            + + + +
            + + + \ No newline at end of file diff --git a/develop/doc/html/image_processing/contrast_enhancement/histogram_matching.html b/develop/doc/html/image_processing/contrast_enhancement/histogram_matching.html new file mode 100644 index 000000000..deca41f4e --- /dev/null +++ b/develop/doc/html/image_processing/contrast_enhancement/histogram_matching.html @@ -0,0 +1,145 @@ + + + + + + + + Histogram Matching - Boost.GIL documentation + + + + + + + + + + + + +
            + + + + + + + +
            +

            C++ Boost

            +
            +

            +
            + + +
            +
            +
            +
            + + +
            +

            Histogram Matching

            +
            +

            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 +features in either image.

            +

            The famous histogram equalization is a special case of this algorithm when the reference image +is expected to have a uniform histogram.

            +
            +
            +

            Algorithm

            +
              +
            1. Calculate the histogram corresponding to input image and reference image.
            2. +
            3. If it is a multi channeled image (e.g. RGB), convert both to an independent color space +(like YCbCr, HSV etc.).
            4. +
            5. Then calculate the cumulative histogram over the input image and reference image.
            6. +
            7. Normalize both the histogram to bring bin values between 0-1. For multi-channeled images +normalize each channel independently (by the number of pixels in image).
            8. +
            9. If the cumulative histogram of input image is H(px) and of reference image is R(px’) +px & px’ in [0, 255], then apply the transformation +px’ = R-1(H(px))
            10. +
            +

            Explanation

            +

            Since we will be transforming the image to match a reference image, we match +the cumulative histogram of the image to the cumulative histogram of the reference histogram.

            +

            Hence,

            +
            +

            => R(px’) = H(px)

            +

            => px’ = R-1(H(px))

            +
            +
            +
            +

            Results

            +

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

            +

            Original Image(left) & Reference Image(right)

            +
            +Could not load image. +
            +

            Histogram matched Image

            +
            +Could not load image. +
            +
            +
            +

            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));
            +
            +// 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);
            +
            +
            +
            +

            Tip

            +

            Convert an RGB image to a channel independent color space +before trying the histogram matching algorithm.

            +
            +
            +
            +
            + + + +
            + + + \ No newline at end of file diff --git a/develop/doc/html/image_processing/index.html b/develop/doc/html/image_processing/index.html index 7375817ac..19449cecb 100644 --- a/develop/doc/html/image_processing/index.html +++ b/develop/doc/html/image_processing/index.html @@ -20,6 +20,7 @@ + @@ -98,8 +99,8 @@ features, structures and algorithms, for image processing and analysis.

            \ No newline at end of file diff --git a/develop/doc/html/image_processing/overview.html b/develop/doc/html/image_processing/overview.html index fe2a76e3b..da213d17a 100644 --- a/develop/doc/html/image_processing/overview.html +++ b/develop/doc/html/image_processing/overview.html @@ -20,6 +20,7 @@ + @@ -70,8 +71,8 @@

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

            The image processing features were first released with Boost 1.72.

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

            \ No newline at end of file diff --git a/develop/doc/html/index.html b/develop/doc/html/index.html index e38e61b32..e8a1752be 100644 --- a/develop/doc/html/index.html +++ b/develop/doc/html/index.html @@ -20,6 +20,7 @@ + @@ -63,7 +64,7 @@

            Boost Generic Image Library

            -

            The Generic Image Library (GIL) is a C++11 library that abstracts image +

            The Generic Image Library (GIL) is a C++11 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.

            @@ -142,28 +143,28 @@ image type.

            Examples

            @@ -177,8 +178,8 @@ Blurring images (requires the optional Numeric extension)

    \ No newline at end of file diff --git a/develop/doc/html/installation.html b/develop/doc/html/installation.html index 71e4ce3b4..5f54b966a 100644 --- a/develop/doc/html/installation.html +++ b/develop/doc/html/installation.html @@ -20,6 +20,7 @@ + @@ -65,18 +66,33 @@

    Installation

    -

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

    -

    The GIL is a header-only library. Meaning, it consists of header files only, +

    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 to link against.

    -

    Note

    -

    The exception to dependencies-free rule of GIL is the I/O extension +

    Note

    +

    The exception to dependencies-free rule of GIL is the I/O extension which requires client libraries implementing popular image formats like libpng, libjpeg, etc.

    -

    In order to use GIL, including boost/gil.hpp and telling your compiler +

    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

    +

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

    +
    +

    Note

    +

    We are planning to drop support for require C++14 support in Boost 1.76 or later, +or selectively drop support for GCC 5 due to its issues with inheriting constructors, +see discussion for PR #526.

    +
    +

    For the actual list of currently tested compilers, check results of the library CI +builds linked from the README.md +or inspect the CI services configuration files in the develop branch +of the library repository.

    +
    @@ -89,8 +105,8 @@ where to find Boost and GIL headers should be sufficient for most projects.

    \ No newline at end of file diff --git a/develop/doc/html/io.html b/develop/doc/html/io.html index be4eb3208..4932a9e78 100644 --- a/develop/doc/html/io.html +++ b/develop/doc/html/io.html @@ -20,6 +20,7 @@ + @@ -83,11 +84,11 @@ Furthermore the GIL extension Toolbox is used.

    Depending on the image format one or more of the following image libraries might be needed:

      -
    • libtiff

    • -
    • libjpeg

    • -
    • libpng

    • -
    • libraw

    • -
    • zlib

    • +
    • libtiff
    • +
    • libjpeg
    • +
    • libpng
    • +
    • libraw
    • +
    • zlib

    The library is designed to support as many formats as required by the user. For instance, if the user only needs bmp support none of the above mentioned @@ -235,13 +236,13 @@ provides access to the so-called backend.

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

      -
    • read_image - read into a gil image with no conversion. -Memory is allocated.

    • -
    • read_view - read into a gil view with no conversion.

    • -
    • read_and_convert_image - read and convert into a gil image. -Memory is allocated.

    • -
    • read_and_convert_view - read and convert into a gil view.

    • -
    • read_image_info - read the image header.

    • +
    • read_image - read into a gil image with no conversion. +Memory is allocated.
    • +
    • read_view - read into a gil view with no conversion.
    • +
    • read_and_convert_image - read and convert into a gil image. +Memory is allocated.
    • +
    • read_and_convert_view - read and convert into a gil view.
    • +
    • read_image_info - read the image header.

    Conversion in this context is necessary if the source (file) has an incompatible color space with the destination (gil image type). @@ -301,7 +302,7 @@ The scanline_read_i The following code sample shows the usage:

    typedef tiff_tag tag_t;
     
    -typedef scanline_reader< typename get_read_device< const char*
    +typedef scanline_reader< typename get_read_device< const char*
                                                      , tag_t
                                                      >::type
                             , tag_t
    @@ -377,67 +378,67 @@ the possible settings.

    Compiler Symbols

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

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

    Symbol

    Description

    SymbolDescription

    BOOST_GIL_IO_ENABLE_GRAY_ALPHA

    Enable the color space “gray_alpha”.

    BOOST_GIL_IO_ENABLE_GRAY_ALPHAEnable the color space “gray_alpha”.

    BOOST_GIL_IO_ADD_FS_PATH_SUPPORT

    Enable boost::filesystem 3.0 library.

    BOOST_GIL_IO_ADD_FS_PATH_SUPPORTEnable boost::filesystem 3.0 library.

    BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED

    Use libpng in floating point mode. This symbol is incompatible with BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED.

    BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTEDUse libpng in floating point mode. This symbol is incompatible with BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED.

    BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED

    Use libpng in integer mode. This symbol is incompatible with BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED.

    BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTEDUse libpng in integer mode. This symbol is incompatible with BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED.

    BOOST_GIL_IO_PNG_DITHERING_SUPPORTED

    Look up “dithering” in libpng manual for explanation.

    BOOST_GIL_IO_PNG_DITHERING_SUPPORTEDLook up “dithering” in libpng manual for explanation.

    BOOST_GIL_IO_PNG_1_4_OR_LOWER

    Allow compiling with libpng 1.4 or lower.

    BOOST_GIL_IO_PNG_1_4_OR_LOWERAllow compiling with libpng 1.4 or lower.

    BOOST_GIL_EXTENSION_IO_JPEG_C_LIB_COMPILED_AS_CPLUSPLUS

    libjpeg is compiled as c++ lib.

    BOOST_GIL_EXTENSION_IO_JPEG_C_LIB_COMPILED_AS_CPLUSPLUSlibjpeg is compiled as c++ lib.

    BOOST_GIL_EXTENSION_IO_PNG_C_LIB_COMPILED_AS_CPLUSPLUS

    libpng is compiled as c++ lib.

    BOOST_GIL_EXTENSION_IO_PNG_C_LIB_COMPILED_AS_CPLUSPLUSlibpng is compiled as c++ lib.

    BOOST_GIL_EXTENSION_IO_TIFF_C_LIB_COMPILED_AS_CPLUSPLUS

    libtiff is compiled as c++ lib.

    BOOST_GIL_EXTENSION_IO_TIFF_C_LIB_COMPILED_AS_CPLUSPLUSlibtiff is compiled as c++ lib.

    BOOST_GIL_EXTENSION_IO_ZLIB_C_LIB_COMPILED_AS_CPLUSPLUS

    zlib is compiled as c++ lib.

    BOOST_GIL_EXTENSION_IO_ZLIB_C_LIB_COMPILED_AS_CPLUSPLUSzlib is compiled as c++ lib.

    BOOST_GIL_IO_TEST_ALLOW_READING_IMAGES

    Allow basic test images to be read from local hard drive. The paths can be set in paths.hpp

    BOOST_GIL_IO_TEST_ALLOW_READING_IMAGESAllow basic test images to be read from local hard drive. The paths can be set in paths.hpp

    BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES

    Allow images to be written to the local hard drive. The paths can be set in paths.hpp

    BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGESAllow images to be written to the local hard drive. The paths can be set in paths.hpp

    BOOST_GIL_IO_USE_BMP_TEST_SUITE_IMAGES

    Run tests using the bmp test images suite. See _BMP_TEST_FILES

    BOOST_GIL_IO_USE_BMP_TEST_SUITE_IMAGESRun tests using the bmp test images suite. See _BMP_TEST_FILES

    BOOST_GIL_IO_USE_PNG_TEST_SUITE_IMAGES

    Run tests using the png test images suite. See _PNG_TEST_FILES

    BOOST_GIL_IO_USE_PNG_TEST_SUITE_IMAGESRun tests using the png test images suite. See _PNG_TEST_FILES

    BOOST_GIL_IO_USE_PNM_TEST_SUITE_IMAGES

    Run tests using the pnm test images suite. Send me an email for accessing the files.

    BOOST_GIL_IO_USE_PNM_TEST_SUITE_IMAGESRun tests using the pnm test images suite. Send me an email for accessing the files.

    BOOST_GIL_IO_USE_TIFF_LIBTIFF_TEST_SUITE_IMAGES

    Run tests using the targa file format test images suite. See _TIFF_LIB_TIFF_TEST_FILES

    BOOST_GIL_IO_USE_TIFF_LIBTIFF_TEST_SUITE_IMAGESRun tests using the targa file format test images suite. See _TIFF_LIB_TIFF_TEST_FILES

    BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES

    Run tests using the targa file format test images suite. See _TIFF_GRAPHICSMAGICK_TEST_FILES

    BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGESRun tests using the targa file format test images suite. See _TIFF_GRAPHICSMAGICK_TEST_FILES
    @@ -452,14 +453,16 @@ following -
    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. This is subject to change soon.

    @@ -475,14 +478,16 @@ found here,
    JPEG_Lib

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

    -
    -
    Read
    -

    gray8_image_t, rgb8_image_t, cmyk8_image_t

    -
    -
    Write
    -

    gray8_image_t, rgb8_image_t, cmyk8_image_t

    -
    -
    + +++ + + + + + +
    Read:gray8_image_t, rgb8_image_t, cmyk8_image_t
    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. @@ -499,14 +504,16 @@ here,

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

    -
    -
    Read
    -

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

    -
    -
    Write
    -

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

    -
    -
    + +++ + + + + + +
    Read:gray1, gray2, gray4, gray8, gray16, gray_alpha_8, gray_alpha_16, rgb8, rgb16, rgba8, rgba16
    Write:gray1, gray2, gray4, gray8, gray16, gray_alpha_8, gray_alpha_16, rgb8, rgb16, rgba8, rgba16

    For reading gray_alpha images the user has to compile application with BOOST_GIL_IO_ENABLE_GRAY_ALPHA macro defined. This color space is defined in the toolbox by using gray_alpha.hpp.

    @@ -517,14 +524,16 @@ following -
    Read
    -

    gray1, gray8, rgb8

    -
    -
    Write
    -

    gray1, gray8, rgb8

    -
    - + +++ + + + + + +
    Read:gray1, gray8, rgb8
    Write:gray1, gray8, rgb8

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

    @@ -537,14 +546,16 @@ that is types from P1 through P6; can write only binary formats.

    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
    -

    rgb8_image_t and rgba8_image_t

    -
    -
    Write
    -

    rgb8_image_t and rgba8_image_t

    -
    -
    + +++ + + + + + +
    Read: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. This is subject to change soon.

    @@ -564,20 +575,20 @@ For instance, rbg32 formats, like integer values or floating point values.

    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:

      -
    • Multi-page TIFF - read only

    • -
    • Strip TIFF - read and write support

    • -
    • Tiled TIFF - read and write support with user defined tiled sizes

    • -
    • Bit images TIFF - fully supported, like gray1_image_t (minisblack)

    • -
    • Planar TIFF - fully supported

    • -
    • Floating-point TIFF - fully supported

    • -
    • Palette TIFF - supported but no indexed image type is available as of now

    • +
    • Multi-page TIFF - read only
    • +
    • Strip TIFF - read and write support
    • +
    • Tiled TIFF - read and write support with user defined tiled sizes
    • +
    • Bit images TIFF - fully supported, like gray1_image_t (minisblack)
    • +
    • Planar TIFF - fully supported
    • +
    • Floating-point TIFF - fully supported
    • +
    • Palette TIFF - supported but no indexed image type is available as of now

    This gil extension uses two different test image suites to test read and write capabilities. See test_image folder. @@ -590,37 +601,39 @@ It’s advisable to use ImageMagick test viewer to display images.

    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_all.hpp - includes xxx_read.hpp and xxx_write.hpp

      • +
      • +
        Create the following files for your new xxx format
        +
          +
        • 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:

        -
        struct xxx_tag : format_tag {};
        +
      • Add the code to the boost::gil::detail namespace

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

        +
        struct xxx_tag : format_tag {};
         
      • -
      • Create the image_read_info for the new format. It contains all the +

      • 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 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 +

      • 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 > {};
        +
        template<> struct image_write_info< xxx_tag > {};
         
      • -
      • Use the following reader skeleton as a start:

        -
        template< typename Device
        -        , typename ConversionPolicy
        +
      • Use the following reader skeleton as a start:

        +
        template< typename Device
        +        , typename ConversionPolicy
                 >
         class reader< Device
                     , xxx_tag
        @@ -632,7 +645,7 @@ information that are necessary to write an image:

        { private: - typedef typename ConversionPolicy::color_converter_type cc_t; + typedef typename ConversionPolicy::color_converter_type cc_t; public: @@ -654,7 +667,7 @@ information that are necessary to write an image:

        // your implementation here } - template< typename View > + template< typename View > void apply( const View& dst_view ) { // your implementation here @@ -663,8 +676,8 @@ information that are necessary to write an image:

      • -
      • The writer skeleton:

        -
        template< typename Device >
        +
      • The writer skeleton:

        +
        template< typename Device >
         class writer< Device
                     , xxx_tag
                     >
        @@ -675,13 +688,13 @@ information that are necessary to write an image:

        : out(file) {} - template<typename View> + template<typename View> void apply( const View& view ) { // your implementation here } - template<typename View> + template<typename View> void apply( const View& view , const image_write_info< xxx_tag >& info ) { @@ -705,23 +718,22 @@ To enable unit tests which make use of them set the following compiler options BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES.

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

        -
        -
        BMP
        -

        BMP_TEST_FILES – BOOST_GIL_IO_USE_BMP_TEST_SUITE_IMAGES

        -
        -
        PNG
        -

        PNG_TEST_FILES – BOOST_GIL_IO_USE_PNG_TEST_SUITE_IMAGES

        -
        -
        PNM
        -

        request files from me – BOOST_GIL_IO_USE_PNM_TEST_SUITE_IMAGES

        -
        -
        TIFF
        -

        TIFF_LIB_TIFF_TEST_FILES – BOOST_GIL_IO_USE_TIFF_LIBTIFF_TEST_SUITE_IMAGES

        -
        -
        TIFF
        -

        TIFF_GRAPHICSMAGICK_TEST_FILES – BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES

        -
        -
        + +++ + + + + + + + + + + + +
        BMP:BMP_TEST_FILES – BOOST_GIL_IO_USE_BMP_TEST_SUITE_IMAGES
        PNG:PNG_TEST_FILES – BOOST_GIL_IO_USE_PNG_TEST_SUITE_IMAGES
        PNM:request files from me – BOOST_GIL_IO_USE_PNM_TEST_SUITE_IMAGES
        TIFF:TIFF_LIB_TIFF_TEST_FILES – BOOST_GIL_IO_USE_TIFF_LIBTIFF_TEST_SUITE_IMAGES
        TIFF:TIFF_GRAPHICSMAGICK_TEST_FILES – BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
        @@ -735,8 +747,8 @@ to enable the tests:

      • \ No newline at end of file diff --git a/develop/doc/html/naming.html b/develop/doc/html/naming.html index 75d80297b..b4a3a2824 100644 --- a/develop/doc/html/naming.html +++ b/develop/doc/html/naming.html @@ -20,6 +20,7 @@ + @@ -75,23 +76,23 @@ tests and examples.

      • where:

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

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

        • -
        • By default, type of channel is unsigned integral. +

        • ColorSpace indicates layout and ordering of components. +For example, rgb, bgr, cmyk, rgba.
        • +
        • BitDepth indicates the bit depth of the color channel. +For example, 8,``16``,``32``.
        • +
        • 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.

        • -
        • By default, objects operate on mutable pixels. -The c tag indicates object operating over immutable pixels.

        • -
        • _planar indicates planar organization (as opposed to interleaved).

        • -
        • _step indicates special image views, locators and iterators which +The f tag indicates a floating point type, which is always signed.

        • +
        • By default, objects operate on mutable pixels. +The c tag indicates object operating over immutable pixels.
        • +
        • _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 -pixel.

        • -
        • ClassType is _image (image), _view (image view), _loc (pixel +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.

        • +_pixel (pixel value). +
        • _t suffix indicaes it is a name of a type.

        For example:

        bgr8_image_t             a;    // 8-bit interleaved BGR image
        @@ -113,8 +114,8 @@ pixel.

      • \ No newline at end of file diff --git a/develop/doc/html/numeric.html b/develop/doc/html/numeric.html index 3281c303f..e1cc6d3df 100644 --- a/develop/doc/html/numeric.html +++ b/develop/doc/html/numeric.html @@ -20,6 +20,7 @@ + @@ -78,8 +79,8 @@
    \ No newline at end of file diff --git a/develop/doc/html/objects.inv b/develop/doc/html/objects.inv index 11671adb0..c9354cd1b 100644 Binary files a/develop/doc/html/objects.inv and b/develop/doc/html/objects.inv differ diff --git a/develop/doc/html/reference/adaptive__histogram__equalization_8hpp_source.html b/develop/doc/html/reference/adaptive__histogram__equalization_8hpp_source.html new file mode 100644 index 000000000..42826d456 --- /dev/null +++ b/develop/doc/html/reference/adaptive__histogram__equalization_8hpp_source.html @@ -0,0 +1,327 @@ + + + + + + + + + Generic Image Library: adaptive_histogram_equalization.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    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 
    +
    121 
    +
    137 template <typename SrcView, typename DstView>
    +
    138 void non_overlapping_interpolated_clahe(
    +
    139  SrcView const& src_view,
    +
    140  DstView const& dst_view,
    +
    141  std::size_t tile_width_x = 20,
    +
    142  std::size_t tile_width_y = 20,
    +
    143  double clip_limit = 0.03,
    +
    144  std::size_t bin_width = 1.0,
    +
    145  bool mask = false,
    +
    146  std::vector<std::vector<bool>> src_mask = {})
    +
    147 {
    +
    148  gil_function_requires<ImageViewConcept<SrcView>>();
    +
    149  gil_function_requires<MutableImageViewConcept<DstView>>();
    +
    150 
    +
    151  static_assert(
    +
    152  color_spaces_are_compatible<
    +
    153  typename color_space_type<SrcView>::type,
    +
    154  typename color_space_type<DstView>::type>::value,
    +
    155  "Source and destination views must have same color space");
    +
    156 
    +
    157  using source_channel_t = typename channel_type<SrcView>::type;
    +
    158  using dst_channel_t = typename channel_type<DstView>::type;
    +
    159  using coord_t = typename SrcView::x_coord_t;
    +
    160 
    +
    161  std::size_t const channels = num_channels<SrcView>::value;
    +
    162  coord_t const width = src_view.width();
    +
    163  coord_t const height = src_view.height();
    +
    164 
    +
    165  // Find control points
    +
    166 
    +
    167  std::vector<coord_t> sample_x;
    +
    168  coord_t sample_x1 = tile_width_x / 2;
    +
    169  coord_t sample_x2 = (tile_width_x + 1) / 2;
    +
    170  coord_t sample_y1 = tile_width_y / 2;
    +
    171  coord_t sample_y2 = (tile_width_y + 1) / 2;
    +
    172 
    +
    173  auto extend_left = tile_width_x;
    +
    174  auto extend_top = tile_width_y;
    +
    175  auto extend_right = (tile_width_x - width % tile_width_x) % tile_width_x + tile_width_x;
    +
    176  auto extend_bottom = (tile_width_y - height % tile_width_y) % tile_width_y + tile_width_y;
    +
    177 
    +
    178  auto new_width = width + extend_left + extend_right;
    +
    179  auto new_height = height + extend_top + extend_bottom;
    +
    180 
    +
    181  image<typename SrcView::value_type> padded_img(new_width, new_height);
    +
    182 
    +
    183  auto top_left_x = tile_width_x;
    +
    184  auto top_left_y = tile_width_y;
    +
    185  auto bottom_right_x = tile_width_x + width;
    +
    186  auto bottom_right_y = tile_width_y + height;
    +
    187 
    +
    188  copy_pixels(src_view, subimage_view(view(padded_img), top_left_x, top_left_y, width, height));
    +
    189 
    +
    190  for (std::size_t k = 0; k < channels; k++)
    +
    191  {
    +
    192  std::vector<histogram<source_channel_t>> prev_row(new_width / tile_width_x),
    +
    193  next_row((new_width / tile_width_x));
    +
    194  std::vector<std::map<source_channel_t, source_channel_t>> prev_map(
    +
    195  new_width / tile_width_x),
    +
    196  next_map((new_width / tile_width_x));
    +
    197 
    +
    198  coord_t prev = 0, next = 1;
    +
    199  auto channel_view = nth_channel_view(view(padded_img), k);
    +
    200 
    +
    201  for (std::ptrdiff_t i = top_left_y; i < bottom_right_y; ++i)
    +
    202  {
    +
    203  if ((i - sample_y1) / tile_width_y >= next || i == top_left_y)
    +
    204  {
    +
    205  if (i != top_left_y)
    +
    206  {
    +
    207  prev = next;
    +
    208  next++;
    +
    209  }
    +
    210  prev_row = next_row;
    +
    211  prev_map = next_map;
    +
    212  for (std::ptrdiff_t j = sample_x1; j < new_width; j += tile_width_x)
    +
    213  {
    +
    214  auto img_view = subimage_view(
    +
    215  channel_view, j - sample_x1, next * tile_width_y,
    +
    216  std::max<int>(
    +
    217  std::min<int>(tile_width_x + j - sample_x1, bottom_right_x) -
    +
    218  (j - sample_x1),
    +
    219  0),
    +
    220  std::max<int>(
    +
    221  std::min<int>((next + 1) * tile_width_y, bottom_right_y) -
    +
    222  next * tile_width_y,
    +
    223  0));
    +
    224 
    +
    225  fill_histogram(
    +
    226  img_view, next_row[(j - sample_x1) / tile_width_x], bin_width, false,
    +
    227  false);
    +
    228 
    +
    229  detail::clip_and_redistribute(
    +
    230  next_row[(j - sample_x1) / tile_width_x],
    +
    231  next_row[(j - sample_x1) / tile_width_x], clip_limit);
    +
    232 
    +
    233  next_map[(j - sample_x1) / tile_width_x] =
    +
    234  histogram_equalization(next_row[(j - sample_x1) / tile_width_x]);
    +
    235  }
    +
    236  }
    +
    237  bool prev_row_mask = 1, next_row_mask = 1;
    +
    238  if (prev == 0)
    +
    239  prev_row_mask = false;
    +
    240  else if (next + 1 == new_height / tile_width_y)
    +
    241  next_row_mask = false;
    +
    242  for (std::ptrdiff_t j = top_left_x; j < bottom_right_x; ++j)
    +
    243  {
    +
    244  bool prev_col_mask = true, next_col_mask = true;
    +
    245  if ((j - sample_x1) / tile_width_x == 0)
    +
    246  prev_col_mask = false;
    +
    247  else if ((j - sample_x1) / tile_width_x + 1 == new_width / tile_width_x - 1)
    +
    248  next_col_mask = false;
    +
    249 
    +
    250  // Bilinear interpolation
    +
    251  point_t top_left(
    +
    252  (j - sample_x1) / tile_width_x * tile_width_x + sample_x1,
    +
    253  prev * tile_width_y + sample_y1);
    +
    254  point_t top_right(top_left.x + tile_width_x, top_left.y);
    +
    255  point_t bottom_left(top_left.x, top_left.y + tile_width_y);
    +
    256  point_t bottom_right(top_left.x + tile_width_x, top_left.y + tile_width_y);
    +
    257 
    +
    258  long double x_diff = top_right.x - top_left.x;
    +
    259  long double y_diff = bottom_left.y - top_left.y;
    +
    260 
    +
    261  long double x1 = (j - top_left.x) / x_diff;
    +
    262  long double x2 = (top_right.x - j) / x_diff;
    +
    263  long double y1 = (i - top_left.y) / y_diff;
    +
    264  long double y2 = (bottom_left.y - i) / y_diff;
    +
    265 
    +
    266  if (prev_row_mask == 0)
    +
    267  y1 = 1;
    +
    268  else if (next_row_mask == 0)
    +
    269  y2 = 1;
    +
    270  if (prev_col_mask == 0)
    +
    271  x1 = 1;
    +
    272  else if (next_col_mask == 0)
    +
    273  x2 = 1;
    +
    274 
    +
    275  long double numerator =
    +
    276  ((prev_row_mask & prev_col_mask) * x2 *
    +
    277  prev_map[(top_left.x - sample_x1) / tile_width_x][channel_view(j, i)] +
    +
    278  (prev_row_mask & next_col_mask) * x1 *
    +
    279  prev_map[(top_right.x - sample_x1) / tile_width_x][channel_view(j, i)]) *
    +
    280  y2 +
    +
    281  ((next_row_mask & prev_col_mask) * x2 *
    +
    282  next_map[(bottom_left.x - sample_x1) / tile_width_x][channel_view(j, i)] +
    +
    283  (next_row_mask & next_col_mask) * x1 *
    +
    284  next_map[(bottom_right.x - sample_x1) / tile_width_x][channel_view(j, i)]) *
    +
    285  y1;
    +
    286 
    +
    287  if (mask && !src_mask[i - top_left_y][j - top_left_x])
    +
    288  {
    +
    289  dst_view(j - top_left_x, i - top_left_y) =
    +
    290  channel_convert<dst_channel_t>(
    +
    291  static_cast<source_channel_t>(channel_view(i, j)));
    +
    292  }
    +
    293  else
    +
    294  {
    +
    295  dst_view(j - top_left_x, i - top_left_y) =
    +
    296  channel_convert<dst_channel_t>(static_cast<source_channel_t>(numerator));
    +
    297  }
    +
    298  }
    +
    299  }
    +
    300  }
    +
    301 }
    +
    302 
    +
    303 }} //namespace boost::gil
    +
    304 
    +
    305 #endif
    +
    +
    nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
    Definition: image_view_factory.hpp:418
    +
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    +
    View subimage_view(View const &src, typename View::point_t const &topleft, typename View::point_t const &dimensions)
    Definition: image_view_factory.hpp:254
    + + + + + + diff --git a/develop/doc/html/reference/algorithm_8hpp_source.html b/develop/doc/html/reference/algorithm_8hpp_source.html index 1ec3c80e0..7a87e5722 100644 --- a/develop/doc/html/reference/algorithm_8hpp_source.html +++ b/develop/doc/html/reference/algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: algorithm.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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_ALGORITHM_HPP
    9 #define BOOST_GIL_ALGORITHM_HPP
    10 
    11 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
    12 #include <boost/gil/color_base_algorithm.hpp>
    13 #include <boost/gil/concepts.hpp>
    14 #include <boost/gil/image_view.hpp>
    15 #include <boost/gil/image_view_factory.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 #include <boost/gil/detail/type_traits.hpp>
    18 
    19 #include <boost/assert.hpp>
    20 #include <boost/config.hpp>
    21 
    22 #include <algorithm>
    23 #include <cstddef>
    24 #include <cstring>
    25 #include <iterator>
    26 #include <memory>
    27 #include <type_traits>
    28 #include <typeinfo>
    29 
    30 namespace boost { namespace gil {
    31 
    32 //forward declarations
    33 template <typename ChannelPtr, typename ColorSpace>
    35 template <typename Iterator>
    37 template <typename StepIterator>
    39 
    40 // a tag denoting incompatible arguments
    41 struct error_t {};
    42 
    67 
    71 
    80 template <typename Derived, typename Result=void>
    82 {
    83  using result_type = Result;
    84 
    85  template <typename V1, typename V2> BOOST_FORCEINLINE
    86  result_type operator()(const std::pair<const V1*,const V2*>& p) const {
    87  return apply(*p.first, *p.second, typename views_are_compatible<V1,V2>::type());
    88  }
    89 
    90  template <typename V1, typename V2> BOOST_FORCEINLINE
    91  result_type operator()(const V1& v1, const V2& v2) const {
    92  return apply(v1, v2, typename views_are_compatible<V1,V2>::type());
    93  }
    94 
    95  result_type operator()(const error_t&) const { throw std::bad_cast(); }
    96 private:
    97 
    98  // dispatch from apply overload to a function with distinct name
    99  template <typename V1, typename V2>
    100  BOOST_FORCEINLINE
    101  result_type apply(V1 const& v1, V2 const& v2, std::false_type) const
    102  {
    103  return ((const Derived*)this)->apply_incompatible(v1, v2);
    104  }
    105 
    106  // dispatch from apply overload to a function with distinct name
    107  template <typename V1, typename V2>
    108  BOOST_FORCEINLINE
    109  result_type apply(V1 const& v1, V2 const& v2, std::true_type) const
    110  {
    111  return ((const Derived*)this)->apply_compatible(v1, v2);
    112  }
    113 
    114  // function with distinct name - it can be overloaded by subclasses
    115  template <typename V1, typename V2>
    116  BOOST_FORCEINLINE
    117  result_type apply_incompatible(V1 const& /*v1*/, V2 const& /*v2*/) const
    118  {
    119  throw std::bad_cast();
    120  }
    121 };
    122 
    123 }} // namespace boost::gil
    124 
    126 // std::copy and gil::copy_pixels
    128 
    132 
    133 namespace std {
    134 
    137 template<typename T, typename CS>
    138 BOOST_FORCEINLINE
    139 auto copy(
    144 {
    145  auto p = std::copy((unsigned char*)first, (unsigned char*)last, (unsigned char*)dst);
    146  return reinterpret_cast<boost::gil::pixel<T, CS>*>(p);
    147 }
    148 
    151 template<typename T, typename CS>
    152 BOOST_FORCEINLINE boost::gil::pixel<T,CS>*
    155  return (boost::gil::pixel<T,CS>*)std::copy((unsigned char*)first,(unsigned char*)last, (unsigned char*)dst);
    156 }
    157 } // namespace std
    158 
    159 namespace boost { namespace gil {
    160 namespace detail {
    161 template <typename I, typename O> struct copy_fn {
    162  BOOST_FORCEINLINE I operator()(I first, I last, O dst) const { return std::copy(first,last,dst); }
    163 };
    164 } // namespace detail
    165 } } // namespace boost::gil
    166 
    167 namespace std {
    170 template<typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
    172  boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
    173  static_for_each(first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
    174  return dst+(last-first);
    175 }
    176 } // namespace std
    177 
    178 namespace boost { namespace gil {
    179 namespace detail {
    182 template <typename I, typename O>
    183 struct copier_n {
    184  BOOST_FORCEINLINE void operator()(I src, typename std::iterator_traits<I>::difference_type n, O dst) const { std::copy(src,src+n, dst); }
    185 };
    186 
    188 template <typename IL, typename O> // IL Models ConstPixelLocatorConcept, O Models PixelIteratorConcept
    189 struct copier_n<iterator_from_2d<IL>,O> {
    190  using diff_t = typename std::iterator_traits<iterator_from_2d<IL>>::difference_type;
    191  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, O dst) const {
    192  gil_function_requires<PixelLocatorConcept<IL>>();
    193  gil_function_requires<MutablePixelIteratorConcept<O>>();
    194  while (n>0) {
    195  diff_t l=src.width()-src.x_pos();
    196  diff_t numToCopy=(n<l ? n:l);
    197  detail::copy_n(src.x(), numToCopy, dst);
    198  dst+=numToCopy;
    199  src+=numToCopy;
    200  n-=numToCopy;
    201  }
    202  }
    203 };
    204 
    206 template <typename I, typename OL> // I Models ConstPixelIteratorConcept, OL Models PixelLocatorConcept
    207 struct copier_n<I,iterator_from_2d<OL>> {
    208  using diff_t = typename std::iterator_traits<I>::difference_type;
    209  BOOST_FORCEINLINE void operator()(I src, diff_t n, iterator_from_2d<OL> dst) const {
    210  gil_function_requires<PixelIteratorConcept<I>>();
    211  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    212  while (n>0) {
    213  diff_t l=dst.width()-dst.x_pos();
    214  diff_t numToCopy=(n<l ? n:l);
    215  detail::copy_n(src, numToCopy, dst.x());
    216  dst+=numToCopy;
    217  src+=numToCopy;
    218  n-=numToCopy;
    219  }
    220  }
    221 };
    222 
    224 template <typename IL, typename OL>
    226  using diff_t = typename iterator_from_2d<IL>::difference_type;
    227  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, iterator_from_2d<OL> dst) const {
    228  gil_function_requires<PixelLocatorConcept<IL>>();
    229  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    230  if (src.x_pos()!=dst.x_pos() || src.width()!=dst.width()) {
    231  while(n-->0) {
    232  *dst++=*src++;
    233  }
    234  }
    235  while (n>0) {
    236  diff_t l=dst.width()-dst.x_pos();
    237  diff_t numToCopy=(n<l ? n : l);
    238  detail::copy_n(src.x(), numToCopy, dst.x());
    239  dst+=numToCopy;
    240  src+=numToCopy;
    241  n-=numToCopy;
    242  }
    243  }
    244 };
    245 
    246 template <typename SrcIterator, typename DstIterator>
    247 BOOST_FORCEINLINE DstIterator copy_with_2d_iterators(SrcIterator first, SrcIterator last, DstIterator dst) {
    248  using src_x_iterator = typename SrcIterator::x_iterator;
    249  using dst_x_iterator = typename DstIterator::x_iterator;
    250 
    251  typename SrcIterator::difference_type n = last - first;
    252 
    253  if (first.is_1d_traversable()) {
    254  if (dst.is_1d_traversable())
    255  copier_n<src_x_iterator,dst_x_iterator>()(first.x(),n, dst.x());
    256  else
    257  copier_n<src_x_iterator,DstIterator >()(first.x(),n, dst);
    258  } else {
    259  if (dst.is_1d_traversable())
    260  copier_n<SrcIterator,dst_x_iterator>()(first,n, dst.x());
    261  else
    262  copier_n<SrcIterator,DstIterator>()(first,n,dst);
    263  }
    264  return dst+n;
    265 }
    266 } // namespace detail
    267 } } // namespace boost::gil
    268 
    269 namespace std {
    272 template <typename IL, typename OL>
    274  return boost::gil::detail::copy_with_2d_iterators(first,last,dst);
    275 }
    276 } // namespace std
    277 
    278 namespace boost { namespace gil {
    281 template <typename View1, typename View2> BOOST_FORCEINLINE
    282 void copy_pixels(const View1& src, const View2& dst)
    283 {
    284  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    285  detail::copy_with_2d_iterators(src.begin(),src.end(),dst.begin());
    286 }
    287 
    289 // copy_and_convert_pixels
    291 
    297 
    298 namespace detail {
    299 template <typename CC>
    300 class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_pixels_fn<CC>>
    301 {
    302 private:
    303  CC _cc;
    304 public:
    305  using result_type = typename binary_operation_obj<copy_and_convert_pixels_fn<default_color_converter>>::result_type;
    306  copy_and_convert_pixels_fn() {}
    307  copy_and_convert_pixels_fn(CC cc_in) : _cc(cc_in) {}
    308  // when the two color spaces are incompatible, a color conversion is performed
    309  template <typename V1, typename V2> BOOST_FORCEINLINE
    310  result_type apply_incompatible(const V1& src, const V2& dst) const {
    311  copy_pixels(color_converted_view<typename V2::value_type>(src,_cc),dst);
    312  }
    313 
    314  // If the two color spaces are compatible, copy_and_convert is just copy
    315  template <typename V1, typename V2> BOOST_FORCEINLINE
    316  result_type apply_compatible(const V1& src, const V2& dst) const {
    317  copy_pixels(src,dst);
    318  }
    319 };
    320 } // namespace detail
    321 
    323 template <typename V1, typename V2,typename CC>
    324 BOOST_FORCEINLINE
    325 void copy_and_convert_pixels(const V1& src, const V2& dst,CC cc) {
    326  detail::copy_and_convert_pixels_fn<CC> ccp(cc);
    327  ccp(src,dst);
    328 }
    329 
    331 
    333 template <typename View1, typename View2>
    334 BOOST_FORCEINLINE
    335 void copy_and_convert_pixels(const View1& src, const View2& dst) {
    336  detail::copy_and_convert_pixels_fn<default_color_converter> ccp;
    337  ccp(src,dst);
    338 }
    339 } } // namespace boost::gil
    340 
    342 // std::fill and gil::fill_pixels
    344 
    348 
    349 namespace std {
    358 template <typename IL, typename V>
    360  boost::gil::gil_function_requires<boost::gil::MutablePixelLocatorConcept<IL>>();
    361  if (first.is_1d_traversable()) {
    362  std::fill(first.x(), last.x(), val);
    363  } else {
    364  // fill row by row
    365  std::ptrdiff_t n=last-first;
    366  while (n>0) {
    367  std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
    368  std::fill_n(first.x(), numToDo, val);
    369  first+=numToDo;
    370  n-=numToDo;
    371  }
    372  }
    373 }
    374 } // namespace std
    375 
    376 namespace boost { namespace gil {
    377 
    378 namespace detail {
    379 
    381 struct std_fill_t {
    382  template <typename It, typename P>
    383  void operator()(It first, It last, const P& p_in) {
    384  std::fill(first,last,p_in);
    385  }
    386 };
    387 
    389 template <typename It, typename P>
    390 BOOST_FORCEINLINE
    391 void fill_aux(It first, It last, P const& p, std::true_type)
    392 {
    393  static_for_each(first, last, p, std_fill_t());
    394 }
    395 
    397 template <typename It, typename P>
    398 BOOST_FORCEINLINE
    399 void fill_aux(It first, It last, P const& p, std::false_type)
    400 {
    401  std::fill(first, last, p);
    402 }
    403 
    404 } // namespace detail
    405 
    408 template <typename View, typename Value>
    409 BOOST_FORCEINLINE
    410 void fill_pixels(View const& view, Value const& value)
    411 {
    412  if (view.is_1d_traversable())
    413  {
    414  detail::fill_aux(
    415  view.begin().x(), view.end().x(), value, is_planar<View>());
    416  }
    417  else
    418  {
    419  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    420  detail::fill_aux(
    421  view.row_begin(y), view.row_end(y), value, is_planar<View>());
    422  }
    423 }
    424 
    426 // destruct_pixels
    428 
    432 
    433 namespace detail {
    434 template <typename Iterator>
    435 BOOST_FORCEINLINE
    436 void destruct_range_impl(Iterator first, Iterator last,
    437  typename std::enable_if
    438  <
    439  mp11::mp_and
    440  <
    441  std::is_pointer<Iterator>,
    442  mp11::mp_not
    443  <
    444  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    445  >
    446  >::value
    447  >::type* /*ptr*/ = 0)
    448 {
    449  while (first != last)
    450  {
    451  first->~value_t();
    452  ++first;
    453  }
    454 }
    455 
    456 template <typename Iterator>
    457 BOOST_FORCEINLINE
    458 void destruct_range_impl(Iterator /*first*/, Iterator /*last*/,
    459  typename std::enable_if
    460  <
    461  mp11::mp_or
    462  <
    463  mp11::mp_not<std::is_pointer<Iterator>>,
    464  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    465  >::value
    466  >::type* /* ptr */ = nullptr)
    467 {
    468 }
    469 
    470 template <typename Iterator>
    471 BOOST_FORCEINLINE
    472 void destruct_range(Iterator first, Iterator last)
    473 {
    474  destruct_range_impl(first, last);
    475 }
    476 
    477 struct std_destruct_t
    478 {
    479  template <typename Iterator>
    480  void operator()(Iterator first, Iterator last) const
    481  {
    482  destruct_range(first,last);
    483  }
    484 };
    485 
    487 template <typename It>
    488 BOOST_FORCEINLINE
    489 void destruct_aux(It first, It last, std::true_type)
    490 {
    491  static_for_each(first,last,std_destruct_t());
    492 }
    493 
    495 template <typename It>
    496 BOOST_FORCEINLINE
    497 void destruct_aux(It first, It last, std::false_type)
    498 {
    499  destruct_range(first,last);
    500 }
    501 
    502 } // namespace detail
    503 
    506 template <typename View>
    507 BOOST_FORCEINLINE
    508 void destruct_pixels(View const& view)
    509 {
    510  if (view.is_1d_traversable())
    511  {
    512  detail::destruct_aux(
    513  view.begin().x(), view.end().x(), is_planar<View>());
    514  }
    515  else
    516  {
    517  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    518  detail::destruct_aux(
    519  view.row_begin(y), view.row_end(y), is_planar<View>());
    520  }
    521 }
    522 
    524 // uninitialized_fill_pixels
    526 
    530 
    531 namespace detail {
    532 
    535 template <typename It, typename P>
    536 BOOST_FORCEINLINE
    537 void uninitialized_fill_aux(It first, It last, P const& p, std::true_type)
    538 {
    539  std::size_t channel = 0;
    540  try
    541  {
    542  using pixel_t = typename std::iterator_traits<It>::value_type;
    543  while (channel < num_channels<pixel_t>::value)
    544  {
    545  std::uninitialized_fill(
    546  dynamic_at_c(first,channel),
    547  dynamic_at_c(last,channel),
    548  dynamic_at_c(p,channel));
    549 
    550  ++channel;
    551  }
    552  }
    553  catch (...)
    554  {
    555  for (std::size_t c = 0; c < channel; ++c)
    556  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    557  throw;
    558  }
    559 }
    560 
    563 template <typename It, typename P>
    564 BOOST_FORCEINLINE
    565 void uninitialized_fill_aux(It first, It last, P const& p, std::false_type)
    566 {
    567  std::uninitialized_fill(first,last,p);
    568 }
    569 
    570 } // namespace detail
    571 
    576 template <typename View, typename Value>
    577 void uninitialized_fill_pixels(const View& view, const Value& val) {
    578  if (view.is_1d_traversable())
    579  detail::uninitialized_fill_aux(view.begin().x(), view.end().x(),
    580  val,is_planar<View>());
    581  else {
    582  typename View::y_coord_t y = 0;
    583  try {
    584  for (y=0; y<view.height(); ++y)
    585  detail::uninitialized_fill_aux(view.row_begin(y),view.row_end(y),
    586  val,is_planar<View>());
    587  } catch(...) {
    588  for (typename View::y_coord_t y0=0; y0<y; ++y0)
    589  detail::destruct_aux(view.row_begin(y0),view.row_end(y0), is_planar<View>());
    590  throw;
    591  }
    592  }
    593 }
    594 
    596 // default_construct_pixels
    598 
    602 
    603 namespace detail {
    604 template <typename It> BOOST_FORCEINLINE
    605 void default_construct_range_impl(It first, It last, std::true_type)
    606 {
    607  It first1 = first;
    608  try
    609  {
    610  using value_t = typename std::iterator_traits<It>::value_type;
    611  while (first != last)
    612  {
    613  new (first) value_t();
    614  ++first;
    615  }
    616  }
    617  catch (...)
    618  {
    619  destruct_range(first1, first);
    620  throw;
    621  }
    622 }
    623 
    624 template <typename It>
    625 BOOST_FORCEINLINE
    626 void default_construct_range_impl(It, It, std::false_type) {}
    627 
    628 template <typename It>
    629 BOOST_FORCEINLINE
    630 void default_construct_range(It first, It last)
    631 {
    632  default_construct_range_impl(first, last, typename std::is_pointer<It>::type());
    633 }
    634 
    636 template <typename It>
    637 BOOST_FORCEINLINE
    638 void default_construct_aux(It first, It last, std::true_type)
    639 {
    640  std::size_t channel = 0;
    641  try
    642  {
    643  using pixel_t = typename std::iterator_traits<It>::value_type;
    644  while (channel < num_channels<pixel_t>::value)
    645  {
    646  default_construct_range(dynamic_at_c(first, channel), dynamic_at_c(last, channel));
    647  ++channel;
    648  }
    649  }
    650  catch (...)
    651  {
    652  for (std::size_t c = 0; c < channel; ++c)
    653  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    654  throw;
    655  }
    656 }
    657 
    659 template <typename It>
    660 BOOST_FORCEINLINE
    661 void default_construct_aux(It first, It last, std::false_type)
    662 {
    663  default_construct_range(first, last);
    664 }
    665 
    666 template <typename View, bool IsPlanar>
    667 struct has_trivial_pixel_constructor
    668  : detail::is_trivially_default_constructible<typename View::value_type>
    669 {};
    670 
    671 template <typename View>
    672 struct has_trivial_pixel_constructor<View, true>
    673  : detail::is_trivially_default_constructible<typename channel_type<View>::type>
    674 {};
    675 
    676 template<typename View, bool IsTriviallyConstructible>
    677 BOOST_FORCEINLINE
    678 void default_construct_pixels_impl(
    679  View const& view,
    680  std::enable_if<!IsTriviallyConstructible>* /*ptr*/ = nullptr)
    681 {
    682  if (view.is_1d_traversable())
    683  {
    684  detail::default_construct_aux(
    685  view.begin().x(), view.end().x(), is_planar<View>());
    686  }
    687  else
    688  {
    689  typename View::y_coord_t y = 0;
    690  try
    691  {
    692  for( y = 0; y < view.height(); ++y )
    693  detail::default_construct_aux(
    694  view.row_begin(y), view.row_end(y), is_planar<View>());
    695  }
    696  catch(...)
    697  {
    698  for (typename View::y_coord_t y0 = 0; y0 < y; ++y0 )
    699  detail::destruct_aux(
    700  view.row_begin(y0), view.row_end(y0), is_planar<View>());
    701 
    702  throw;
    703  }
    704  }
    705 }
    706 
    707 } // namespace detail
    708 
    713 template <typename View>
    715 {
    716  detail::default_construct_pixels_impl
    717  <
    718  View,
    719  detail::has_trivial_pixel_constructor
    720  <
    721  View,
    722  is_planar<View>::value
    723  >::value
    724  >(view);
    725 }
    726 
    728 // uninitialized_copy_pixels
    730 
    734 
    735 namespace detail {
    736 
    738 template <typename It1, typename It2>
    739 BOOST_FORCEINLINE
    740 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, std::true_type)
    741 {
    742  std::size_t channel=0;
    743  try {
    744  using pixel_t = typename std::iterator_traits<It1>::value_type;
    745  while (channel < num_channels<pixel_t>::value)
    746  {
    747  std::uninitialized_copy(
    748  dynamic_at_c(first1, channel),
    749  dynamic_at_c(last1, channel),
    750  dynamic_at_c(first2, channel));
    751  ++channel;
    752  }
    753  }
    754  catch (...)
    755  {
    756  It2 last2 = first2;
    757  std::advance(last2, std::distance(first1, last1));
    758  for (std::size_t c = 0; c < channel; ++c)
    759  destruct_range(dynamic_at_c(first2, c), dynamic_at_c(last2, c));
    760  throw;
    761  }
    762 }
    763 
    765 template <typename It1, typename It2>
    766 BOOST_FORCEINLINE
    767 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, std::false_type)
    768 {
    769  std::uninitialized_copy(first1, last1, first2);
    770 }
    771 } // namespace detail
    772 
    777 template <typename View1, typename View2>
    778 void uninitialized_copy_pixels(View1 const& view1, View2 const& view2)
    779 {
    780  using is_planar = std::integral_constant<bool, is_planar<View1>::value && is_planar<View2>::value>;
    781  BOOST_ASSERT(view1.dimensions() == view2.dimensions());
    782 
    783  if (view1.is_1d_traversable() && view2.is_1d_traversable())
    784  {
    785  detail::uninitialized_copy_aux(
    786  view1.begin().x(), view1.end().x(), view2.begin().x(), is_planar());
    787  }
    788  else
    789  {
    790  typename View1::y_coord_t y = 0;
    791  try
    792  {
    793  for (y = 0; y < view1.height(); ++y)
    794  detail::uninitialized_copy_aux(
    795  view1.row_begin(y), view1.row_end(y), view2.row_begin(y), is_planar());
    796  }
    797  catch(...)
    798  {
    799  for (typename View1::y_coord_t y0 = 0; y0 < y; ++y0)
    800  detail::destruct_aux(view2.row_begin(y0), view2.row_end(y0), is_planar());
    801  throw;
    802  }
    803  }
    804 }
    805 
    807 // for_each_pixel
    809 
    818 
    820 template <typename View, typename F>
    821 F for_each_pixel(View const& view, F fun)
    822 {
    823  if (view.is_1d_traversable())
    824  {
    825  return std::for_each(view.begin().x(), view.end().x(), fun);
    826  }
    827  else
    828  {
    829  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    830  std::for_each(view.row_begin(y), view.row_end(y), fun);
    831  return fun;
    832  }
    833 }
    834 
    838 
    840 template <typename View, typename F>
    841 F for_each_pixel_position(View const& view, F fun)
    842 {
    843  typename View::xy_locator loc = view.xy_at(0, 0);
    844  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    845  {
    846  for (std::ptrdiff_t x = 0; x < view.width(); ++x, ++loc.x())
    847  fun(loc);
    848  loc.x() -= view.width(); ++loc.y();
    849  }
    850  return fun;
    851 }
    852 
    854 // generate_pixels
    856 
    860 
    863 template <typename View, typename F>
    864 void generate_pixels(View const& view, F fun)
    865 {
    866  if (view.is_1d_traversable())
    867  {
    868  std::generate(view.begin().x(), view.end().x(), fun);
    869  }
    870  else
    871  {
    872  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    873  std::generate(view.row_begin(y), view.row_end(y), fun);
    874  }
    875 }
    876 
    878 // std::equal and gil::equal_pixels for GIL constructs
    880 
    884 
    885 template <typename I1, typename I2>
    886 BOOST_FORCEINLINE
    887 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2);
    888 
    889 namespace detail {
    890 
    891 template <typename I1, typename I2>
    892 struct equal_n_fn
    893 {
    894  BOOST_FORCEINLINE
    895  bool operator()(I1 i1, std::ptrdiff_t n, I2 i2) const
    896  {
    897  return std::equal(i1, i1 + n, i2);
    898  }
    899 };
    900 
    903 template<typename T, typename CS>
    904 struct equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    905 {
    906  BOOST_FORCEINLINE
    907  bool operator()(pixel<T, CS> const* i1, std::ptrdiff_t n, pixel<T, CS> const* i2) const
    908  {
    909  return memcmp(i1, i2, n * sizeof(pixel<T, CS>)) == 0;
    910  }
    911 };
    912 
    913 template<typename T, typename CS>
    914 struct equal_n_fn<pixel<T, CS>*, pixel<T, CS>*>
    915  : equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    916 {};
    917 
    921 template<typename IC, typename CS>
    922 struct equal_n_fn<planar_pixel_iterator<IC, CS>, planar_pixel_iterator<IC, CS>>
    923 {
    924  BOOST_FORCEINLINE
    925  bool operator()(planar_pixel_iterator<IC, CS> const i1, std::ptrdiff_t n, planar_pixel_iterator<IC, CS> const i2) const
    926  {
    927  // FIXME: ptrdiff_t vs size_t
    928  constexpr std::ptrdiff_t byte_size = n * sizeof(typename std::iterator_traits<IC>::value_type);
    929  for (std::ptrdiff_t i = 0; i < mp11::mp_size<CS>::value; ++i)
    930  {
    931  if (memcmp(dynamic_at_c(i1, i), dynamic_at_c(i2, i), byte_size) != 0)
    932  return false;
    933  }
    934  return true;
    935  }
    936 };
    937 
    941 template <typename Loc, typename It>
    942 struct equal_n_fn<boost::gil::iterator_from_2d<Loc>, It>
    943 {
    944  BOOST_FORCEINLINE
    945  bool operator()(boost::gil::iterator_from_2d<Loc> i1, std::ptrdiff_t n, It i2) const
    946  {
    947  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    948  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    949  while (n > 0)
    950  {
    951  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i1.width() - i1.x_pos());
    952  if (!equal_n(i1.x(), num, i2))
    953  return false;
    954  i1 += num;
    955  i2 += num;
    956  n -= num;
    957  }
    958  return true;
    959  }
    960 };
    961 
    965 template <typename It, typename Loc>
    966 struct equal_n_fn<It, boost::gil::iterator_from_2d<Loc>>
    967 {
    968  BOOST_FORCEINLINE
    969  bool operator()(It i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc> i2) const
    970  {
    971  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    972  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    973  while (n > 0)
    974  {
    975  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i2.width() - i2.x_pos());
    976  if (!equal_n(i1, num, i2.x()))
    977  return false;
    978  i1 += num;
    979  i2 += num;
    980  n -= num;
    981  }
    982  return true;
    983  }
    984 };
    985 
    987 template <typename Loc1, typename Loc2>
    989  BOOST_FORCEINLINE bool operator()(boost::gil::iterator_from_2d<Loc1> i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc2> i2) const {
    990  gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    991  gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    992  if (i1.x_pos()!=i2.x_pos() || i1.width()!=i2.width()) {
    993  while(n-->0) {
    994  if (*i1++!=*i2++) return false;
    995  }
    996  }
    997  while (n>0) {
    998  std::ptrdiff_t num=std::min<const std::ptrdiff_t>(n,i2.width()-i2.x_pos());
    999  if (!equal_n(i1.x(), num, i2.x()))
    1000  return false;
    1001  i1+=num;
    1002  i2+=num;
    1003  n-=num;
    1004  }
    1005  return true;
    1006  }
    1007 };
    1008 } // namespace detail
    1009 
    1010 template <typename I1, typename I2> BOOST_FORCEINLINE
    1011 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2) {
    1012  return detail::equal_n_fn<I1,I2>()(i1,n,i2);
    1013 }
    1014 } } // namespace boost::gil
    1015 
    1016 namespace std {
    1028 template <typename Loc1, typename Loc2> BOOST_FORCEINLINE
    1030  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    1031  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    1032  std::ptrdiff_t n=last-first;
    1033  if (first.is_1d_traversable()) {
    1034  if (first2.is_1d_traversable())
    1035  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,typename Loc2::x_iterator>()(first.x(),n, first2.x());
    1036  else
    1037  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,boost::gil::iterator_from_2d<Loc2>>()(first.x(),n, first2);
    1038  } else {
    1039  if (first2.is_1d_traversable())
    1040  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,typename Loc2::x_iterator>()(first,n, first2.x());
    1041  else
    1042  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>>()(first,n,first2);
    1043  }
    1044 }
    1045 } // namespace std
    1046 
    1047 namespace boost { namespace gil {
    1050 template <typename View1, typename View2> BOOST_FORCEINLINE
    1051 bool equal_pixels(const View1& v1, const View2& v2) {
    1052  BOOST_ASSERT(v1.dimensions() == v2.dimensions());
    1053  return std::equal(v1.begin(),v1.end(),v2.begin()); // std::equal has overloads with GIL iterators for optimal performance
    1054 }
    1055 
    1061 
    1065 
    1068 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    1069 F transform_pixels(const View1& src,const View2& dst, F fun) {
    1070  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    1071  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    1072  typename View1::x_iterator srcIt=src.row_begin(y);
    1073  typename View2::x_iterator dstIt=dst.row_begin(y);
    1074  for (std::ptrdiff_t x=0; x<src.width(); ++x)
    1075  dstIt[x]=fun(srcIt[x]);
    1076  }
    1077  return fun;
    1078 }
    1079 
    1082 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    1083 F transform_pixels(const View1& src1, const View2& src2,const View3& dst, F fun) {
    1084  for (std::ptrdiff_t y=0; y<dst.height(); ++y) {
    1085  typename View1::x_iterator srcIt1=src1.row_begin(y);
    1086  typename View2::x_iterator srcIt2=src2.row_begin(y);
    1087  typename View3::x_iterator dstIt=dst.row_begin(y);
    1088  for (std::ptrdiff_t x=0; x<dst.width(); ++x)
    1089  dstIt[x]=fun(srcIt1[x],srcIt2[x]);
    1090  }
    1091  return fun;
    1092 }
    1093 
    1097 
    1100 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    1101 F transform_pixel_positions(const View1& src,const View2& dst, F fun) {
    1102  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    1103  typename View1::xy_locator loc=src.xy_at(0,0);
    1104  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    1105  typename View2::x_iterator dstIt=dst.row_begin(y);
    1106  for (std::ptrdiff_t x=0; x<src.width(); ++x, ++loc.x())
    1107  dstIt[x]=fun(loc);
    1108  loc.x()-=src.width(); ++loc.y();
    1109  }
    1110  return fun;
    1111 }
    1112 
    1115 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    1116 F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst, F fun) {
    1117  BOOST_ASSERT(src1.dimensions() == dst.dimensions());
    1118  BOOST_ASSERT(src2.dimensions() == dst.dimensions());
    1119  typename View1::xy_locator loc1=src1.xy_at(0,0);
    1120  typename View2::xy_locator loc2=src2.xy_at(0,0);
    1121  for (std::ptrdiff_t y=0; y<src1.height(); ++y) {
    1122  typename View3::x_iterator dstIt=dst.row_begin(y);
    1123  for (std::ptrdiff_t x=0; x<src1.width(); ++x, ++loc1.x(), ++loc2.x())
    1124  dstIt[x]=fun(loc1,loc2);
    1125  loc1.x()-=src1.width(); ++loc1.y();
    1126  loc2.x()-=src2.width(); ++loc2.y();
    1127  }
    1128  return fun;
    1129 }
    1130 } } // namespace boost::gil
    1131 
    1132 #endif
    Definition: algorithm.hpp:30
    -
    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.
    Definition: algorithm.hpp:714
    -
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept.
    Definition: metafunctions.hpp:23
    -
    BOOST_FORCEINLINE F transform_pixels(const View1 &src1, const View2 &src2, const View3 &dst, F fun)
    transform_pixels with two sources
    Definition: algorithm.hpp:1083
    -
    Definition: algorithm.hpp:133
    -
    BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
    std::fill for image views
    Definition: algorithm.hpp:410
    -
    An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
    Definition: algorithm.hpp:34
    -
    Definition: algorithm.hpp:183
    -
    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept.
    Definition: iterator_from_2d.hpp:42
    -
    BOOST_FORCEINLINE boost::gil::planar_pixel_iterator< IC2, CS > 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)
    Copy when both src and dst are planar pointers is copy for each channel.
    Definition: algorithm.hpp:171
    -
    void generate_pixels(View const &view, F fun)
    std::generate for image views
    Definition: algorithm.hpp:864
    -
    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
    Definition: algorithm.hpp:778
    -
    Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConceptThe class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation.
    Definition: algorithm.hpp:38
    -
    BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
    std::equal for image views
    Definition: algorithm.hpp:1051
    -
    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:359
    -
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:522
    -
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    -
    BOOST_FORCEINLINE boost::gil::iterator_from_2d< OL > copy1(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst)
    std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
    Definition: algorithm.hpp:273
    -
    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
    Definition: algorithm.hpp:577
    -
    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:1029
    -
    A generic binary operation on viewsUse this class as a convenience superclass when defining an operat...
    Definition: algorithm.hpp:81
    -
    struct to do std::fill
    Definition: algorithm.hpp:381
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    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:1116
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    -
    BOOST_FORCEINLINE void destruct_pixels(View const &view)
    Invokes the in-place destructor on every pixel of the view.
    Definition: algorithm.hpp:508
    -
    MEMORY-BASED STEP ITERATOR.
    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_ALGORITHM_HPP
    +
    9 #define BOOST_GIL_ALGORITHM_HPP
    +
    10 
    +
    11 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
    +
    12 #include <boost/gil/color_base_algorithm.hpp>
    +
    13 #include <boost/gil/concepts.hpp>
    +
    14 #include <boost/gil/image_view.hpp>
    +
    15 #include <boost/gil/image_view_factory.hpp>
    +
    16 #include <boost/gil/detail/mp11.hpp>
    +
    17 #include <boost/gil/detail/type_traits.hpp>
    +
    18 
    +
    19 #include <boost/assert.hpp>
    +
    20 #include <boost/config.hpp>
    +
    21 
    +
    22 #include <algorithm>
    +
    23 #include <cstddef>
    +
    24 #include <cstring>
    +
    25 #include <iterator>
    +
    26 #include <memory>
    +
    27 #include <type_traits>
    +
    28 #include <typeinfo>
    +
    29 
    +
    30 namespace boost { namespace gil {
    +
    31 
    +
    32 //forward declarations
    +
    33 template <typename ChannelPtr, typename ColorSpace>
    + +
    35 template <typename Iterator>
    + +
    37 template <typename StepIterator>
    + +
    39 
    +
    40 // a tag denoting incompatible arguments
    +
    41 struct error_t {};
    +
    42 
    +
    67 
    +
    71 
    +
    80 template <typename Derived, typename Result=void>
    + +
    82 {
    +
    83  using result_type = Result;
    +
    84 
    +
    85  template <typename V1, typename V2> BOOST_FORCEINLINE
    +
    86  result_type operator()(const std::pair<const V1*,const V2*>& p) const {
    +
    87  return apply(*p.first, *p.second, typename views_are_compatible<V1,V2>::type());
    +
    88  }
    +
    89 
    +
    90  template <typename V1, typename V2> BOOST_FORCEINLINE
    +
    91  result_type operator()(const V1& v1, const V2& v2) const {
    +
    92  return apply(v1, v2, typename views_are_compatible<V1,V2>::type());
    +
    93  }
    +
    94 
    +
    95  result_type operator()(const error_t&) const { throw std::bad_cast(); }
    +
    96 private:
    +
    97 
    +
    98  // dispatch from apply overload to a function with distinct name
    +
    99  template <typename V1, typename V2>
    +
    100  BOOST_FORCEINLINE
    +
    101  result_type apply(V1 const& v1, V2 const& v2, std::false_type) const
    +
    102  {
    +
    103  return ((const Derived*)this)->apply_incompatible(v1, v2);
    +
    104  }
    +
    105 
    +
    106  // dispatch from apply overload to a function with distinct name
    +
    107  template <typename V1, typename V2>
    +
    108  BOOST_FORCEINLINE
    +
    109  result_type apply(V1 const& v1, V2 const& v2, std::true_type) const
    +
    110  {
    +
    111  return ((const Derived*)this)->apply_compatible(v1, v2);
    +
    112  }
    +
    113 
    +
    114  // function with distinct name - it can be overloaded by subclasses
    +
    115  template <typename V1, typename V2>
    +
    116  BOOST_FORCEINLINE
    +
    117  result_type apply_incompatible(V1 const& /*v1*/, V2 const& /*v2*/) const
    +
    118  {
    +
    119  throw std::bad_cast();
    +
    120  }
    +
    121 };
    +
    122 
    +
    123 }} // namespace boost::gil
    +
    124 
    +
    126 // std::copy and gil::copy_pixels
    +
    128 
    +
    132 
    +
    133 namespace std {
    +
    134 
    +
    137 template<typename T, typename CS>
    +
    138 BOOST_FORCEINLINE
    +
    139 auto copy(
    + + + + +
    144 {
    +
    145  auto p = std::copy((unsigned char*)first, (unsigned char*)last, (unsigned char*)dst);
    +
    146  return reinterpret_cast<boost::gil::pixel<T, CS>*>(p);
    +
    147 }
    +
    148 
    +
    151 template<typename T, typename CS>
    +
    152 BOOST_FORCEINLINE boost::gil::pixel<T,CS>*
    + + +
    155  return (boost::gil::pixel<T,CS>*)std::copy((unsigned char*)first,(unsigned char*)last, (unsigned char*)dst);
    +
    156 }
    +
    157 } // namespace std
    +
    158 
    +
    159 namespace boost { namespace gil {
    +
    160 namespace detail {
    +
    161 template <typename I, typename O> struct copy_fn {
    +
    162  BOOST_FORCEINLINE I operator()(I first, I last, O dst) const { return std::copy(first,last,dst); }
    +
    163 };
    +
    164 } // namespace detail
    +
    165 } } // namespace boost::gil
    +
    166 
    +
    167 namespace std {
    +
    170 template<typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
    + +
    172  boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
    +
    173  static_for_each(first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
    +
    174  return dst+(last-first);
    +
    175 }
    +
    176 } // namespace std
    +
    177 
    +
    178 namespace boost { namespace gil {
    +
    179 namespace detail {
    +
    182 template <typename I, typename O>
    +
    183 struct copier_n {
    +
    184  BOOST_FORCEINLINE void operator()(I src, typename std::iterator_traits<I>::difference_type n, O dst) const { std::copy(src,src+n, dst); }
    +
    185 };
    +
    186 
    +
    188 template <typename IL, typename O> // IL Models ConstPixelLocatorConcept, O Models PixelIteratorConcept
    +
    189 struct copier_n<iterator_from_2d<IL>,O> {
    +
    190  using diff_t = typename std::iterator_traits<iterator_from_2d<IL>>::difference_type;
    +
    191  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, O dst) const {
    +
    192  gil_function_requires<PixelLocatorConcept<IL>>();
    +
    193  gil_function_requires<MutablePixelIteratorConcept<O>>();
    +
    194  while (n>0) {
    +
    195  diff_t l=src.width()-src.x_pos();
    +
    196  diff_t numToCopy=(n<l ? n:l);
    +
    197  detail::copy_n(src.x(), numToCopy, dst);
    +
    198  dst+=numToCopy;
    +
    199  src+=numToCopy;
    +
    200  n-=numToCopy;
    +
    201  }
    +
    202  }
    +
    203 };
    +
    204 
    +
    206 template <typename I, typename OL> // I Models ConstPixelIteratorConcept, OL Models PixelLocatorConcept
    +
    207 struct copier_n<I,iterator_from_2d<OL>> {
    +
    208  using diff_t = typename std::iterator_traits<I>::difference_type;
    +
    209  BOOST_FORCEINLINE void operator()(I src, diff_t n, iterator_from_2d<OL> dst) const {
    +
    210  gil_function_requires<PixelIteratorConcept<I>>();
    +
    211  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    +
    212  while (n>0) {
    +
    213  diff_t l=dst.width()-dst.x_pos();
    +
    214  diff_t numToCopy=(n<l ? n:l);
    +
    215  detail::copy_n(src, numToCopy, dst.x());
    +
    216  dst+=numToCopy;
    +
    217  src+=numToCopy;
    +
    218  n-=numToCopy;
    +
    219  }
    +
    220  }
    +
    221 };
    +
    222 
    +
    224 template <typename IL, typename OL>
    + +
    226  using diff_t = typename iterator_from_2d<IL>::difference_type;
    +
    227  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, iterator_from_2d<OL> dst) const {
    +
    228  gil_function_requires<PixelLocatorConcept<IL>>();
    +
    229  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    +
    230  if (src.x_pos()!=dst.x_pos() || src.width()!=dst.width()) {
    +
    231  while(n-->0) {
    +
    232  *dst++=*src++;
    +
    233  }
    +
    234  }
    +
    235  while (n>0) {
    +
    236  diff_t l=dst.width()-dst.x_pos();
    +
    237  diff_t numToCopy=(n<l ? n : l);
    +
    238  detail::copy_n(src.x(), numToCopy, dst.x());
    +
    239  dst+=numToCopy;
    +
    240  src+=numToCopy;
    +
    241  n-=numToCopy;
    +
    242  }
    +
    243  }
    +
    244 };
    +
    245 
    +
    246 template <typename SrcIterator, typename DstIterator>
    +
    247 BOOST_FORCEINLINE DstIterator copy_with_2d_iterators(SrcIterator first, SrcIterator last, DstIterator dst) {
    +
    248  using src_x_iterator = typename SrcIterator::x_iterator;
    +
    249  using dst_x_iterator = typename DstIterator::x_iterator;
    +
    250 
    +
    251  typename SrcIterator::difference_type n = last - first;
    +
    252 
    +
    253  if (first.is_1d_traversable()) {
    +
    254  if (dst.is_1d_traversable())
    +
    255  copier_n<src_x_iterator,dst_x_iterator>()(first.x(),n, dst.x());
    +
    256  else
    +
    257  copier_n<src_x_iterator,DstIterator >()(first.x(),n, dst);
    +
    258  } else {
    +
    259  if (dst.is_1d_traversable())
    +
    260  copier_n<SrcIterator,dst_x_iterator>()(first,n, dst.x());
    +
    261  else
    +
    262  copier_n<SrcIterator,DstIterator>()(first,n,dst);
    +
    263  }
    +
    264  return dst+n;
    +
    265 }
    +
    266 } // namespace detail
    +
    267 } } // namespace boost::gil
    +
    268 
    +
    269 namespace std {
    +
    272 template <typename IL, typename OL>
    + +
    274  return boost::gil::detail::copy_with_2d_iterators(first,last,dst);
    +
    275 }
    +
    276 } // namespace std
    +
    277 
    +
    278 namespace boost { namespace gil {
    +
    281 template <typename View1, typename View2> BOOST_FORCEINLINE
    +
    282 void copy_pixels(const View1& src, const View2& dst)
    +
    283 {
    +
    284  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    +
    285  detail::copy_with_2d_iterators(src.begin(),src.end(),dst.begin());
    +
    286 }
    +
    287 
    +
    289 // copy_and_convert_pixels
    +
    291 
    +
    297 
    +
    298 namespace detail {
    +
    299 template <typename CC>
    +
    300 class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_pixels_fn<CC>>
    +
    301 {
    +
    302 private:
    +
    303  CC _cc;
    +
    304 public:
    +
    305  using result_type = typename binary_operation_obj<copy_and_convert_pixels_fn<default_color_converter>>::result_type;
    +
    306  copy_and_convert_pixels_fn() {}
    +
    307  copy_and_convert_pixels_fn(CC cc_in) : _cc(cc_in) {}
    +
    308  // when the two color spaces are incompatible, a color conversion is performed
    +
    309  template <typename V1, typename V2> BOOST_FORCEINLINE
    +
    310  result_type apply_incompatible(const V1& src, const V2& dst) const {
    +
    311  copy_pixels(color_converted_view<typename V2::value_type>(src,_cc),dst);
    +
    312  }
    +
    313 
    +
    314  // If the two color spaces are compatible, copy_and_convert is just copy
    +
    315  template <typename V1, typename V2> BOOST_FORCEINLINE
    +
    316  result_type apply_compatible(const V1& src, const V2& dst) const {
    +
    317  copy_pixels(src,dst);
    +
    318  }
    +
    319 };
    +
    320 } // namespace detail
    +
    321 
    +
    323 template <typename V1, typename V2,typename CC>
    +
    324 BOOST_FORCEINLINE
    +
    325 void copy_and_convert_pixels(const V1& src, const V2& dst,CC cc) {
    +
    326  detail::copy_and_convert_pixels_fn<CC> ccp(cc);
    +
    327  ccp(src,dst);
    +
    328 }
    +
    329 
    +
    330 struct default_color_converter;
    +
    331 
    +
    333 template <typename View1, typename View2>
    +
    334 BOOST_FORCEINLINE
    +
    335 void copy_and_convert_pixels(const View1& src, const View2& dst) {
    +
    336  detail::copy_and_convert_pixels_fn<default_color_converter> ccp;
    +
    337  ccp(src,dst);
    +
    338 }
    +
    339 } } // namespace boost::gil
    +
    340 
    +
    342 // std::fill and gil::fill_pixels
    +
    344 
    +
    348 
    +
    349 namespace std {
    +
    358 template <typename IL, typename V>
    + +
    360  boost::gil::gil_function_requires<boost::gil::MutablePixelLocatorConcept<IL>>();
    +
    361  if (first.is_1d_traversable()) {
    +
    362  std::fill(first.x(), last.x(), val);
    +
    363  } else {
    +
    364  // fill row by row
    +
    365  std::ptrdiff_t n=last-first;
    +
    366  while (n>0) {
    +
    367  std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
    +
    368  std::fill_n(first.x(), numToDo, val);
    +
    369  first+=numToDo;
    +
    370  n-=numToDo;
    +
    371  }
    +
    372  }
    +
    373 }
    +
    374 } // namespace std
    +
    375 
    +
    376 namespace boost { namespace gil {
    +
    377 
    +
    378 namespace detail {
    +
    379 
    +
    381 struct std_fill_t {
    +
    382  template <typename It, typename P>
    +
    383  void operator()(It first, It last, const P& p_in) {
    +
    384  std::fill(first,last,p_in);
    +
    385  }
    +
    386 };
    +
    387 
    +
    389 template <typename It, typename P>
    +
    390 BOOST_FORCEINLINE
    +
    391 void fill_aux(It first, It last, P const& p, std::true_type)
    +
    392 {
    +
    393  static_for_each(first, last, p, std_fill_t());
    +
    394 }
    +
    395 
    +
    397 template <typename It, typename P>
    +
    398 BOOST_FORCEINLINE
    +
    399 void fill_aux(It first, It last, P const& p, std::false_type)
    +
    400 {
    +
    401  std::fill(first, last, p);
    +
    402 }
    +
    403 
    +
    404 } // namespace detail
    +
    405 
    +
    408 template <typename View, typename Value>
    +
    409 BOOST_FORCEINLINE
    +
    410 void fill_pixels(View const& view, Value const& value)
    +
    411 {
    +
    412  if (view.is_1d_traversable())
    +
    413  {
    +
    414  detail::fill_aux(
    +
    415  view.begin().x(), view.end().x(), value, is_planar<View>());
    +
    416  }
    +
    417  else
    +
    418  {
    +
    419  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    +
    420  detail::fill_aux(
    +
    421  view.row_begin(y), view.row_end(y), value, is_planar<View>());
    +
    422  }
    +
    423 }
    +
    424 
    +
    426 // destruct_pixels
    +
    428 
    +
    432 
    +
    433 namespace detail {
    +
    434 template <typename Iterator>
    +
    435 BOOST_FORCEINLINE
    +
    436 void destruct_range_impl(Iterator first, Iterator last,
    +
    437  typename std::enable_if
    +
    438  <
    +
    439  mp11::mp_and
    +
    440  <
    +
    441  std::is_pointer<Iterator>,
    +
    442  mp11::mp_not
    +
    443  <
    +
    444  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    +
    445  >
    +
    446  >::value
    +
    447  >::type* /*ptr*/ = 0)
    +
    448 {
    +
    449  while (first != last)
    +
    450  {
    +
    451  first->~value_t();
    +
    452  ++first;
    +
    453  }
    +
    454 }
    +
    455 
    +
    456 template <typename Iterator>
    +
    457 BOOST_FORCEINLINE
    +
    458 void destruct_range_impl(Iterator /*first*/, Iterator /*last*/,
    +
    459  typename std::enable_if
    +
    460  <
    +
    461  mp11::mp_or
    +
    462  <
    +
    463  mp11::mp_not<std::is_pointer<Iterator>>,
    +
    464  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    +
    465  >::value
    +
    466  >::type* /* ptr */ = nullptr)
    +
    467 {
    +
    468 }
    +
    469 
    +
    470 template <typename Iterator>
    +
    471 BOOST_FORCEINLINE
    +
    472 void destruct_range(Iterator first, Iterator last)
    +
    473 {
    +
    474  destruct_range_impl(first, last);
    +
    475 }
    +
    476 
    +
    477 struct std_destruct_t
    +
    478 {
    +
    479  template <typename Iterator>
    +
    480  void operator()(Iterator first, Iterator last) const
    +
    481  {
    +
    482  destruct_range(first,last);
    +
    483  }
    +
    484 };
    +
    485 
    +
    487 template <typename It>
    +
    488 BOOST_FORCEINLINE
    +
    489 void destruct_aux(It first, It last, std::true_type)
    +
    490 {
    +
    491  static_for_each(first,last,std_destruct_t());
    +
    492 }
    +
    493 
    +
    495 template <typename It>
    +
    496 BOOST_FORCEINLINE
    +
    497 void destruct_aux(It first, It last, std::false_type)
    +
    498 {
    +
    499  destruct_range(first,last);
    +
    500 }
    +
    501 
    +
    502 } // namespace detail
    +
    503 
    +
    506 template <typename View>
    +
    507 BOOST_FORCEINLINE
    +
    508 void destruct_pixels(View const& view)
    +
    509 {
    +
    510  if (view.is_1d_traversable())
    +
    511  {
    +
    512  detail::destruct_aux(
    +
    513  view.begin().x(), view.end().x(), is_planar<View>());
    +
    514  }
    +
    515  else
    +
    516  {
    +
    517  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    +
    518  detail::destruct_aux(
    +
    519  view.row_begin(y), view.row_end(y), is_planar<View>());
    +
    520  }
    +
    521 }
    +
    522 
    +
    524 // uninitialized_fill_pixels
    +
    526 
    +
    530 
    +
    531 namespace detail {
    +
    532 
    +
    535 template <typename It, typename P>
    +
    536 BOOST_FORCEINLINE
    +
    537 void uninitialized_fill_aux(It first, It last, P const& p, std::true_type)
    +
    538 {
    +
    539  std::size_t channel = 0;
    +
    540  try
    +
    541  {
    +
    542  using pixel_t = typename std::iterator_traits<It>::value_type;
    +
    543  while (channel < num_channels<pixel_t>::value)
    +
    544  {
    +
    545  std::uninitialized_fill(
    +
    546  dynamic_at_c(first,channel),
    +
    547  dynamic_at_c(last,channel),
    +
    548  dynamic_at_c(p,channel));
    +
    549 
    +
    550  ++channel;
    +
    551  }
    +
    552  }
    +
    553  catch (...)
    +
    554  {
    +
    555  for (std::size_t c = 0; c < channel; ++c)
    +
    556  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    +
    557  throw;
    +
    558  }
    +
    559 }
    +
    560 
    +
    563 template <typename It, typename P>
    +
    564 BOOST_FORCEINLINE
    +
    565 void uninitialized_fill_aux(It first, It last, P const& p, std::false_type)
    +
    566 {
    +
    567  std::uninitialized_fill(first,last,p);
    +
    568 }
    +
    569 
    +
    570 } // namespace detail
    +
    571 
    +
    576 template <typename View, typename Value>
    +
    577 void uninitialized_fill_pixels(const View& view, const Value& val) {
    +
    578  if (view.is_1d_traversable())
    +
    579  detail::uninitialized_fill_aux(view.begin().x(), view.end().x(),
    +
    580  val,is_planar<View>());
    +
    581  else {
    +
    582  typename View::y_coord_t y = 0;
    +
    583  try {
    +
    584  for (y=0; y<view.height(); ++y)
    +
    585  detail::uninitialized_fill_aux(view.row_begin(y),view.row_end(y),
    +
    586  val,is_planar<View>());
    +
    587  } catch(...) {
    +
    588  for (typename View::y_coord_t y0=0; y0<y; ++y0)
    +
    589  detail::destruct_aux(view.row_begin(y0),view.row_end(y0), is_planar<View>());
    +
    590  throw;
    +
    591  }
    +
    592  }
    +
    593 }
    +
    594 
    +
    596 // default_construct_pixels
    +
    598 
    +
    602 
    +
    603 namespace detail {
    +
    604 template <typename It> BOOST_FORCEINLINE
    +
    605 void default_construct_range_impl(It first, It last, std::true_type)
    +
    606 {
    +
    607  It first1 = first;
    +
    608  try
    +
    609  {
    +
    610  using value_t = typename std::iterator_traits<It>::value_type;
    +
    611  while (first != last)
    +
    612  {
    +
    613  new (first) value_t();
    +
    614  ++first;
    +
    615  }
    +
    616  }
    +
    617  catch (...)
    +
    618  {
    +
    619  destruct_range(first1, first);
    +
    620  throw;
    +
    621  }
    +
    622 }
    +
    623 
    +
    624 template <typename It>
    +
    625 BOOST_FORCEINLINE
    +
    626 void default_construct_range_impl(It, It, std::false_type) {}
    +
    627 
    +
    628 template <typename It>
    +
    629 BOOST_FORCEINLINE
    +
    630 void default_construct_range(It first, It last)
    +
    631 {
    +
    632  default_construct_range_impl(first, last, typename std::is_pointer<It>::type());
    +
    633 }
    +
    634 
    +
    636 template <typename It>
    +
    637 BOOST_FORCEINLINE
    +
    638 void default_construct_aux(It first, It last, std::true_type)
    +
    639 {
    +
    640  std::size_t channel = 0;
    +
    641  try
    +
    642  {
    +
    643  using pixel_t = typename std::iterator_traits<It>::value_type;
    +
    644  while (channel < num_channels<pixel_t>::value)
    +
    645  {
    +
    646  default_construct_range(dynamic_at_c(first, channel), dynamic_at_c(last, channel));
    +
    647  ++channel;
    +
    648  }
    +
    649  }
    +
    650  catch (...)
    +
    651  {
    +
    652  for (std::size_t c = 0; c < channel; ++c)
    +
    653  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    +
    654  throw;
    +
    655  }
    +
    656 }
    +
    657 
    +
    659 template <typename It>
    +
    660 BOOST_FORCEINLINE
    +
    661 void default_construct_aux(It first, It last, std::false_type)
    +
    662 {
    +
    663  default_construct_range(first, last);
    +
    664 }
    +
    665 
    +
    666 template <typename View, bool IsPlanar>
    +
    667 struct has_trivial_pixel_constructor
    +
    668  : detail::is_trivially_default_constructible<typename View::value_type>
    +
    669 {};
    +
    670 
    +
    671 template <typename View>
    +
    672 struct has_trivial_pixel_constructor<View, true>
    +
    673  : detail::is_trivially_default_constructible<typename channel_type<View>::type>
    +
    674 {};
    +
    675 
    +
    676 template<typename View, bool IsTriviallyConstructible>
    +
    677 BOOST_FORCEINLINE
    +
    678 void default_construct_pixels_impl(
    +
    679  View const& view,
    +
    680  std::enable_if<!IsTriviallyConstructible>* /*ptr*/ = nullptr)
    +
    681 {
    +
    682  if (view.is_1d_traversable())
    +
    683  {
    +
    684  detail::default_construct_aux(
    +
    685  view.begin().x(), view.end().x(), is_planar<View>());
    +
    686  }
    +
    687  else
    +
    688  {
    +
    689  typename View::y_coord_t y = 0;
    +
    690  try
    +
    691  {
    +
    692  for( y = 0; y < view.height(); ++y )
    +
    693  detail::default_construct_aux(
    +
    694  view.row_begin(y), view.row_end(y), is_planar<View>());
    +
    695  }
    +
    696  catch(...)
    +
    697  {
    +
    698  for (typename View::y_coord_t y0 = 0; y0 < y; ++y0 )
    +
    699  detail::destruct_aux(
    +
    700  view.row_begin(y0), view.row_end(y0), is_planar<View>());
    +
    701 
    +
    702  throw;
    +
    703  }
    +
    704  }
    +
    705 }
    +
    706 
    +
    707 } // namespace detail
    +
    708 
    +
    713 template <typename View>
    + +
    715 {
    +
    716  detail::default_construct_pixels_impl
    +
    717  <
    +
    718  View,
    +
    719  detail::has_trivial_pixel_constructor
    +
    720  <
    +
    721  View,
    +
    722  is_planar<View>::value
    +
    723  >::value
    +
    724  >(view);
    +
    725 }
    +
    726 
    +
    728 // uninitialized_copy_pixels
    +
    730 
    +
    734 
    +
    735 namespace detail {
    +
    736 
    +
    737 enum class copy_planarity_condition
    +
    738 {
    +
    739  planar_to_planar,
    +
    740  interleaved_to_planar,
    +
    741  mixed_to_interleaved
    +
    742 };
    +
    743 
    +
    744 using planar_to_planar_type =
    +
    745  std::integral_constant
    +
    746  <
    +
    747  copy_planarity_condition, copy_planarity_condition::planar_to_planar
    +
    748  >;
    +
    749 using interleaved_to_planar_type =
    +
    750  std::integral_constant
    +
    751  <
    +
    752  copy_planarity_condition, copy_planarity_condition::interleaved_to_planar
    +
    753  >;
    +
    754 using mixed_to_interleaved_type =
    +
    755  std::integral_constant
    +
    756  <
    +
    757  copy_planarity_condition, copy_planarity_condition::mixed_to_interleaved
    +
    758  >;
    +
    759 
    +
    761 template <typename It1, typename It2>
    +
    762 BOOST_FORCEINLINE
    +
    763 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2, planar_to_planar_type)
    +
    764 {
    +
    765  std::size_t channel=0;
    +
    766  try {
    +
    767  using pixel_t = typename std::iterator_traits<It1>::value_type;
    +
    768  while (channel < num_channels<pixel_t>::value)
    +
    769  {
    +
    770  std::uninitialized_copy(
    +
    771  dynamic_at_c(first1, channel),
    +
    772  dynamic_at_c(last1, channel),
    +
    773  dynamic_at_c(first2, channel));
    +
    774  ++channel;
    +
    775  }
    +
    776  }
    +
    777  catch (...)
    +
    778  {
    +
    779  It2 last2 = first2;
    +
    780  std::advance(last2, std::distance(first1, last1));
    +
    781  for (std::size_t c = 0; c < channel; ++c)
    +
    782  destruct_range(dynamic_at_c(first2, c), dynamic_at_c(last2, c));
    +
    783  throw;
    +
    784  }
    +
    785 }
    +
    786 
    +
    788 template <typename It1, typename It2>
    +
    789 BOOST_FORCEINLINE
    +
    790 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2, mixed_to_interleaved_type)
    +
    791 {
    +
    792  std::uninitialized_copy(first1, last1, first2);
    +
    793 }
    +
    794 
    +
    796 template <typename It1, typename It2>
    +
    797 BOOST_FORCEINLINE
    +
    798 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2,
    +
    799 interleaved_to_planar_type)
    +
    800 {
    +
    801  default_construct_aux(first2, last2, std::true_type());
    +
    802 
    +
    803  typename It2::difference_type n = last2 - first2;
    +
    804  copier_n<It1,It2>()(first1, n, first2);
    +
    805 }
    +
    806 } // namespace detail
    +
    807 
    +
    812 template <typename View1, typename View2>
    +
    813 void uninitialized_copy_pixels(View1 const& view1, View2 const& view2)
    +
    814 {
    +
    815  using copy_planarity_condition = detail::copy_planarity_condition;
    +
    816  using copy_planarity_condition_type =
    +
    817  std::integral_constant
    +
    818  <
    +
    819  copy_planarity_condition,
    +
    820  !is_planar<View2>::value
    +
    821  ? copy_planarity_condition::mixed_to_interleaved
    +
    822  : (is_planar<View1>::value
    +
    823  ? copy_planarity_condition::planar_to_planar
    +
    824  : copy_planarity_condition::interleaved_to_planar)
    +
    825  >;
    +
    826  BOOST_ASSERT(view1.dimensions() == view2.dimensions());
    +
    827 
    +
    828  if (view1.is_1d_traversable() && view2.is_1d_traversable())
    +
    829  {
    +
    830  detail::uninitialized_copy_aux(
    +
    831  view1.begin().x(), view1.end().x(), view2.begin().x(), view2.end().x(),
    +
    832  copy_planarity_condition_type());
    +
    833  }
    +
    834  else
    +
    835  {
    +
    836  typename View1::y_coord_t y = 0;
    +
    837  try
    +
    838  {
    +
    839  for (y = 0; y < view1.height(); ++y)
    +
    840  detail::uninitialized_copy_aux(
    +
    841  view1.row_begin(y), view1.row_end(y), view2.row_begin(y), view2.row_end(y),
    +
    842  copy_planarity_condition_type());
    +
    843  }
    +
    844  catch(...)
    +
    845  {
    +
    846  for (typename View1::y_coord_t y0 = 0; y0 < y; ++y0)
    +
    847  detail::destruct_aux(view2.row_begin(y0), view2.row_end(y0), is_planar<View2>());
    +
    848  throw;
    +
    849  }
    +
    850  }
    +
    851 }
    +
    852 
    +
    854 // for_each_pixel
    +
    856 
    +
    865 
    +
    867 template <typename View, typename F>
    +
    868 F for_each_pixel(View const& view, F fun)
    +
    869 {
    +
    870  if (view.is_1d_traversable())
    +
    871  {
    +
    872  return std::for_each(view.begin().x(), view.end().x(), fun);
    +
    873  }
    +
    874  else
    +
    875  {
    +
    876  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    +
    877  std::for_each(view.row_begin(y), view.row_end(y), fun);
    +
    878  return fun;
    +
    879  }
    +
    880 }
    +
    881 
    +
    885 
    +
    887 template <typename View, typename F>
    +
    888 F for_each_pixel_position(View const& view, F fun)
    +
    889 {
    +
    890  typename View::xy_locator loc = view.xy_at(0, 0);
    +
    891  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    +
    892  {
    +
    893  for (std::ptrdiff_t x = 0; x < view.width(); ++x, ++loc.x())
    +
    894  fun(loc);
    +
    895  loc.x() -= view.width(); ++loc.y();
    +
    896  }
    +
    897  return fun;
    +
    898 }
    +
    899 
    +
    901 // generate_pixels
    +
    903 
    +
    907 
    +
    910 template <typename View, typename F>
    +
    911 void generate_pixels(View const& view, F fun)
    +
    912 {
    +
    913  if (view.is_1d_traversable())
    +
    914  {
    +
    915  std::generate(view.begin().x(), view.end().x(), fun);
    +
    916  }
    +
    917  else
    +
    918  {
    +
    919  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    +
    920  std::generate(view.row_begin(y), view.row_end(y), fun);
    +
    921  }
    +
    922 }
    +
    923 
    +
    925 // std::equal and gil::equal_pixels for GIL constructs
    +
    927 
    +
    931 
    +
    932 template <typename I1, typename I2>
    +
    933 BOOST_FORCEINLINE
    +
    934 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2);
    +
    935 
    +
    936 namespace detail {
    +
    937 
    +
    938 template <typename I1, typename I2>
    +
    939 struct equal_n_fn
    +
    940 {
    +
    941  BOOST_FORCEINLINE
    +
    942  bool operator()(I1 i1, std::ptrdiff_t n, I2 i2) const
    +
    943  {
    +
    944  return std::equal(i1, i1 + n, i2);
    +
    945  }
    +
    946 };
    +
    947 
    +
    950 template<typename T, typename CS>
    +
    951 struct equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    +
    952 {
    +
    953  BOOST_FORCEINLINE
    +
    954  bool operator()(pixel<T, CS> const* i1, std::ptrdiff_t n, pixel<T, CS> const* i2) const
    +
    955  {
    +
    956  return memcmp(i1, i2, n * sizeof(pixel<T, CS>)) == 0;
    +
    957  }
    +
    958 };
    +
    959 
    +
    960 template<typename T, typename CS>
    +
    961 struct equal_n_fn<pixel<T, CS>*, pixel<T, CS>*>
    +
    962  : equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    +
    963 {};
    +
    964 
    +
    968 template<typename IC, typename CS>
    +
    969 struct equal_n_fn<planar_pixel_iterator<IC, CS>, planar_pixel_iterator<IC, CS>>
    +
    970 {
    +
    971  BOOST_FORCEINLINE
    +
    972  bool operator()(planar_pixel_iterator<IC, CS> const i1, std::ptrdiff_t n, planar_pixel_iterator<IC, CS> const i2) const
    +
    973  {
    +
    974  // FIXME: ptrdiff_t vs size_t
    +
    975  constexpr std::ptrdiff_t byte_size = n * sizeof(typename std::iterator_traits<IC>::value_type);
    +
    976  for (std::ptrdiff_t i = 0; i < mp11::mp_size<CS>::value; ++i)
    +
    977  {
    +
    978  if (memcmp(dynamic_at_c(i1, i), dynamic_at_c(i2, i), byte_size) != 0)
    +
    979  return false;
    +
    980  }
    +
    981  return true;
    +
    982  }
    +
    983 };
    +
    984 
    +
    988 template <typename Loc, typename It>
    +
    989 struct equal_n_fn<boost::gil::iterator_from_2d<Loc>, It>
    +
    990 {
    +
    991  BOOST_FORCEINLINE
    +
    992  bool operator()(boost::gil::iterator_from_2d<Loc> i1, std::ptrdiff_t n, It i2) const
    +
    993  {
    +
    994  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    +
    995  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    +
    996  while (n > 0)
    +
    997  {
    +
    998  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i1.width() - i1.x_pos());
    +
    999  if (!equal_n(i1.x(), num, i2))
    +
    1000  return false;
    +
    1001  i1 += num;
    +
    1002  i2 += num;
    +
    1003  n -= num;
    +
    1004  }
    +
    1005  return true;
    +
    1006  }
    +
    1007 };
    +
    1008 
    +
    1012 template <typename It, typename Loc>
    +
    1013 struct equal_n_fn<It, boost::gil::iterator_from_2d<Loc>>
    +
    1014 {
    +
    1015  BOOST_FORCEINLINE
    +
    1016  bool operator()(It i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc> i2) const
    +
    1017  {
    +
    1018  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    +
    1019  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    +
    1020  while (n > 0)
    +
    1021  {
    +
    1022  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i2.width() - i2.x_pos());
    +
    1023  if (!equal_n(i1, num, i2.x()))
    +
    1024  return false;
    +
    1025  i1 += num;
    +
    1026  i2 += num;
    +
    1027  n -= num;
    +
    1028  }
    +
    1029  return true;
    +
    1030  }
    +
    1031 };
    +
    1032 
    +
    1034 template <typename Loc1, typename Loc2>
    +
    1035 struct equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>> {
    +
    1036  BOOST_FORCEINLINE bool operator()(boost::gil::iterator_from_2d<Loc1> i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc2> i2) const {
    +
    1037  gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    +
    1038  gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    +
    1039  if (i1.x_pos()!=i2.x_pos() || i1.width()!=i2.width()) {
    +
    1040  while(n-->0) {
    +
    1041  if (*i1++!=*i2++) return false;
    +
    1042  }
    +
    1043  }
    +
    1044  while (n>0) {
    +
    1045  std::ptrdiff_t num=std::min<const std::ptrdiff_t>(n,i2.width()-i2.x_pos());
    +
    1046  if (!equal_n(i1.x(), num, i2.x()))
    +
    1047  return false;
    +
    1048  i1+=num;
    +
    1049  i2+=num;
    +
    1050  n-=num;
    +
    1051  }
    +
    1052  return true;
    +
    1053  }
    +
    1054 };
    +
    1055 } // namespace detail
    +
    1056 
    +
    1057 template <typename I1, typename I2> BOOST_FORCEINLINE
    +
    1058 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2) {
    +
    1059  return detail::equal_n_fn<I1,I2>()(i1,n,i2);
    +
    1060 }
    +
    1061 } } // namespace boost::gil
    +
    1062 
    +
    1063 namespace std {
    +
    1075 template <typename Loc1, typename Loc2> BOOST_FORCEINLINE
    + +
    1077  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    +
    1078  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    +
    1079  std::ptrdiff_t n=last-first;
    +
    1080  if (first.is_1d_traversable()) {
    +
    1081  if (first2.is_1d_traversable())
    +
    1082  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,typename Loc2::x_iterator>()(first.x(),n, first2.x());
    +
    1083  else
    +
    1084  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,boost::gil::iterator_from_2d<Loc2>>()(first.x(),n, first2);
    +
    1085  } else {
    +
    1086  if (first2.is_1d_traversable())
    +
    1087  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,typename Loc2::x_iterator>()(first,n, first2.x());
    +
    1088  else
    +
    1089  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>>()(first,n,first2);
    +
    1090  }
    +
    1091 }
    +
    1092 } // namespace std
    +
    1093 
    +
    1094 namespace boost { namespace gil {
    +
    1097 template <typename View1, typename View2> BOOST_FORCEINLINE
    +
    1098 bool equal_pixels(const View1& v1, const View2& v2) {
    +
    1099  BOOST_ASSERT(v1.dimensions() == v2.dimensions());
    +
    1100  return std::equal(v1.begin(),v1.end(),v2.begin()); // std::equal has overloads with GIL iterators for optimal performance
    +
    1101 }
    +
    1102 
    +
    1108 
    +
    1112 
    +
    1115 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    +
    1116 F transform_pixels(const View1& src,const View2& dst, F fun) {
    +
    1117  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    +
    1118  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    +
    1119  typename View1::x_iterator srcIt=src.row_begin(y);
    +
    1120  typename View2::x_iterator dstIt=dst.row_begin(y);
    +
    1121  for (std::ptrdiff_t x=0; x<src.width(); ++x)
    +
    1122  dstIt[x]=fun(srcIt[x]);
    +
    1123  }
    +
    1124  return fun;
    +
    1125 }
    +
    1126 
    +
    1129 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    +
    1130 F transform_pixels(const View1& src1, const View2& src2,const View3& dst, F fun) {
    +
    1131  for (std::ptrdiff_t y=0; y<dst.height(); ++y) {
    +
    1132  typename View1::x_iterator srcIt1=src1.row_begin(y);
    +
    1133  typename View2::x_iterator srcIt2=src2.row_begin(y);
    +
    1134  typename View3::x_iterator dstIt=dst.row_begin(y);
    +
    1135  for (std::ptrdiff_t x=0; x<dst.width(); ++x)
    +
    1136  dstIt[x]=fun(srcIt1[x],srcIt2[x]);
    +
    1137  }
    +
    1138  return fun;
    +
    1139 }
    +
    1140 
    +
    1144 
    +
    1147 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    +
    1148 F transform_pixel_positions(const View1& src,const View2& dst, F fun) {
    +
    1149  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    +
    1150  typename View1::xy_locator loc=src.xy_at(0,0);
    +
    1151  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    +
    1152  typename View2::x_iterator dstIt=dst.row_begin(y);
    +
    1153  for (std::ptrdiff_t x=0; x<src.width(); ++x, ++loc.x())
    +
    1154  dstIt[x]=fun(loc);
    +
    1155  loc.x()-=src.width(); ++loc.y();
    +
    1156  }
    +
    1157  return fun;
    +
    1158 }
    +
    1159 
    +
    1162 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    +
    1163 F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst, F fun) {
    +
    1164  BOOST_ASSERT(src1.dimensions() == dst.dimensions());
    +
    1165  BOOST_ASSERT(src2.dimensions() == dst.dimensions());
    +
    1166  typename View1::xy_locator loc1=src1.xy_at(0,0);
    +
    1167  typename View2::xy_locator loc2=src2.xy_at(0,0);
    +
    1168  for (std::ptrdiff_t y=0; y<src1.height(); ++y) {
    +
    1169  typename View3::x_iterator dstIt=dst.row_begin(y);
    +
    1170  for (std::ptrdiff_t x=0; x<src1.width(); ++x, ++loc1.x(), ++loc2.x())
    +
    1171  dstIt[x]=fun(loc1,loc2);
    +
    1172  loc1.x()-=src1.width(); ++loc1.y();
    +
    1173  loc2.x()-=src2.width(); ++loc2.y();
    +
    1174  }
    +
    1175  return fun;
    +
    1176 }
    +
    1177 } } // namespace boost::gil
    +
    1178 
    +
    1179 #endif
    +
    MEMORY-BASED STEP ITERATOR.
    Definition: algorithm.hpp:36
    +
    Definition: algorithm.hpp:183
    +
    BOOST_FORCEINLINE void copy_and_convert_pixels(const View1 &src, const View2 &dst)
    Definition: algorithm.hpp:335
    +
    BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
    std::fill for image views
    Definition: algorithm.hpp:410
    +
    BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
    std::equal for image views
    Definition: algorithm.hpp:1098
    +
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
    Definition: metafunctions.hpp:23
    +
    A generic binary operation on views.
    Definition: algorithm.hpp:81
    +
    void generate_pixels(View const &view, F fun)
    std::generate for image views
    Definition: algorithm.hpp:911
    +
    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:813
    +
    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
    Definition: iterator_from_2d.hpp:42
    +
    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:359
    +
    BOOST_FORCEINLINE F transform_pixels(const View1 &src1, const View2 &src2, const View3 &dst, F fun)
    transform_pixels with two sources
    Definition: algorithm.hpp:1130
    +
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:522
    +
    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:1163
    +
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    +
    BOOST_FORCEINLINE boost::gil::iterator_from_2d< OL > copy1(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst)
    std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
    Definition: algorithm.hpp:273
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    +
    BOOST_FORCEINLINE void destruct_pixels(View const &view)
    Invokes the in-place destructor on every pixel of the view.
    Definition: algorithm.hpp:508
    +
    F for_each_pixel_position(View const &view, F fun)
    Definition: algorithm.hpp:888
    +
    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:577
    +
    void default_construct_pixels(View const &view)
    Invokes the in-place default constructor on every pixel of the (uninitialized) view....
    Definition: algorithm.hpp:714
    +
    BOOST_FORCEINLINE boost::gil::planar_pixel_iterator< IC2, CS > 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)
    Copy when both src and dst are planar pointers is copy for each channel.
    Definition: algorithm.hpp:171
    +
    struct to do std::fill
    Definition: algorithm.hpp:381
    +
    F for_each_pixel(View const &view, F fun)
    Definition: algorithm.hpp:868
    +
    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:1076
    +
    Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
    Definition: algorithm.hpp:38
    +
    An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
    Definition: algorithm.hpp:34
    diff --git a/develop/doc/html/reference/annotated.html b/develop/doc/html/reference/annotated.html index cb75cc87c..1a1722230 100644 --- a/develop/doc/html/reference/annotated.html +++ b/develop/doc/html/reference/annotated.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class List @@ -27,24 +27,16 @@

    - - - + + + + +
    @@ -70,258 +62,269 @@  Cequal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > >  Cfile_stream_device  Cread_tagUsed to overload the constructor - 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 - CidentityIdentity taken from SGI STL - CincOperator++ wrapped in a function object - Cis_input_device - Cis_output_device - Cis_read_device - Cis_read_onlyDetermines if reader type is read only ( no conversion ) - Cis_write_device - Cistream_device - Ckth_channel_deref_fnFunction object that returns a grayscale reference of the K-th channel (specified as a template parameter) of a given reference. Models: PixelDereferenceAdaptorConcept.If the input is a pixel value or constant reference, the function object is immutable. Otherwise it is mutable (and returns non-const reference to the k-th channel) - Cnth_channel_deref_fnFunction object that returns a grayscale reference of the N-th channel of a given reference. Models: PixelDereferenceAdaptorConcept.If the input is a pixel value or constant reference, the function object is immutable. Otherwise it is mutable (and returns non-const reference to the n-th channel) - Costream_device - CPixelImageViewIsMutableConcept - CPixelIteratorIsMutableConcept - Cplus_asymmetricPlus function object whose arguments may be of different type - CRandomAccess2DImageViewIsMutableConcept - CRandomAccessNDImageViewIsMutableConcept - CRandomAccessNDLocatorIsMutableConcept - Crgb_to_luminance_fnRed * .3 + green * .59 + blue * .11 + .5 - Cstd_fill_tStruct to do std::fill - Cstep_iterator_adaptorAn adaptor over an existing iterator that changes the step unit - Ctype_to_indexReturns the index corresponding to the first occurrance of a given given type in - Calpha_tAlpha - Cany_imageRepresents a run-time specified image. Note it does NOT model ImageConcept - Cany_image_viewRepresents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, Note that this class does NOT model ImageViewConcept - CAssignableConcept of copy assignment requirement - Cbinary_operation_objA generic binary operation on viewsUse 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 - Cbit_aligned_image1_typeReturns the type of a single-channel bit-aligned image given the bit size of its channel and its layout - Cbit_aligned_image2_typeReturns the type of a two channel bit-aligned image given the bit size of its channels and its layout - Cbit_aligned_image3_typeReturns the type of a three channel bit-aligned image given the bit size of its channels and its layout - Cbit_aligned_image4_typeReturns the type of a four channel bit-aligned image given the bit size of its channels and its layout - Cbit_aligned_image5_typeReturns the type of a five channel bit-aligned image given the bit size of its channels and its layout - Cbit_aligned_image_typeReturns 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_pixel_iteratorAn iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept - Cbit_range - Cblack_tBlack - Cblue_tBlue - Cbyte_to_memunit - Cchannel_converterA unary function object converting between channel types - Cchannel_converter_unsigned< float32_t, DstChannelV >Float32_t conversion - Cchannel_converter_unsigned< float32_t, uint32_t >32 bit <-> float channel conversion - Cchannel_converter_unsigned< T, T >Converting a channel to itself - identity operation - Cchannel_converter_unsigned< uint32_t, float32_t >32 bit <-> float channel conversion - Cchannel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept - Cchannel_multiplierA function object to multiply two channels. result = a * b / max_value - Cchannel_multiplier_unsignedThis 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< uint8_t >Specialization of channel_multiply for 8-bit unsigned channels - Cchannel_type - Cchannel_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept - CChannelConceptA 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 - CChannelConvertibleConceptA channel is convertible to another one if the channel_convert algorithm is defined for the two channels - CChannelMappingConceptChannel mapping concept - Cchannels_are_compatiblePredicate metafunction returning whether two channels are compatible - CChannelsCompatibleConceptChannels are compatible if their associated value types (ignoring constness and references) are the same - CChannelValueConceptA channel that supports default construction - CCollectionImageViewConceptGIL view as Collection - Ccolor_convert_deref_fnFunction object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept - Ccolor_converted_view_typeReturns 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, CC >Returns the type of a runtime-specified view, color-converted to a given pixel type with user specified color converter - Ccolor_element_const_reference_typeSpecifies the return type of the constant element accessor by color name, get_color(color_base, Color()); - Ccolor_element_reference_typeSpecifies the return type of the mutable element accessor by color name, get_color(color_base, Color()); - Ccolor_element_typeSpecifies the type of the element associated with a given color tag - Ccolor_space_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept - CColorBaseConceptA color base is a container of color elements (such as channels, channel references or channel pointers) - CColorBasesCompatibleConceptTwo color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise - CColorBaseValueConceptColor base that also has a default-constructor. Refines Regular - CColorSpaceConceptColor space type concept - CColorSpacesCompatibleConceptTwo color spaces are compatible if they are the same - Cconst_iterator_typeReturns the type of an iterator just like the input iterator, except operating over immutable values - Ccontains_colorA predicate metafunction determining whether a given color base contains a given color - CCopyConstructibleConcept of copy construction requirement - Ccyan_tCyan - 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_implColor 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_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, 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, 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, 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, rgba_t >Unfortunately RGBA to RGBA must be explicitly provided - otherwise we get ambiguous specialization error - CDefaultConstructibleConcept of default construction requirement - Cderef_baseHelper base class for pixel dereference adaptors - Cderef_composeComposes two dereference function objects. Similar to std::unary_compose but needs to pull some aliases from the component types. Models: PixelDereferenceAdaptorConcept - Cdereference_iterator_adaptorAn adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept - Cderived_image_typeConstructs 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_typeConstructs 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_typeConstructs 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_typeConstructs 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_tUnnamed color - Cdevicen_layout_tUnnamed color layout of up to five channels - Cdevicen_tUnnamed color space of 1, 3, 4, or 5 channels - Cdynamic_x_step_typeBase template for types that model HasDynamicXStepTypeConcept - Cdynamic_xy_step_transposed_typeReturns the type of a transposed view that has a dynamic step along both X and Y - Cdynamic_xy_step_typeReturns the type of a view that has a dynamic step along both X and Y - Cdynamic_y_step_typeBase template for types that model HasDynamicYStepTypeConcept - Celement_const_reference_typeSpecifies the return type of the constant element accessor at_c of a homogeneous color base - Celement_reference_typeSpecifies the return type of the mutable element accessor at_c of a homogeneous color base - Celement_typeSpecifies the element type of a homogeneous color base - CEqualityComparableConcept of == and != comparability requirement - CForwardCollectionImageViewConceptGIL view as ForwardCollection - Cget_dynamic_image_readerHelper metafunction to generate dynamic image reader type - Cget_dynamic_image_writerHelper metafunction to generate dynamic image writer type - Cget_readerHelper metafunction to generate image reader type - Cget_reader_backendHelper metafunction to generate image backend type - Cget_scanline_readerHelper metafunction to generate image scanline_reader type - Cget_writerHelper metafunction to generate writer type - Cgray_color_tGray - Cgreen_tGreen - CHasDynamicXStepTypeConceptConcept 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 - CHasDynamicYStepTypeConceptConcept 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 - CHasTransposedTypeConceptConcept for locators and views that can define a type just like the given locator or view, except X and Y is swapped - CHomogeneousColorBaseConceptColor base whose elements all have the same type - CHomogeneousColorBaseValueConceptHomogeneous color base that also has a default constructor. Refines Regular - CHomogeneousPixelBasedConceptConcept for homogeneous pixel-based GIL constructs - CHomogeneousPixelConceptHomogeneous pixel concept - CHomogeneousPixelValueConceptHomogeneous pixel concept that is a Regular type - CimageContainer interface over image view. Models ImageConcept, PixelBasedConcept - Cimage_is_basicBasic images must use basic views and std::allocator - Cimage_typeReturns the type of a homogeneous image given the channel type, layout, and whether it operates on planar data - Cimage_viewA lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept - CImageConcept2-dimensional image whose value type models PixelValueConcept - CImageViewConceptGIL's 2-dimensional view over immutable GIL pixels - Cis_iterator_adaptorMetafunction 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_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_supported - Citerator_adaptor_get_baseReturns the base iterator for a given iterator adaptor. Provide an specialization when introducing new iterator adaptors - Citerator_adaptor_rebindChanges the base iterator of an iterator adaptor. Provide an specialization when introducing new iterator adaptors - Citerator_add_derefReturns 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_2dProvides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept - Citerator_is_basicDetermines 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_mutableMetafunction predicate returning whether the given iterator allows for changing its values - Citerator_is_stepDetermines if the given iterator has a step that could be set dynamically - Citerator_typeReturns 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_pixelReturns 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 - CIteratorAdaptorConceptIterator adaptor is a forward iterator adapting another forward iterator - Ckth_channel_view_typeGiven a source image view type View, returns the type of an image view over a given channel of View.If the channels in the source view are adjacent in memory (such as planar non-step view or single-channel view) then the return view is a single-channel non-step view. If the channels are non-adjacent (interleaved and/or step view) then the return view is a single-channel step view - Ckth_semantic_element_const_reference_typeSpecifies the return type of the constant semantic_at_c<K>(color_base); - Ckth_semantic_element_reference_typeSpecifies the return type of the mutable semantic_at_c<K>(color_base); - Ckth_semantic_element_typeSpecifies the type of the K-th semantic element of a color base - ClayoutRepresents a color space and ordering of channels in memory - Clocator_is_basicDetermines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator - Clocator_is_mutableDetermines if the given locator is mutable (i.e. its pixels can be changed) - Clocator_is_step_in_xDetermines if the given locator has a horizontal step that could be set dynamically - Clocator_is_step_in_yDetermines if the given locator has a vertical step that could be set dynamically - Clocator_typeReturns 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 - Cmemory_based_2d_locatorMemory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConceptThe class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation - Cmemory_based_step_iteratorMEMORY-BASED STEP ITERATOR - CMemoryBasedIteratorConceptConcept of a random-access iterator that can be advanced in memory units (bytes or bits) - Cmemunit_step_fnFunction object that returns the memory unit distance between two iterators and advances a given iterator a given number of mem units (bytes or bits) - CMetafunctionConcept for type as metafunction requirement - CMutableChannelConceptA channel that allows for modifying its value - CMutableColorBaseConceptColor base which allows for modifying its elements - CMutableHomogeneousColorBaseConceptHomogeneous color base that allows for modifying its elements - CMutableHomogeneousPixelConceptHomogeneous pixel concept that allows for changing its channels - CMutableImageViewConceptGIL's 2-dimensional view over mutable GIL pixels - CMutableIteratorAdaptorConceptIterator adaptor that is mutable - CMutablePixelConceptPixel concept that allows for changing its channels - CMutablePixelIteratorConceptPixel iterator that allows for changing its pixel - CMutablePixelLocatorConceptGIL's 2-dimensional locator over mutable GIL pixels - CMutableRandomAccess2DImageViewConcept2-dimensional view over mutable values - CMutableRandomAccess2DLocatorConcept2-dimensional locator over mutable pixels - CMutableRandomAccessNDImageViewConceptN-dimensional view over mutable values - CMutableRandomAccessNDLocatorConceptN-dimensional locator over mutable pixels - CMutableStepIteratorConceptStep iterator that allows for modifying its current value - Cnth_channel_view_typeGiven a source image view type View, returns the type of an image view over a single channel of ViewIf the channels in the source view are adjacent in memory (such as planar non-step view or single-channel view) then the return view is a single-channel non-step view. If the channels are non-adjacent (interleaved and/or step view) then the return view is a single-channel step 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_channelsReturns the number of channels of a pixel-based GIL construct - 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_image1_typeReturns the type of a single-channel image given its bitfield type, the bit size of its channel and its layout - Cpacked_image2_typeReturns the type of a two channel image given its bitfield type, the bit size of its channels and its layout - Cpacked_image3_typeReturns the type of a three channel image given its bitfield type, the bit size of its channels and its layout - Cpacked_image4_typeReturns the type of a four channel image given its bitfield type, the bit size of its channels and its layout - Cpacked_image5_typeReturns the type of a five channel image given its bitfield type, the bit size of its channels and its layout - Cpacked_image_typeReturns the type of an interleaved packed image: an image whose channels may not be byte-aligned, but whose pixels are byte aligned - Cpacked_pixelHeterogeneous 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_typeReturns the type of a packed pixel given its bitfield type, the bit size of its channels and its layout - CpixelRepresents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept - Cpixel_2d_locator_baseBase class for models of PixelLocatorConceptPixel 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: - Cpixel_is_referenceGiven a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value) - Cpixel_reference_is_basicDetermines 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_mutableDetermines if the given pixel reference is mutable (i.e. its channels can be changed) - Cpixel_reference_is_proxyDetermines whether the given pixel reference is a proxy class or a native C++ reference - Cpixel_reference_typeReturns 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_typeReturns the type of a homogeneous pixel given the channel type and layout - CPixelBasedConceptConcept for all pixel-based GIL constructs - CPixelConceptPixel concept - A color base whose elements are channels - CPixelConvertibleConceptPixel 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 - CPixelDereferenceAdaptorConceptRepresents a unary function object that can be invoked upon dereferencing a pixel iterator - CPixelIteratorConceptAn STL random access traversal iterator over a model of PixelConcept - CPixelLocatorConceptGIL's 2-dimensional locator over immutable GIL pixels - Cpixels_are_compatibleReturns 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 - CPixelsCompatibleConceptConcept 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 - CPixelValueConceptPixel concept that is a Regular type - Cplanar_pixel_iteratorAn iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept - Cplanar_pixel_referenceA reference proxy to a planar pixel - Cpoint2D point both axes of which have the same dimension typeModels: Point2DConcept - CPoint2DConcept2-dimensional point concept - CPointNDConceptN-dimensional point concept - Cposition_iteratorAn 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_integralMeta-function to define an integral type with size than is (roughly) twice the bit size of T - CRandomAccess2DImageConcept2-dimensional container of values - CRandomAccess2DImageViewConcept2-dimensional view over immutable values - CRandomAccess2DLocatorConcept2-dimensional locator over immutable values - CRandomAccessNDImageConceptN-dimensional container of values - CRandomAccessNDImageViewConceptN-dimensional view over immutable values - CRandomAccessNDLocatorConceptN-dimensional locator over immutable values - Creader_base - Cred_tRed - CRegularConcept for type regularity requirement - CReversibleCollectionImageViewConceptGIL view as ReversibleCollection - CSameTypeConcept of types equivalence requirement - Cscanline_read_iteratorInput iterator to read images - CsizeReturns an integral constant type specifying the number of elements in a color base - CStepIteratorConceptStep iterator concept - CSwappableConcept of swap operation requirement - Ctransposed_type - Ctype_from_x_iteratorGiven a pixel iterator defining access to pixels along a row, returns the types of the corresponding built-in step_iterator, xy_locator, image_view - Cview_is_basicBasic views must be over basic locators - Cview_is_mutableDetermines if the given view is mutable (i.e. its pixels can be changed) - Cview_is_step_in_xDetermines if the given view has a horizontal step that could be set dynamically - Cview_is_step_in_yDetermines if the given view has a vertical step that could be set dynamically - Cview_typeReturns 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_pixelReturns the type of a view the pixel type, whether it operates on planar data and whether it has a step horizontally - Cviews_are_compatibleReturns whether two views are compatible - CViewsCompatibleConceptViews are compatible if they have the same color spaces and compatible channel values - Cvirtual_2d_locatorA 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept - Cyellow_tYellow + CfillerFiller 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 + Chash_tupleFunctor 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 + 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 + CidentityIdentity taken from SGI STL + CincOperator++ wrapped in a function object + Cis_input_device + Cis_output_device + Cis_read_device + Cis_read_onlyDetermines if reader type is read only ( no conversion ) + Cis_write_device + Cistream_device + Ckth_channel_deref_fnFunction object that returns a grayscale reference of the K-th channel (specified as a template parameter) of a given reference. Models: PixelDereferenceAdaptorConcept + Cnth_channel_deref_fnFunction object that returns a grayscale reference of the N-th channel of a given reference. Models: PixelDereferenceAdaptorConcept + Costream_device + CPixelImageViewIsMutableConcept + CPixelIteratorIsMutableConcept + Cplus_asymmetricPlus function object whose arguments may be of different type + CRandomAccess2DImageViewIsMutableConcept + CRandomAccessNDImageViewIsMutableConcept + CRandomAccessNDLocatorIsMutableConcept + Crgb_to_luminance_fnRed * .3 + green * .59 + blue * .11 + .5 + Cstd_fill_tStruct to do std::fill + Cstep_iterator_adaptorAn adaptor over an existing iterator that changes the step unit + Ctuple_limitProvides equivalent of std::numeric_limits for type std::tuple tuple_limit gets called with only tuples having integral elements + Ctype_to_indexReturns the index corresponding to the first occurrance of a given given type in + Nlaplace_functionDiscrete approximations of 2D Laplacian operator + Cstencil_5points5 point stencil approximation of Laplacian + Cstencil_9points_standard9 point stencil approximation of Laplacian + Calpha_tAlpha + Cany_imageRepresents a run-time specified image. Note it does NOT model ImageConcept + Cany_image_viewRepresents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, Note that this class does NOT model ImageViewConcept + CAssignableConcept of copy assignment requirement + Cbinary_operation_objA generic binary operation on views + Cbit_aligned_image1_typeReturns the type of a single-channel bit-aligned image given the bit size of its channel and its layout + Cbit_aligned_image2_typeReturns the type of a two channel bit-aligned image given the bit size of its channels and its layout + Cbit_aligned_image3_typeReturns the type of a three channel bit-aligned image given the bit size of its channels and its layout + Cbit_aligned_image4_typeReturns the type of a four channel bit-aligned image given the bit size of its channels and its layout + Cbit_aligned_image5_typeReturns the type of a five channel bit-aligned image given the bit size of its channels and its layout + Cbit_aligned_image_typeReturns 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_pixel_iteratorAn iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept + Cbit_range + Cblack_tBlack + Cblue_tBlue + Cbyte_to_memunit + Cchannel_converterA unary function object converting between channel types + Cchannel_converter_unsigned< float32_t, DstChannelV >Float32_t conversion + Cchannel_converter_unsigned< float32_t, uint32_t >32 bit <-> float channel conversion + Cchannel_converter_unsigned< T, T >Converting a channel to itself - identity operation + Cchannel_converter_unsigned< uint32_t, float32_t >32 bit <-> float channel conversion + Cchannel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept + Cchannel_multiplierA function object to multiply two channels. result = a * b / max_value + Cchannel_multiplier_unsignedThis 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< uint8_t >Specialization of channel_multiply for 8-bit unsigned channels + Cchannel_type + Cchannel_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept + CChannelConceptA 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 + CChannelConvertibleConceptA channel is convertible to another one if the channel_convert algorithm is defined for the two channels + CChannelMappingConceptChannel mapping concept + Cchannels_are_compatiblePredicate metafunction returning whether two channels are compatible + CChannelsCompatibleConceptChannels are compatible if their associated value types (ignoring constness and references) are the same + CChannelValueConceptA channel that supports default construction + CCollectionImageViewConceptGIL view as Collection + Ccolor_convert_deref_fnFunction object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept + Ccolor_converted_view_typeReturns 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, CC >Returns the type of a runtime-specified view, color-converted to a given pixel type with user specified color converter + Ccolor_element_const_reference_typeSpecifies the return type of the constant element accessor by color name, get_color(color_base, Color()); + Ccolor_element_reference_typeSpecifies the return type of the mutable element accessor by color name, get_color(color_base, Color()); + Ccolor_element_typeSpecifies the type of the element associated with a given color tag + Ccolor_space_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept + CColorBaseConceptA color base is a container of color elements (such as channels, channel references or channel pointers) + CColorBasesCompatibleConceptTwo color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise + CColorBaseValueConceptColor base that also has a default-constructor. Refines Regular + CColorSpaceConceptColor space type concept + CColorSpacesCompatibleConceptTwo color spaces are compatible if they are the same + Cconst_iterator_typeReturns the type of an iterator just like the input iterator, except operating over immutable values + Ccontains_colorA predicate metafunction determining whether a given color base contains a given color + CCopyConstructibleConcept of copy construction requirement + Ccyan_tCyan + 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_implColor 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_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, 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, 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, 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, rgba_t >Unfortunately RGBA to RGBA must be explicitly provided - otherwise we get ambiguous specialization error + CDefaultConstructibleConcept of default construction requirement + Cderef_baseHelper base class for pixel dereference adaptors + Cderef_composeComposes two dereference function objects. Similar to std::unary_compose but needs to pull some aliases from the component types. Models: PixelDereferenceAdaptorConcept + Cdereference_iterator_adaptorAn adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept + Cderived_image_typeConstructs a homogeneous image type from a source image type by changing some of the properties + Cderived_iterator_typeConstructs a pixel iterator type from a source pixel iterator type by changing some of the properties + Cderived_pixel_reference_typeConstructs a pixel reference type from a source pixel reference type by changing some of the properties + Cderived_view_typeConstructs an image view type from a source view type by changing some of the properties + Cdevicen_color_tUnnamed color + Cdevicen_layout_tUnnamed color layout of up to five channels + Cdevicen_tUnnamed color space of 1, 3, 4, or 5 channels + Cdynamic_x_step_typeBase template for types that model HasDynamicXStepTypeConcept + Cdynamic_x_step_type< const Pixel * > + Cdynamic_x_step_type< Pixel * > + Cdynamic_xy_step_transposed_typeReturns the type of a transposed view that has a dynamic step along both X and Y + Cdynamic_xy_step_typeReturns the type of a view that has a dynamic step along both X and Y + Cdynamic_y_step_typeBase template for types that model HasDynamicYStepTypeConcept + Celement_const_reference_typeSpecifies the return type of the constant element accessor at_c of a homogeneous color base + Celement_reference_typeSpecifies the return type of the mutable element accessor at_c of a homogeneous color base + Celement_typeSpecifies the element type of a homogeneous color base + CEqualityComparableConcept of == and != comparability requirement + CForwardCollectionImageViewConceptGIL view as ForwardCollection + Cget_dynamic_image_readerHelper metafunction to generate dynamic image reader type + Cget_dynamic_image_writerHelper metafunction to generate dynamic image writer type + Cget_readerHelper metafunction to generate image reader type + Cget_reader_backendHelper metafunction to generate image backend type + Cget_scanline_readerHelper metafunction to generate image scanline_reader type + Cget_writerHelper metafunction to generate writer type + Cgray_color_tGray + Cgreen_tGreen + CHasDynamicXStepTypeConceptConcept 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 + CHasDynamicYStepTypeConceptConcept 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 + CHasTransposedTypeConceptConcept for locators and views that can define a type just like the given locator or view, except X and Y is swapped + ChistogramDefault histogram class provided by boost::gil + CHomogeneousColorBaseConceptColor base whose elements all have the same type + CHomogeneousColorBaseValueConceptHomogeneous color base that also has a default constructor. Refines Regular + CHomogeneousPixelBasedConceptConcept for homogeneous pixel-based GIL constructs + CHomogeneousPixelConceptHomogeneous pixel concept + CHomogeneousPixelValueConceptHomogeneous pixel concept that is a Regular type + Chough_parameterA type to encapsulate Hough transform parameter range + CimageContainer interface over image view. Models ImageConcept, PixelBasedConcept + Cimage_is_basicBasic images must use basic views and std::allocator + Cimage_typeReturns the type of a homogeneous image given the channel type, layout, and whether it operates on planar data + Cimage_viewA lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept + CImageConcept2-dimensional image whose value type models PixelValueConcept + CImageViewConceptGIL's 2-dimensional view over immutable GIL pixels + Cis_iterator_adaptorMetafunction 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_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_supported + Citerator_adaptor_get_baseReturns the base iterator for a given iterator adaptor. Provide an specialization when introducing new iterator adaptors + Citerator_adaptor_rebindChanges the base iterator of an iterator adaptor. Provide an specialization when introducing new iterator adaptors + Citerator_add_derefReturns 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_2dProvides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept + Citerator_is_basicDetermines 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_mutableMetafunction predicate returning whether the given iterator allows for changing its values + Citerator_is_stepDetermines if the given iterator has a step that could be set dynamically + Citerator_typeReturns 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_pixelReturns 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 + CIteratorAdaptorConceptIterator adaptor is a forward iterator adapting another forward iterator + Ckth_channel_view_typeGiven a source image view type View, returns the type of an image view over a given channel of View + Ckth_semantic_element_const_reference_typeSpecifies the return type of the constant semantic_at_c<K>(color_base); + Ckth_semantic_element_reference_typeSpecifies the return type of the mutable semantic_at_c<K>(color_base); + Ckth_semantic_element_typeSpecifies the type of the K-th semantic element of a color base + ClayoutRepresents a color space and ordering of channels in memory + Clocator_is_basicDetermines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator + Clocator_is_mutableDetermines if the given locator is mutable (i.e. its pixels can be changed) + Clocator_is_step_in_xDetermines if the given locator has a horizontal step that could be set dynamically + Clocator_is_step_in_yDetermines if the given locator has a vertical step that could be set dynamically + Clocator_typeReturns 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 + Cmemory_based_2d_locatorMemory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept + Cmemory_based_step_iteratorMEMORY-BASED STEP ITERATOR + CMemoryBasedIteratorConceptConcept of a random-access iterator that can be advanced in memory units (bytes or bits) + Cmemunit_step_fnFunction object that returns the memory unit distance between two iterators and advances a given iterator a given number of mem units (bytes or bits) + CMetafunctionConcept for type as metafunction requirement + CMutableChannelConceptA channel that allows for modifying its value + CMutableColorBaseConceptColor base which allows for modifying its elements + CMutableHomogeneousColorBaseConceptHomogeneous color base that allows for modifying its elements + CMutableHomogeneousPixelConceptHomogeneous pixel concept that allows for changing its channels + CMutableImageViewConceptGIL's 2-dimensional view over mutable GIL pixels + CMutableIteratorAdaptorConceptIterator adaptor that is mutable + CMutablePixelConceptPixel concept that allows for changing its channels + CMutablePixelIteratorConceptPixel iterator that allows for changing its pixel + CMutablePixelLocatorConceptGIL's 2-dimensional locator over mutable GIL pixels + CMutableRandomAccess2DImageViewConcept2-dimensional view over mutable values + CMutableRandomAccess2DLocatorConcept2-dimensional locator over mutable pixels + CMutableRandomAccessNDImageViewConceptN-dimensional view over mutable values + CMutableRandomAccessNDLocatorConceptN-dimensional locator over mutable pixels + CMutableStepIteratorConceptStep iterator that allows for modifying its current value + Cnth_channel_view_typeGiven 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_channelsReturns the number of channels of a pixel-based GIL construct + 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_image1_typeReturns the type of a single-channel image given its bitfield type, the bit size of its channel and its layout + Cpacked_image2_typeReturns the type of a two channel image given its bitfield type, the bit size of its channels and its layout + Cpacked_image3_typeReturns the type of a three channel image given its bitfield type, the bit size of its channels and its layout + Cpacked_image4_typeReturns the type of a four channel image given its bitfield type, the bit size of its channels and its layout + Cpacked_image5_typeReturns the type of a five channel image given its bitfield type, the bit size of its channels and its layout + Cpacked_image_typeReturns the type of an interleaved packed image: an image whose channels may not be byte-aligned, but whose pixels are byte aligned + Cpacked_pixelHeterogeneous 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_typeReturns the type of a packed pixel given its bitfield type, the bit size of its channels and its layout + CpixelRepresents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept + Cpixel_2d_locator_baseBase class for models of PixelLocatorConcept + Cpixel_is_referenceGiven a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value) + Cpixel_reference_is_basicDetermines 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_mutableDetermines if the given pixel reference is mutable (i.e. its channels can be changed) + Cpixel_reference_is_proxyDetermines whether the given pixel reference is a proxy class or a native C++ reference + Cpixel_reference_typeReturns 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_typeReturns the type of a homogeneous pixel given the channel type and layout + CPixelBasedConceptConcept for all pixel-based GIL constructs + CPixelConceptPixel concept - A color base whose elements are channels + CPixelConvertibleConceptPixel 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 + CPixelDereferenceAdaptorConceptRepresents a unary function object that can be invoked upon dereferencing a pixel iterator + CPixelIteratorConceptAn STL random access traversal iterator over a model of PixelConcept + CPixelLocatorConceptGIL's 2-dimensional locator over immutable GIL pixels + Cpixels_are_compatibleReturns 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 + CPixelsCompatibleConceptConcept 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 + CPixelValueConceptPixel concept that is a Regular type + Cplanar_pixel_iteratorAn iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept + Cplanar_pixel_referenceA reference proxy to a planar pixel + Cpoint2D point both axes of which have the same dimension type + CPoint2DConcept2-dimensional point concept + CPointNDConceptN-dimensional point concept + Cposition_iteratorAn 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_integralMeta-function to define an integral type with size than is (roughly) twice the bit size of T + CRandomAccess2DImageConcept2-dimensional container of values + CRandomAccess2DImageViewConcept2-dimensional view over immutable values + CRandomAccess2DLocatorConcept2-dimensional locator over immutable values + CRandomAccessNDImageConceptN-dimensional container of values + CRandomAccessNDImageViewConceptN-dimensional view over immutable values + CRandomAccessNDLocatorConceptN-dimensional locator over immutable values + Creader_base + Cred_tRed + CRegularConcept for type regularity requirement + CReversibleCollectionImageViewConceptGIL view as ReversibleCollection + CSameTypeConcept of types equivalence requirement + Cscanline_read_iteratorInput iterator to read images + CsizeReturns an integral constant type specifying the number of elements in a color base + CStepIteratorConceptStep iterator concept + CSwappableConcept of swap operation requirement + Ctransposed_type + Ctype_from_x_iteratorGiven a pixel iterator defining access to pixels along a row, returns the types of the corresponding built-in step_iterator, xy_locator, image_view + Cview_is_basicBasic views must be over basic locators + Cview_is_mutableDetermines if the given view is mutable (i.e. its pixels can be changed) + Cview_is_step_in_xDetermines if the given view has a horizontal step that could be set dynamically + Cview_is_step_in_yDetermines if the given view has a vertical step that could be set dynamically + Cview_typeReturns 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_pixelReturns the type of a view the pixel type, whether it operates on planar data and whether it has a step horizontally + Cviews_are_compatibleReturns whether two views are compatible + CViewsCompatibleConceptViews are compatible if they have the same color spaces and compatible channel values + Cvirtual_2d_locatorA 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept + Cyellow_tYellow
    @@ -330,7 +333,7 @@ diff --git a/develop/doc/html/reference/any__image_8hpp_source.html b/develop/doc/html/reference/any__image_8hpp_source.html index fc2d20dbc..13d62cedc 100644 --- a/develop/doc/html/reference/any__image_8hpp_source.html +++ b/develop/doc/html/reference/any__image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: any_image.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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 #include <boost/gil/extension/dynamic_image/apply_operation.hpp>
    14 
    15 #include <boost/gil/image.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 
    18 #include <boost/config.hpp>
    19 #include <boost/variant2/variant.hpp>
    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 boost { namespace gil {
    27 
    28 namespace detail {
    29 
    30 template <typename T>
    31 using get_view_t = typename T::view_t;
    32 
    33 template <typename Images>
    34 using images_get_views_t = mp11::mp_transform<get_view_t, Images>;
    35 
    36 template <typename T>
    37 using get_const_view_t = typename T::const_view_t;
    38 
    39 template <typename Images>
    40 using images_get_const_views_t = mp11::mp_transform<get_const_view_t, Images>;
    41 
    42 struct recreate_image_fnobj
    43 {
    44  using result_type = void;
    45  point<std::ptrdiff_t> const& _dimensions;
    46  unsigned _alignment;
    47 
    48  recreate_image_fnobj(point<std::ptrdiff_t> const& dims, unsigned alignment)
    49  : _dimensions(dims), _alignment(alignment)
    50  {}
    51 
    52  template <typename Image>
    53  result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
    54 };
    55 
    56 template <typename AnyView> // Models AnyViewConcept
    57 struct any_image_get_view
    58 {
    59  using result_type = AnyView;
    60  template <typename Image>
    61  result_type operator()(Image& img) const
    62  {
    63  return result_type(view(img));
    64  }
    65 };
    66 
    67 template <typename AnyConstView> // Models AnyConstViewConcept
    68 struct any_image_get_const_view
    69 {
    70  using result_type = AnyConstView;
    71  template <typename Image>
    72  result_type operator()(Image const& img) const { return result_type{const_view(img)}; }
    73 };
    74 
    75 } // namespce detail
    76 
    87 
    88 template <typename ...Images>
    89 class any_image : public variant2::variant<Images...>
    90 {
    91  using parent_t = variant2::variant<Images...>;
    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  any_image() = default;
    100  any_image(any_image const& img) : parent_t((parent_t const&)img) {}
    101 
    102  template <typename Image>
    103  explicit any_image(Image const& img) : parent_t(img) {}
    104 
    105  template <typename Image>
    106  any_image(Image&& img) : parent_t(std::move(img)) {}
    107 
    108  template <typename Image>
    109  explicit any_image(Image& img, bool do_swap) : parent_t(img, do_swap) {}
    110 
    111  template <typename ...OtherImages>
    113  : parent_t((variant2::variant<OtherImages...> const&)img)
    114  {}
    115 
    116  any_image& operator=(any_image const& img)
    117  {
    118  parent_t::operator=((parent_t const&)img);
    119  return *this;
    120  }
    121 
    122  template <typename Image>
    123  any_image& operator=(Image const& img)
    124  {
    125  parent_t::operator=(img);
    126  return *this;
    127  }
    128 
    129  template <typename ...OtherImages>
    130  any_image& operator=(any_image<OtherImages...> const& img)
    131  {
    132  parent_t::operator=((typename variant2::variant<OtherImages...> const&)img);
    133  return *this;
    134  }
    135 
    136  void recreate(const point_t& dims, unsigned alignment=1)
    137  {
    138  apply_operation(*this, detail::recreate_image_fnobj(dims, alignment));
    139  }
    140 
    141  void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1)
    142  {
    143  recreate({ width, height }, alignment);
    144  }
    145 
    146  std::size_t num_channels() const
    147  {
    148  return apply_operation(*this, detail::any_type_get_num_channels());
    149  }
    150 
    151  point_t dimensions() const
    152  {
    153  return apply_operation(*this, detail::any_type_get_dimensions());
    154  }
    155 
    156  x_coord_t width() const { return dimensions().x; }
    157  y_coord_t height() const { return dimensions().y; }
    158 };
    159 
    163 
    165 
    168 template <typename ...Images>
    169 BOOST_FORCEINLINE
    170 auto view(any_image<Images...>& img) -> typename any_image<Images...>::view_t
    171 {
    172  using view_t = typename any_image<Images...>::view_t;
    173  return apply_operation(img, detail::any_image_get_view<view_t>());
    174 }
    175 
    178 template <typename ...Images>
    179 BOOST_FORCEINLINE
    180 auto const_view(any_image<Images...> const& img) -> typename any_image<Images...>::const_view_t
    181 {
    182  using view_t = typename any_image<Images...>::const_view_t;
    183  return apply_operation(img, detail::any_image_get_const_view<view_t>());
    184 }
    186 
    187 }} // namespace boost::gil
    188 
    189 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    190 #pragma warning(pop)
    191 #endif
    192 
    193 #endif
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    -
    Definition: algorithm.hpp:30
    -
    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:170
    -
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    -
    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:180
    - +
    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 #include <boost/gil/extension/dynamic_image/apply_operation.hpp>
    +
    14 
    +
    15 #include <boost/gil/image.hpp>
    +
    16 #include <boost/gil/detail/mp11.hpp>
    +
    17 
    +
    18 #include <boost/config.hpp>
    +
    19 #include <boost/variant2/variant.hpp>
    +
    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 boost { namespace gil {
    +
    27 
    +
    28 namespace detail {
    +
    29 
    +
    30 template <typename T>
    +
    31 using get_view_t = typename T::view_t;
    +
    32 
    +
    33 template <typename Images>
    +
    34 using images_get_views_t = mp11::mp_transform<get_view_t, Images>;
    +
    35 
    +
    36 template <typename T>
    +
    37 using get_const_view_t = typename T::const_view_t;
    +
    38 
    +
    39 template <typename Images>
    +
    40 using images_get_const_views_t = mp11::mp_transform<get_const_view_t, Images>;
    +
    41 
    +
    42 struct recreate_image_fnobj
    +
    43 {
    +
    44  using result_type = void;
    +
    45  point<std::ptrdiff_t> const& _dimensions;
    +
    46  unsigned _alignment;
    +
    47 
    +
    48  recreate_image_fnobj(point<std::ptrdiff_t> const& dims, unsigned alignment)
    +
    49  : _dimensions(dims), _alignment(alignment)
    +
    50  {}
    +
    51 
    +
    52  template <typename Image>
    +
    53  result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
    +
    54 };
    +
    55 
    +
    56 template <typename AnyView> // Models AnyViewConcept
    +
    57 struct any_image_get_view
    +
    58 {
    +
    59  using result_type = AnyView;
    +
    60  template <typename Image>
    +
    61  result_type operator()(Image& img) const
    +
    62  {
    +
    63  return result_type(view(img));
    +
    64  }
    +
    65 };
    +
    66 
    +
    67 template <typename AnyConstView> // Models AnyConstViewConcept
    +
    68 struct any_image_get_const_view
    +
    69 {
    +
    70  using result_type = AnyConstView;
    +
    71  template <typename Image>
    +
    72  result_type operator()(Image const& img) const { return result_type{const_view(img)}; }
    +
    73 };
    +
    74 
    +
    75 } // namespce detail
    +
    76 
    +
    87 
    +
    88 template <typename ...Images>
    +
    89 class any_image : public variant2::variant<Images...>
    +
    90 {
    +
    91  using parent_t = variant2::variant<Images...>;
    +
    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  any_image() = default;
    +
    100  any_image(any_image const& img) : parent_t((parent_t const&)img) {}
    +
    101 
    +
    102  template <typename Image>
    +
    103  explicit any_image(Image const& img) : parent_t(img) {}
    +
    104 
    +
    105  template <typename Image>
    +
    106  any_image(Image&& img) : parent_t(std::move(img)) {}
    +
    107 
    +
    108  template <typename Image>
    +
    109  explicit any_image(Image& img, bool do_swap) : parent_t(img, do_swap) {}
    +
    110 
    +
    111  template <typename ...OtherImages>
    + +
    113  : parent_t((variant2::variant<OtherImages...> const&)img)
    +
    114  {}
    +
    115 
    +
    116  any_image& operator=(any_image const& img)
    +
    117  {
    +
    118  parent_t::operator=((parent_t const&)img);
    +
    119  return *this;
    +
    120  }
    +
    121 
    +
    122  template <typename Image>
    +
    123  any_image& operator=(Image const& img)
    +
    124  {
    +
    125  parent_t::operator=(img);
    +
    126  return *this;
    +
    127  }
    +
    128 
    +
    129  template <typename ...OtherImages>
    +
    130  any_image& operator=(any_image<OtherImages...> const& img)
    +
    131  {
    +
    132  parent_t::operator=((typename variant2::variant<OtherImages...> const&)img);
    +
    133  return *this;
    +
    134  }
    +
    135 
    +
    136  void recreate(const point_t& dims, unsigned alignment=1)
    +
    137  {
    +
    138  apply_operation(*this, detail::recreate_image_fnobj(dims, alignment));
    +
    139  }
    +
    140 
    +
    141  void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1)
    +
    142  {
    +
    143  recreate({ width, height }, alignment);
    +
    144  }
    +
    145 
    +
    146  std::size_t num_channels() const
    +
    147  {
    +
    148  return apply_operation(*this, detail::any_type_get_num_channels());
    +
    149  }
    +
    150 
    +
    151  point_t dimensions() const
    +
    152  {
    +
    153  return apply_operation(*this, detail::any_type_get_dimensions());
    +
    154  }
    +
    155 
    +
    156  x_coord_t width() const { return dimensions().x; }
    +
    157  y_coord_t height() const { return dimensions().y; }
    +
    158 };
    +
    159 
    +
    163 
    +
    165 
    +
    168 template <typename ...Images>
    +
    169 BOOST_FORCEINLINE
    +
    170 auto view(any_image<Images...>& img) -> typename any_image<Images...>::view_t
    +
    171 {
    +
    172  using view_t = typename any_image<Images...>::view_t;
    +
    173  return apply_operation(img, detail::any_image_get_view<view_t>());
    +
    174 }
    +
    175 
    +
    178 template <typename ...Images>
    +
    179 BOOST_FORCEINLINE
    +
    180 auto const_view(any_image<Images...> const& img) -> typename any_image<Images...>::const_view_t
    +
    181 {
    +
    182  using view_t = typename any_image<Images...>::const_view_t;
    +
    183  return apply_operation(img, detail::any_image_get_const_view<view_t>());
    +
    184 }
    +
    186 
    +
    187 }} // namespace boost::gil
    +
    188 
    +
    189 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    +
    190 #pragma warning(pop)
    +
    191 #endif
    +
    192 
    +
    193 #endif
    +
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    +
    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:180
    + +
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    +
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    +
    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:170
    diff --git a/develop/doc/html/reference/any__image__view_8hpp_source.html b/develop/doc/html/reference/any__image__view_8hpp_source.html index a80f822e7..e42ccae6f 100644 --- a/develop/doc/html/reference/any__image__view_8hpp_source.html +++ b/develop/doc/html/reference/any__image__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: any_image_view.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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_ANY_IMAGE_VIEW_HPP
    9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP
    10 
    11 #include <boost/gil/dynamic_step.hpp>
    12 #include <boost/gil/image.hpp>
    13 #include <boost/gil/image_view.hpp>
    14 #include <boost/gil/point.hpp>
    15 #include <boost/gil/detail/mp11.hpp>
    16 
    17 #include <boost/variant2/variant.hpp>
    18 
    19 namespace boost { namespace gil {
    20 
    21 template <typename View>
    22 struct dynamic_xy_step_transposed_type;
    23 
    24 namespace detail {
    25 
    26 template <typename View>
    27 struct get_const_t { using type = typename View::const_t; };
    28 
    29 template <typename Views>
    30 struct views_get_const_t : mp11::mp_transform<get_const_t, Views> {};
    31 
    32 // works for both image_view and image
    33 struct any_type_get_num_channels
    34 {
    35  using result_type = int;
    36  template <typename T>
    37  result_type operator()(const T&) const { return num_channels<T>::value; }
    38 };
    39 
    40 // works for both image_view and image
    41 struct any_type_get_dimensions
    42 {
    43  using result_type = point<std::ptrdiff_t>;
    44  template <typename T>
    45  result_type operator()(const T& v) const { return v.dimensions(); }
    46 };
    47 
    48 // works for image_view
    49 struct any_type_get_size
    50 {
    51  using result_type = std::size_t;
    52  template <typename T>
    53  result_type operator()(const T& v) const { return v.size(); }
    54 };
    55 
    56 } // namespace detail
    57 
    72 
    73 template <typename ...Views>
    74 class any_image_view : public variant2::variant<Views...>
    75 {
    76  using parent_t = variant2::variant<Views...>;
    77 
    78 public:
    79  using const_t = detail::views_get_const_t<any_image_view>;
    80  using x_coord_t = std::ptrdiff_t;
    81  using y_coord_t = std::ptrdiff_t;
    83  using size_type = std::size_t;
    84 
    85  any_image_view() = default;
    86  any_image_view(any_image_view const& view) : parent_t((parent_t const&)view) {}
    87 
    88  template <typename View>
    89  explicit any_image_view(View const& view) : parent_t(view) {}
    90 
    91  template <typename ...OtherViews>
    93  : parent_t((variant2::variant<OtherViews...> const&)view)
    94  {}
    95 
    96  any_image_view& operator=(any_image_view const& view)
    97  {
    98  parent_t::operator=((parent_t const&)view);
    99  return *this;
    100  }
    101 
    102  template <typename View>
    103  any_image_view& operator=(View const& view)
    104  {
    105  parent_t::operator=(view);
    106  return *this;
    107  }
    108 
    109  template <typename ...OtherViews>
    110  any_image_view& operator=(any_image_view<OtherViews...> const& view)
    111  {
    112  parent_t::operator=((variant2::variant<OtherViews...> const&)view);
    113  return *this;
    114  }
    115 
    116  std::size_t num_channels() const { return apply_operation(*this, detail::any_type_get_num_channels()); }
    117  point_t dimensions() const { return apply_operation(*this, detail::any_type_get_dimensions()); }
    118  size_type size() const { return apply_operation(*this, detail::any_type_get_size()); }
    119  x_coord_t width() const { return dimensions().x; }
    120  y_coord_t height() const { return dimensions().y; }
    121 };
    122 
    124 // HasDynamicXStepTypeConcept
    126 
    127 template <typename ...Views>
    128 struct dynamic_x_step_type<any_image_view<Views...>>
    129 {
    130 private:
    131  // FIXME: Remove class name injection with gil:: qualification
    132  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    133  // in the class definition of the same name as the specialization (Peter Dimov):
    134  // invalid template argument for template parameter 'F', expected a class template
    135  template <typename T>
    136  using dynamic_step_view = typename gil::dynamic_x_step_type<T>::type;
    137 
    138 public:
    139  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    140 };
    141 
    143 // HasDynamicYStepTypeConcept
    145 
    146 template <typename ...Views>
    147 struct dynamic_y_step_type<any_image_view<Views...>>
    148 {
    149 private:
    150  // FIXME: Remove class name injection with gil:: qualification
    151  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    152  // in the class definition of the same name as the specialization (Peter Dimov):
    153  // invalid template argument for template parameter 'F', expected a class template
    154  template <typename T>
    155  using dynamic_step_view = typename gil::dynamic_y_step_type<T>::type;
    156 
    157 public:
    158  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    159 };
    160 
    161 template <typename ...Views>
    162 struct dynamic_xy_step_type<any_image_view<Views...>>
    163 {
    164 private:
    165  // FIXME: Remove class name injection with gil:: qualification
    166  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    167  // in the class definition of the same name as the specialization (Peter Dimov):
    168  // invalid template argument for template parameter 'F', expected a class template
    169  template <typename T>
    170  using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
    171 
    172 public:
    173  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    174 };
    175 
    176 template <typename ...Views>
    177 struct dynamic_xy_step_transposed_type<any_image_view<Views...>>
    178 {
    179 private:
    180  // FIXME: Remove class name injection with gil:: qualification
    181  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    182  // in the class definition of the same name as the specialization (Peter Dimov):
    183  // invalid template argument for template parameter 'F', expected a class template
    184  template <typename T>
    185  using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
    186 
    187 public:
    188  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    189 };
    190 
    191 }} // namespace boost::gil
    192 
    193 #endif
    Returns the type of a transposed view that has a dynamic step along both X and Y. ...
    Definition: image_view_factory.hpp:51
    -
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    -
    Definition: algorithm.hpp:30
    -
    Returns the type of a view that has a dynamic step along both X and Y.
    Definition: dynamic_step.hpp:27
    -
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    - -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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_ANY_IMAGE_VIEW_HPP
    +
    9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP
    +
    10 
    +
    11 #include <boost/gil/dynamic_step.hpp>
    +
    12 #include <boost/gil/image.hpp>
    +
    13 #include <boost/gil/image_view.hpp>
    +
    14 #include <boost/gil/point.hpp>
    +
    15 #include <boost/gil/detail/mp11.hpp>
    +
    16 
    +
    17 #include <boost/variant2/variant.hpp>
    +
    18 
    +
    19 namespace boost { namespace gil {
    +
    20 
    +
    21 template <typename View>
    +
    22 struct dynamic_xy_step_transposed_type;
    +
    23 
    +
    24 namespace detail {
    +
    25 
    +
    26 template <typename View>
    +
    27 struct get_const_t { using type = typename View::const_t; };
    +
    28 
    +
    29 template <typename Views>
    +
    30 struct views_get_const_t : mp11::mp_transform<get_const_t, Views> {};
    +
    31 
    +
    32 // works for both image_view and image
    +
    33 struct any_type_get_num_channels
    +
    34 {
    +
    35  using result_type = int;
    +
    36  template <typename T>
    +
    37  result_type operator()(const T&) const { return num_channels<T>::value; }
    +
    38 };
    +
    39 
    +
    40 // works for both image_view and image
    +
    41 struct any_type_get_dimensions
    +
    42 {
    +
    43  using result_type = point<std::ptrdiff_t>;
    +
    44  template <typename T>
    +
    45  result_type operator()(const T& v) const { return v.dimensions(); }
    +
    46 };
    +
    47 
    +
    48 // works for image_view
    +
    49 struct any_type_get_size
    +
    50 {
    +
    51  using result_type = std::size_t;
    +
    52  template <typename T>
    +
    53  result_type operator()(const T& v) const { return v.size(); }
    +
    54 };
    +
    55 
    +
    56 } // namespace detail
    +
    57 
    +
    72 
    +
    73 template <typename ...Views>
    +
    74 class any_image_view : public variant2::variant<Views...>
    +
    75 {
    +
    76  using parent_t = variant2::variant<Views...>;
    +
    77 
    +
    78 public:
    +
    79  using const_t = detail::views_get_const_t<any_image_view>;
    +
    80  using x_coord_t = std::ptrdiff_t;
    +
    81  using y_coord_t = std::ptrdiff_t;
    + +
    83  using size_type = std::size_t;
    +
    84 
    +
    85  any_image_view() = default;
    +
    86  any_image_view(any_image_view const& view) : parent_t((parent_t const&)view) {}
    +
    87 
    +
    88  template <typename View>
    +
    89  explicit any_image_view(View const& view) : parent_t(view) {}
    +
    90 
    +
    91  template <typename ...OtherViews>
    + +
    93  : parent_t((variant2::variant<OtherViews...> const&)view)
    +
    94  {}
    +
    95 
    +
    96  any_image_view& operator=(any_image_view const& view)
    +
    97  {
    +
    98  parent_t::operator=((parent_t const&)view);
    +
    99  return *this;
    +
    100  }
    +
    101 
    +
    102  template <typename View>
    +
    103  any_image_view& operator=(View const& view)
    +
    104  {
    +
    105  parent_t::operator=(view);
    +
    106  return *this;
    +
    107  }
    +
    108 
    +
    109  template <typename ...OtherViews>
    + +
    111  {
    +
    112  parent_t::operator=((variant2::variant<OtherViews...> const&)view);
    +
    113  return *this;
    +
    114  }
    +
    115 
    +
    116  std::size_t num_channels() const { return apply_operation(*this, detail::any_type_get_num_channels()); }
    +
    117  point_t dimensions() const { return apply_operation(*this, detail::any_type_get_dimensions()); }
    +
    118  size_type size() const { return apply_operation(*this, detail::any_type_get_size()); }
    +
    119  x_coord_t width() const { return dimensions().x; }
    +
    120  y_coord_t height() const { return dimensions().y; }
    +
    121 };
    +
    122 
    +
    124 // HasDynamicXStepTypeConcept
    +
    126 
    +
    127 template <typename ...Views>
    +
    128 struct dynamic_x_step_type<any_image_view<Views...>>
    +
    129 {
    +
    130 private:
    +
    131  // FIXME: Remove class name injection with gil:: qualification
    +
    132  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    +
    133  // in the class definition of the same name as the specialization (Peter Dimov):
    +
    134  // invalid template argument for template parameter 'F', expected a class template
    +
    135  template <typename T>
    +
    136  using dynamic_step_view = typename gil::dynamic_x_step_type<T>::type;
    +
    137 
    +
    138 public:
    +
    139  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    +
    140 };
    +
    141 
    +
    143 // HasDynamicYStepTypeConcept
    +
    145 
    +
    146 template <typename ...Views>
    +
    147 struct dynamic_y_step_type<any_image_view<Views...>>
    +
    148 {
    +
    149 private:
    +
    150  // FIXME: Remove class name injection with gil:: qualification
    +
    151  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    +
    152  // in the class definition of the same name as the specialization (Peter Dimov):
    +
    153  // invalid template argument for template parameter 'F', expected a class template
    +
    154  template <typename T>
    +
    155  using dynamic_step_view = typename gil::dynamic_y_step_type<T>::type;
    +
    156 
    +
    157 public:
    +
    158  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    +
    159 };
    +
    160 
    +
    161 template <typename ...Views>
    +
    162 struct dynamic_xy_step_type<any_image_view<Views...>>
    +
    163 {
    +
    164 private:
    +
    165  // FIXME: Remove class name injection with gil:: qualification
    +
    166  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    +
    167  // in the class definition of the same name as the specialization (Peter Dimov):
    +
    168  // invalid template argument for template parameter 'F', expected a class template
    +
    169  template <typename T>
    +
    170  using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
    +
    171 
    +
    172 public:
    +
    173  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    +
    174 };
    +
    175 
    +
    176 template <typename ...Views>
    +
    177 struct dynamic_xy_step_transposed_type<any_image_view<Views...>>
    +
    178 {
    +
    179 private:
    +
    180  // FIXME: Remove class name injection with gil:: qualification
    +
    181  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
    +
    182  // in the class definition of the same name as the specialization (Peter Dimov):
    +
    183  // invalid template argument for template parameter 'F', expected a class template
    +
    184  template <typename T>
    +
    185  using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
    +
    186 
    +
    187 public:
    +
    188  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
    +
    189 };
    +
    190 
    +
    191 }} // namespace boost::gil
    +
    192 
    +
    193 #endif
    +
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    +
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    + +
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    +
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    +
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    +
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    diff --git a/develop/doc/html/reference/apply__operation_8hpp_source.html b/develop/doc/html/reference/apply__operation_8hpp_source.html index df9d85322..c67f27070 100644 --- a/develop/doc/html/reference/apply__operation_8hpp_source.html +++ b/develop/doc/html/reference/apply__operation_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: apply_operation.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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 BOOST_FORCEINLINE
    19 auto apply_operation(Variant1&& arg1, Visitor&& op)
    20 #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
    21  -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1)))
    22 #endif
    23 {
    24  return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1));
    25 }
    26 
    29 template <typename Variant1, typename Variant2, typename Visitor>
    30 BOOST_FORCEINLINE
    31 auto apply_operation(Variant1&& arg1, Variant2&& arg2, Visitor&& op)
    32 #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
    33  -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2)))
    34 #endif
    35 {
    36  return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2));
    37 }
    38 
    39 }} // namespace boost::gil
    40 
    41 #endif
    Definition: algorithm.hpp:30
    -
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Variant2 &&arg2, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:31
    +
    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 BOOST_FORCEINLINE
    +
    19 auto apply_operation(Variant1&& arg1, Visitor&& op)
    +
    20 #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
    +
    21  -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1)))
    +
    22 #endif
    +
    23 {
    +
    24  return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1));
    +
    25 }
    +
    26 
    +
    29 template <typename Variant1, typename Variant2, typename Visitor>
    +
    30 BOOST_FORCEINLINE
    +
    31 auto apply_operation(Variant1&& arg1, Variant2&& arg2, Visitor&& op)
    +
    32 #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
    +
    33  -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2)))
    +
    34 #endif
    +
    35 {
    +
    36  return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2));
    +
    37 }
    +
    38 
    +
    39 }} // namespace boost::gil
    +
    40 
    +
    41 #endif
    +
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Variant2 &&arg2, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:31
    diff --git a/develop/doc/html/reference/arrowdown.png b/develop/doc/html/reference/arrowdown.png deleted file mode 100644 index 0b63f6d38..000000000 Binary files a/develop/doc/html/reference/arrowdown.png and /dev/null differ diff --git a/develop/doc/html/reference/arrowright.png b/develop/doc/html/reference/arrowright.png deleted file mode 100644 index c6ee22f93..000000000 Binary files a/develop/doc/html/reference/arrowright.png and /dev/null differ diff --git a/develop/doc/html/reference/base_8hpp_source.html b/develop/doc/html/reference/base_8hpp_source.html index e4b11613c..ba88b9464 100644 --- a/develop/doc/html/reference/base_8hpp_source.html +++ b/develop/doc/html/reference/base_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: base.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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( const point_t& top_left
    48  , const point_t& dim
    49  )
    50  : _top_left( top_left )
    51  , _dim ( dim )
    52  {}
    53 
    54 
    55 public:
    56 
    57  void set( const point_t& top_left
    58  , const point_t& 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
    Definition: algorithm.hpp:30
    -
    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 
    +
    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( const point_t& top_left
    +
    48  , const point_t& dim
    +
    49  )
    +
    50  : _top_left( top_left )
    +
    51  , _dim ( dim )
    +
    52  {}
    +
    53 
    +
    54 
    +
    55 public:
    +
    56 
    +
    57  void set( const point_t& top_left
    +
    58  , const point_t& 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
    +
    Definition: base.hpp:78
    diff --git a/develop/doc/html/reference/basic_8hpp_source.html b/develop/doc/html/reference/basic_8hpp_source.html index 5e38ed8c5..48a2536b1 100644 --- a/develop/doc/html/reference/basic_8hpp_source.html +++ b/develop/doc/html/reference/basic_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: basic.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Concept of == and != comparability requirement.
    Definition: basic.hpp:100
    -
    Concept of types equivalence requirement.
    Definition: basic.hpp:178
    -
    Concept of copy construction requirement.
    Definition: basic.hpp:62
    -
    Definition: algorithm.hpp:30
    -
    Concept of swap operation requirement.
    Definition: basic.hpp:118
    -
    Concept of default construction requirement.
    Definition: basic.hpp:43
    -
    Concept for type as metafunction requirement.
    Definition: basic.hpp:163
    -
    Concept of copy assignment requirement.
    Definition: basic.hpp:81
    -
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    -
    Concept for type regularity requirement.
    Definition: basic.hpp:141
    +
    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
    +
    Concept of swap operation requirement.
    Definition: basic.hpp:118
    +
    Concept for type regularity requirement.
    Definition: basic.hpp:141
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    Concept of default construction requirement.
    Definition: basic.hpp:43
    +
    Concept of copy assignment requirement.
    Definition: basic.hpp:81
    +
    Concept of == and != comparability requirement.
    Definition: basic.hpp:100
    +
    Concept for type as metafunction requirement.
    Definition: basic.hpp:163
    +
    Concept of types equivalence requirement.
    Definition: basic.hpp:178
    +
    Concept of copy construction requirement.
    Definition: basic.hpp:62
    diff --git a/develop/doc/html/reference/bit__aligned__pixel__iterator_8hpp_source.html b/develop/doc/html/reference/bit__aligned__pixel__iterator_8hpp_source.html index 3c614df8d..c94718369 100644 --- a/develop/doc/html/reference/bit__aligned__pixel__iterator_8hpp_source.html +++ b/develop/doc/html/reference/bit__aligned__pixel__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_iterator.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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  reference operator[](difference_type d) const { bit_aligned_pixel_iterator it=*this; it.advance(d); return *it; }
    67 
    68  reference operator->() const { return **this; }
    69  const bit_range_t& bit_range() const { return _bit_range; }
    70  bit_range_t& bit_range() { 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  reference dereference() const { 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  difference_type distance_to(const bit_aligned_pixel_iterator& it) const { 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 =
    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 std::ptrdiff_t memunit_step(const bit_aligned_pixel_iterator<NonAlignedPixelReference>&) {
    126  return NonAlignedPixelReference::bit_size;
    127 }
    128 
    129 template <typename NonAlignedPixelReference>
    130 inline std::ptrdiff_t memunit_distance(const bit_aligned_pixel_iterator<NonAlignedPixelReference>& p1, const bit_aligned_pixel_iterator<NonAlignedPixelReference>& p2) {
    131  return (p2.bit_range().current_byte() - p1.bit_range().current_byte())*8 + p2.bit_range().bit_offset() - p1.bit_range().bit_offset();
    132 }
    133 
    134 template <typename NonAlignedPixelReference>
    135 inline void memunit_advance(bit_aligned_pixel_iterator<NonAlignedPixelReference>& p, std::ptrdiff_t diff) {
    136  p.bit_range().bit_advance(diff);
    137 }
    138 
    139 template <typename NonAlignedPixelReference>
    142  memunit_advance(ret, diff);
    143  return ret;
    144 }
    145 
    146 template <typename NonAlignedPixelReference> inline
    147 NonAlignedPixelReference memunit_advanced_ref(bit_aligned_pixel_iterator<NonAlignedPixelReference> it, std::ptrdiff_t diff) {
    148  return *memunit_advanced(it,diff);
    149 }
    151 // HasDynamicXStepTypeConcept
    153 
    154 template <typename NonAlignedPixelReference>
    155 struct dynamic_x_step_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > {
    157 };
    158 
    160 // iterator_type_from_pixel
    162 
    163 template <typename B, typename C, typename L, bool M>
    164 struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,false>
    165 {
    167 };
    168 
    169 template <typename B, typename C, typename L, bool M>
    170 struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,true>
    171 {
    173 };
    174 
    175 template <typename B, typename C, typename L, bool M, bool IsPlanar, bool IsStep, bool IsMutable>
    176 struct iterator_type_from_pixel<bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable>
    177  : public iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable> {};
    178 
    179 } } // namespace boost::gil
    180 
    181 namespace std {
    182 
    183 // It is important to provide an overload of uninitialized_copy for bit_aligned_pixel_iterator. The default STL implementation calls placement new,
    184 // which is not defined for bit_aligned_pixel_iterator.
    185 template <typename NonAlignedPixelReference>
    189  return std::copy(first,last,dst);
    190 }
    191 
    192 } // namespace std
    193 #endif
    Definition: pixel_iterator.hpp:124
    -
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:34
    -
    An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
    Definition: bit_aligned_pixel_iterator.hpp:37
    -
    Definition: algorithm.hpp:30
    -
    Definition: algorithm.hpp:133
    -
    reference operator[](difference_type d) const
    Definition: bit_aligned_pixel_iterator.hpp:66
    -
    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:1029
    -
    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:139
    -
    Metafunction predicate returning whether the given iterator allows for changing its values...
    Definition: pixel_iterator.hpp:49
    -
    Returns the type of an iterator just like the input iterator, except operating over immutable values...
    Definition: pixel_iterator.hpp:40
    -
    Returns the type of a pixel iterator given the pixel type, whether it operates on planar data...
    Definition: metafunctions.hpp:274
    -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    -
    MEMORY-BASED STEP ITERATOR.
    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_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  reference operator[](difference_type d) const { bit_aligned_pixel_iterator it=*this; it.advance(d); return *it; }
    +
    67 
    +
    68  reference operator->() const { return **this; }
    +
    69  const bit_range_t& bit_range() const { return _bit_range; }
    +
    70  bit_range_t& bit_range() { 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  reference dereference() const { 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  difference_type distance_to(const bit_aligned_pixel_iterator& it) const { 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 std::ptrdiff_t memunit_step(const bit_aligned_pixel_iterator<NonAlignedPixelReference>&) {
    +
    126  return NonAlignedPixelReference::bit_size;
    +
    127 }
    +
    128 
    +
    129 template <typename NonAlignedPixelReference>
    +
    130 inline std::ptrdiff_t memunit_distance(const bit_aligned_pixel_iterator<NonAlignedPixelReference>& p1, const bit_aligned_pixel_iterator<NonAlignedPixelReference>& p2) {
    +
    131  return (p2.bit_range().current_byte() - p1.bit_range().current_byte())*8 + p2.bit_range().bit_offset() - p1.bit_range().bit_offset();
    +
    132 }
    +
    133 
    +
    134 template <typename NonAlignedPixelReference>
    +
    135 inline void memunit_advance(bit_aligned_pixel_iterator<NonAlignedPixelReference>& p, std::ptrdiff_t diff) {
    +
    136  p.bit_range().bit_advance(diff);
    +
    137 }
    +
    138 
    +
    139 template <typename NonAlignedPixelReference>
    +
    140 inline bit_aligned_pixel_iterator<NonAlignedPixelReference> memunit_advanced(const bit_aligned_pixel_iterator<NonAlignedPixelReference>& p, std::ptrdiff_t diff) {
    +
    141  bit_aligned_pixel_iterator<NonAlignedPixelReference> ret=p;
    +
    142  memunit_advance(ret, diff);
    +
    143  return ret;
    +
    144 }
    +
    145 
    +
    146 template <typename NonAlignedPixelReference> inline
    +
    147 NonAlignedPixelReference memunit_advanced_ref(bit_aligned_pixel_iterator<NonAlignedPixelReference> it, std::ptrdiff_t diff) {
    +
    148  return *memunit_advanced(it,diff);
    +
    149 }
    +
    151 // HasDynamicXStepTypeConcept
    +
    153 
    +
    154 template <typename NonAlignedPixelReference>
    +
    155 struct dynamic_x_step_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > {
    +
    156  using type = memory_based_step_iterator<bit_aligned_pixel_iterator<NonAlignedPixelReference> >;
    +
    157 };
    +
    158 
    +
    160 // iterator_type_from_pixel
    +
    162 
    +
    163 template <typename B, typename C, typename L, bool M>
    +
    164 struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,false>
    +
    165 {
    +
    166  using type = bit_aligned_pixel_iterator<bit_aligned_pixel_reference<B,C,L,false>> ;
    +
    167 };
    +
    168 
    +
    169 template <typename B, typename C, typename L, bool M>
    +
    170 struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,true>
    +
    171 {
    +
    172  using type = bit_aligned_pixel_iterator<bit_aligned_pixel_reference<B,C,L,true>>;
    +
    173 };
    +
    174 
    +
    175 template <typename B, typename C, typename L, bool M, bool IsPlanar, bool IsStep, bool IsMutable>
    +
    176 struct iterator_type_from_pixel<bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable>
    +
    177  : public iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable> {};
    +
    178 
    +
    179 } } // namespace boost::gil
    +
    180 
    +
    181 namespace std {
    +
    182 
    +
    183 // It is important to provide an overload of uninitialized_copy for bit_aligned_pixel_iterator. The default STL implementation calls placement new,
    +
    184 // which is not defined for bit_aligned_pixel_iterator.
    +
    185 template <typename NonAlignedPixelReference>
    + + + +
    189  return std::copy(first,last,dst);
    +
    190 }
    +
    191 
    +
    192 } // namespace std
    +
    193 #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:139
    +
    An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept,...
    Definition: bit_aligned_pixel_iterator.hpp:37
    +
    reference operator[](difference_type d) const
    Definition: bit_aligned_pixel_iterator.hpp:66
    +
    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:1076
    diff --git a/develop/doc/html/reference/bit__aligned__pixel__reference_8hpp_source.html b/develop/doc/html/reference/bit__aligned__pixel__reference_8hpp_source.html index 94e53770c..8fcb6f819 100644 --- a/develop/doc/html/reference/bit__aligned__pixel__reference_8hpp_source.html +++ b/develop/doc/html/reference/bit__aligned__pixel__reference_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_reference.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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(const bit_range& 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  bit_range& operator=(const bit_range& br) { _current_byte = br._current_byte; _bit_offset=br._bit_offset; return *this; }
    56  bool operator==(const bit_range& br) const { return _current_byte==br._current_byte && _bit_offset==br._bit_offset; }
    57 
    58  bit_range& operator++() {
    59  _current_byte += (_bit_offset+RangeSize) / 8;
    60  _bit_offset = (_bit_offset+RangeSize) % 8;
    61  return *this;
    62  }
    63  bit_range& operator--() { 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  difference_type bit_distance_to(const bit_range& b) const {
    75  return (b.current_byte() - current_byte())*8 + b.bit_offset()-bit_offset();
    76  }
    77  byte_t* current_byte() const { return _current_byte; }
    78  int bit_offset() const { return _bit_offset; }
    79 };
    80 
    114 template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable>
    115 struct bit_aligned_pixel_reference
    116 {
    117  static constexpr int bit_size =
    118  mp11::mp_fold
    119  <
    120  ChannelBitSizes,
    121  std::integral_constant<int, 0>,
    122  mp11::mp_plus
    123  >::value;
    124 
    125  using bit_range_t = boost::gil::bit_range<bit_size,IsMutable>;
    126  using bitfield_t = BitField;
    127  using data_ptr_t = mp11::mp_if_c<IsMutable, unsigned char*, const unsigned char*>;
    128 
    129  using layout_t = Layout;
    130 
    132  using reference = const bit_aligned_pixel_reference<BitField, ChannelBitSizes, Layout, IsMutable>;
    133  using const_reference = bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,false> const;
    134 
    135  static constexpr bool is_mutable = IsMutable;
    136 
    137  bit_aligned_pixel_reference(){}
    138  bit_aligned_pixel_reference(data_ptr_t data_ptr, int bit_offset) : _bit_range(data_ptr, bit_offset) {}
    139  explicit bit_aligned_pixel_reference(const bit_range_t& bit_range) : _bit_range(bit_range) {}
    140  template <bool IsMutable2> bit_aligned_pixel_reference(const bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,IsMutable2>& p) : _bit_range(p._bit_range) {}
    141 
    142  // Grayscale references can be constructed from the channel reference
    143  explicit bit_aligned_pixel_reference(typename kth_element_type<bit_aligned_pixel_reference,0>::type const channel0)
    144  : _bit_range(static_cast<data_ptr_t>(&channel0), channel0.first_bit())
    145  {
    146  static_assert(num_channels<bit_aligned_pixel_reference>::value == 1, "");
    147  }
    148 
    149  // Construct from another compatible pixel type
    150  bit_aligned_pixel_reference(bit_aligned_pixel_reference const& p)
    151  : _bit_range(p._bit_range) {}
    152 
    153  // TODO: Why p by non-const reference?
    154  template <typename BF, typename CR>
    155  bit_aligned_pixel_reference(packed_pixel<BF, CR, Layout>& p)
    156  : _bit_range(static_cast<data_ptr_t>(&gil::at_c<0>(p)), gil::at_c<0>(p).first_bit())
    157  {
    158  check_compatible<packed_pixel<BF, CR, Layout>>();
    159  }
    160 
    161  auto operator=(bit_aligned_pixel_reference const& p) const
    162  -> bit_aligned_pixel_reference const&
    163  {
    164  static_copy(p, *this);
    165  return *this;
    166  }
    167 
    168  template <typename P>
    169  auto operator=(P const& p) const -> bit_aligned_pixel_reference const&
    170  {
    171  assign(p, is_pixel<P>());
    172  return *this;
    173  }
    174 
    175  template <typename P>
    176  bool operator==(P const& p) const
    177  {
    178  return equal(p, is_pixel<P>());
    179  }
    180 
    181  template <typename P>
    182  bool operator!=(P const& p) const { return !(*this==p); }
    183 
    184  auto operator->() const -> bit_aligned_pixel_reference const* { return this; }
    185 
    186  bit_range_t const& bit_range() const { return _bit_range; }
    187 
    188 private:
    189  mutable bit_range_t _bit_range;
    190  template <typename B, typename C, typename L, bool M> friend struct bit_aligned_pixel_reference;
    191 
    192  template <typename Pixel> static void check_compatible() { gil_function_requires<PixelsCompatibleConcept<Pixel,bit_aligned_pixel_reference> >(); }
    193 
    194  template <typename Pixel>
    195  void assign(Pixel const& p, std::true_type) const
    196  {
    197  check_compatible<Pixel>();
    198  static_copy(p, *this);
    199  }
    200 
    201  template <typename Pixel>
    202  bool equal(Pixel const& p, std::true_type) const
    203  {
    204  check_compatible<Pixel>();
    205  return static_equal(*this, p);
    206  }
    207 
    208 private:
    209  static void check_gray()
    210  {
    211  static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
    212  }
    213 
    214  template <typename Channel>
    215  void assign(Channel const& channel, std::false_type) const
    216  {
    217  check_gray();
    218  gil::at_c<0>(*this) = channel;
    219  }
    220 
    221  template <typename Channel>
    222  bool equal (Channel const& channel, std::false_type) const
    223  {
    224  check_gray();
    225  return gil::at_c<0>(*this) == channel;
    226  }
    227 };
    228 
    230 // ColorBasedConcept
    232 
    233 template <typename BitField, typename ChannelBitSizes, typename L, bool IsMutable, int K>
    234 struct kth_element_type
    235 <
    236  bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>,
    237  K
    238 >
    239 {
    240  using type = packed_dynamic_channel_reference
    241  <
    242  BitField,
    243  mp11::mp_at_c<ChannelBitSizes, K>::value,
    244  IsMutable
    245  > const;
    246 };
    247 
    248 template <typename B, typename C, typename L, bool M, int K>
    249 struct kth_element_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
    250  : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
    251 
    252 template <typename B, typename C, typename L, bool M, int K>
    253 struct kth_element_const_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
    254  : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
    255 
    256 namespace detail {
    257 
    258 // returns sum of IntegralVector[0] ... IntegralVector[K-1]
    259 template <typename IntegralVector, int K>
    260 struct sum_k
    261  : mp11::mp_plus
    262  <
    263  sum_k<IntegralVector, K - 1>,
    264  typename mp11::mp_at_c<IntegralVector, K - 1>::type
    265  >
    266 {};
    267 
    268 template <typename IntegralVector>
    269 struct sum_k<IntegralVector, 0> : std::integral_constant<int, 0> {};
    270 
    271 } // namespace detail
    272 
    273 // at_c required by MutableColorBaseConcept
    274 template <int K, typename BitField, typename ChannelBitSizes, typename L, bool IsMutable>
    275 inline
    276 auto at_c(const bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>& p)
    277  -> typename kth_element_reference_type<bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>, K>::type
    278 {
    279  using pixel_t = bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>;
    280  using channel_t = typename kth_element_reference_type<pixel_t, K>::type;
    281  using bit_range_t = typename pixel_t::bit_range_t;
    282 
    283  bit_range_t bit_range(p.bit_range());
    284  bit_range.bit_advance(detail::sum_k<ChannelBitSizes, K>::value);
    285 
    286  return channel_t(bit_range.current_byte(), bit_range.bit_offset());
    287 }
    288 
    290 // PixelConcept
    292 
    294 template <typename B, typename C, typename L, bool M>
    295 struct is_pixel<bit_aligned_pixel_reference<B, C, L, M> > : std::true_type {};
    296 
    298 // PixelBasedConcept
    300 
    301 template <typename B, typename C, typename L, bool M>
    302 struct color_space_type<bit_aligned_pixel_reference<B, C, L, M>>
    303 {
    304  using type = typename L::color_space_t;
    305 };
    306 
    307 template <typename B, typename C, typename L, bool M>
    308 struct channel_mapping_type<bit_aligned_pixel_reference<B, C, L, M>>
    309 {
    310  using type = typename L::channel_mapping_t;
    311 };
    312 
    313 template <typename B, typename C, typename L, bool M>
    314 struct is_planar<bit_aligned_pixel_reference<B, C, L, M>> : std::false_type {};
    315 
    317 // pixel_reference_type
    319 
    320 // Constructs a homogeneous bit_aligned_pixel_reference given a channel reference
    321 template <typename BitField, int NumBits, typename Layout>
    323  <
    324  packed_dynamic_channel_reference<BitField, NumBits, false> const,
    325  Layout, false, false
    326  >
    327 {
    328 private:
    329  using channel_bit_sizes_t = mp11::mp_repeat
    330  <
    331  mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
    332  mp11::mp_size<typename Layout::color_space_t>
    333  >;
    334 
    335 public:
    336  using type =
    337  bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, false>;
    338 };
    339 
    340 // Same but for the mutable case. We cannot combine the mutable
    341 // and read-only cases because this triggers ambiguity
    342 template <typename BitField, int NumBits, typename Layout>
    344  <
    345  packed_dynamic_channel_reference<BitField, NumBits, true> const,
    346  Layout, false, true
    347  >
    348 {
    349 private:
    350  using channel_bit_sizes_t = mp11::mp_repeat
    351  <
    352  mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
    353  mp11::mp_size<typename Layout::color_space_t>
    354  >;
    355 
    356 public:
    357  using type = bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, true>;
    358 };
    359 
    360 } } // namespace boost::gil
    361 
    362 namespace std {
    363 
    364 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
    365 // swap with 'left bias':
    366 // - swap between proxy and anything
    367 // - swap between value type and proxy
    368 // - swap between proxy and proxy
    369 // Having three overloads allows us to swap between different (but compatible) models of PixelConcept
    370 
    371 template <typename B, typename C, typename L, typename R> inline
    372 void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, R& y) {
    373  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
    374 }
    375 
    376 
    377 template <typename B, typename C, typename L> inline
    378 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) {
    379  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
    380 }
    381 
    382 
    383 template <typename B, typename C, typename L> inline
    384 void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
    385  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
    386 }
    387 
    388 } // namespace std
    389 
    390 #endif
    Definition: algorithm.hpp:30
    -
    Definition: algorithm.hpp:133
    -
    Definition: bit_aligned_pixel_reference.hpp:34
    -
    Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
    Definition: metafunctions.hpp:266
    -
    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:1029
    -
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    -
    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:597
    -
    Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
    Definition: metafunctions.hpp:24
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    +
    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(const bit_range& 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  bit_range& operator=(const bit_range& br) { _current_byte = br._current_byte; _bit_offset=br._bit_offset; return *this; }
    +
    56  bool operator==(const bit_range& br) const { return _current_byte==br._current_byte && _bit_offset==br._bit_offset; }
    +
    57 
    +
    58  bit_range& operator++() {
    +
    59  _current_byte += (_bit_offset+RangeSize) / 8;
    +
    60  _bit_offset = (_bit_offset+RangeSize) % 8;
    +
    61  return *this;
    +
    62  }
    +
    63  bit_range& operator--() { 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  difference_type bit_distance_to(const bit_range& b) const {
    +
    75  return (b.current_byte() - current_byte())*8 + b.bit_offset()-bit_offset();
    +
    76  }
    +
    77  byte_t* current_byte() const { return _current_byte; }
    +
    78  int bit_offset() const { return _bit_offset; }
    +
    79 };
    +
    80 
    +
    114 template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable>
    +
    115 struct bit_aligned_pixel_reference
    +
    116 {
    +
    117  static constexpr int bit_size =
    +
    118  mp11::mp_fold
    +
    119  <
    +
    120  ChannelBitSizes,
    +
    121  std::integral_constant<int, 0>,
    +
    122  mp11::mp_plus
    +
    123  >::value;
    +
    124 
    +
    125  using bit_range_t = boost::gil::bit_range<bit_size,IsMutable>;
    +
    126  using bitfield_t = BitField;
    +
    127  using data_ptr_t = mp11::mp_if_c<IsMutable, unsigned char*, const unsigned char*>;
    +
    128 
    +
    129  using layout_t = Layout;
    +
    130 
    + +
    132  using reference = const bit_aligned_pixel_reference<BitField, ChannelBitSizes, Layout, IsMutable>;
    +
    133  using const_reference = bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,false> const;
    +
    134 
    +
    135  static constexpr bool is_mutable = IsMutable;
    +
    136 
    +
    137  bit_aligned_pixel_reference(){}
    +
    138  bit_aligned_pixel_reference(data_ptr_t data_ptr, int bit_offset) : _bit_range(data_ptr, bit_offset) {}
    +
    139  explicit bit_aligned_pixel_reference(const bit_range_t& bit_range) : _bit_range(bit_range) {}
    +
    140  template <bool IsMutable2> bit_aligned_pixel_reference(const bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,IsMutable2>& p) : _bit_range(p._bit_range) {}
    +
    141 
    +
    142  // Grayscale references can be constructed from the channel reference
    +
    143  explicit bit_aligned_pixel_reference(typename kth_element_type<bit_aligned_pixel_reference,0>::type const channel0)
    +
    144  : _bit_range(static_cast<data_ptr_t>(&channel0), channel0.first_bit())
    +
    145  {
    +
    146  static_assert(num_channels<bit_aligned_pixel_reference>::value == 1, "");
    +
    147  }
    +
    148 
    +
    149  // Construct from another compatible pixel type
    +
    150  bit_aligned_pixel_reference(bit_aligned_pixel_reference const& p)
    +
    151  : _bit_range(p._bit_range) {}
    +
    152 
    +
    153  // TODO: Why p by non-const reference?
    +
    154  template <typename BF, typename CR>
    +
    155  bit_aligned_pixel_reference(packed_pixel<BF, CR, Layout>& p)
    +
    156  : _bit_range(static_cast<data_ptr_t>(&gil::at_c<0>(p)), gil::at_c<0>(p).first_bit())
    +
    157  {
    +
    158  check_compatible<packed_pixel<BF, CR, Layout>>();
    +
    159  }
    +
    160 
    +
    161  auto operator=(bit_aligned_pixel_reference const& p) const
    +
    162  -> bit_aligned_pixel_reference const&
    +
    163  {
    +
    164  static_copy(p, *this);
    +
    165  return *this;
    +
    166  }
    +
    167 
    +
    168  template <typename P>
    +
    169  auto operator=(P const& p) const -> bit_aligned_pixel_reference const&
    +
    170  {
    +
    171  assign(p, is_pixel<P>());
    +
    172  return *this;
    +
    173  }
    +
    174 
    +
    175  template <typename P>
    +
    176  bool operator==(P const& p) const
    +
    177  {
    +
    178  return equal(p, is_pixel<P>());
    +
    179  }
    +
    180 
    +
    181  template <typename P>
    +
    182  bool operator!=(P const& p) const { return !(*this==p); }
    +
    183 
    +
    184  auto operator->() const -> bit_aligned_pixel_reference const* { return this; }
    +
    185 
    +
    186  bit_range_t const& bit_range() const { return _bit_range; }
    +
    187 
    +
    188 private:
    +
    189  mutable bit_range_t _bit_range;
    +
    190  template <typename B, typename C, typename L, bool M> friend struct bit_aligned_pixel_reference;
    +
    191 
    +
    192  template <typename Pixel> static void check_compatible() { gil_function_requires<PixelsCompatibleConcept<Pixel,bit_aligned_pixel_reference> >(); }
    +
    193 
    +
    194  template <typename Pixel>
    +
    195  void assign(Pixel const& p, std::true_type) const
    +
    196  {
    +
    197  check_compatible<Pixel>();
    +
    198  static_copy(p, *this);
    +
    199  }
    +
    200 
    +
    201  template <typename Pixel>
    +
    202  bool equal(Pixel const& p, std::true_type) const
    +
    203  {
    +
    204  check_compatible<Pixel>();
    +
    205  return static_equal(*this, p);
    +
    206  }
    +
    207 
    +
    208 private:
    +
    209  static void check_gray()
    +
    210  {
    +
    211  static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
    +
    212  }
    +
    213 
    +
    214  template <typename Channel>
    +
    215  void assign(Channel const& channel, std::false_type) const
    +
    216  {
    +
    217  check_gray();
    +
    218  gil::at_c<0>(*this) = channel;
    +
    219  }
    +
    220 
    +
    221  template <typename Channel>
    +
    222  bool equal (Channel const& channel, std::false_type) const
    +
    223  {
    +
    224  check_gray();
    +
    225  return gil::at_c<0>(*this) == channel;
    +
    226  }
    +
    227 };
    +
    228 
    +
    230 // ColorBasedConcept
    +
    232 
    +
    233 template <typename BitField, typename ChannelBitSizes, typename L, bool IsMutable, int K>
    +
    234 struct kth_element_type
    +
    235 <
    +
    236  bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>,
    +
    237  K
    +
    238 >
    +
    239 {
    +
    240  using type = packed_dynamic_channel_reference
    +
    241  <
    +
    242  BitField,
    +
    243  mp11::mp_at_c<ChannelBitSizes, K>::value,
    +
    244  IsMutable
    +
    245  > const;
    +
    246 };
    +
    247 
    +
    248 template <typename B, typename C, typename L, bool M, int K>
    +
    249 struct kth_element_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
    +
    250  : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
    +
    251 
    +
    252 template <typename B, typename C, typename L, bool M, int K>
    +
    253 struct kth_element_const_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
    +
    254  : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
    +
    255 
    +
    256 namespace detail {
    +
    257 
    +
    258 // returns sum of IntegralVector[0] ... IntegralVector[K-1]
    +
    259 template <typename IntegralVector, int K>
    +
    260 struct sum_k
    +
    261  : mp11::mp_plus
    +
    262  <
    +
    263  sum_k<IntegralVector, K - 1>,
    +
    264  typename mp11::mp_at_c<IntegralVector, K - 1>::type
    +
    265  >
    +
    266 {};
    +
    267 
    +
    268 template <typename IntegralVector>
    +
    269 struct sum_k<IntegralVector, 0> : std::integral_constant<int, 0> {};
    +
    270 
    +
    271 } // namespace detail
    +
    272 
    +
    273 // at_c required by MutableColorBaseConcept
    +
    274 template <int K, typename BitField, typename ChannelBitSizes, typename L, bool IsMutable>
    +
    275 inline
    +
    276 auto at_c(const bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>& p)
    +
    277  -> typename kth_element_reference_type<bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>, K>::type
    +
    278 {
    +
    279  using pixel_t = bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>;
    +
    280  using channel_t = typename kth_element_reference_type<pixel_t, K>::type;
    +
    281  using bit_range_t = typename pixel_t::bit_range_t;
    +
    282 
    +
    283  bit_range_t bit_range(p.bit_range());
    +
    284  bit_range.bit_advance(detail::sum_k<ChannelBitSizes, K>::value);
    +
    285 
    +
    286  return channel_t(bit_range.current_byte(), bit_range.bit_offset());
    +
    287 }
    +
    288 
    +
    290 // PixelConcept
    +
    292 
    +
    294 template <typename B, typename C, typename L, bool M>
    +
    295 struct is_pixel<bit_aligned_pixel_reference<B, C, L, M> > : std::true_type {};
    +
    296 
    +
    298 // PixelBasedConcept
    +
    300 
    +
    301 template <typename B, typename C, typename L, bool M>
    +
    302 struct color_space_type<bit_aligned_pixel_reference<B, C, L, M>>
    +
    303 {
    +
    304  using type = typename L::color_space_t;
    +
    305 };
    +
    306 
    +
    307 template <typename B, typename C, typename L, bool M>
    +
    308 struct channel_mapping_type<bit_aligned_pixel_reference<B, C, L, M>>
    +
    309 {
    +
    310  using type = typename L::channel_mapping_t;
    +
    311 };
    +
    312 
    +
    313 template <typename B, typename C, typename L, bool M>
    +
    314 struct is_planar<bit_aligned_pixel_reference<B, C, L, M>> : std::false_type {};
    +
    315 
    +
    317 // pixel_reference_type
    +
    319 
    +
    320 // Constructs a homogeneous bit_aligned_pixel_reference given a channel reference
    +
    321 template <typename BitField, int NumBits, typename Layout>
    +
    322 struct pixel_reference_type
    +
    323  <
    +
    324  packed_dynamic_channel_reference<BitField, NumBits, false> const,
    +
    325  Layout, false, false
    +
    326  >
    +
    327 {
    +
    328 private:
    +
    329  using channel_bit_sizes_t = mp11::mp_repeat
    +
    330  <
    +
    331  mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
    +
    332  mp11::mp_size<typename Layout::color_space_t>
    +
    333  >;
    +
    334 
    +
    335 public:
    +
    336  using type =
    +
    337  bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, false>;
    +
    338 };
    +
    339 
    +
    340 // Same but for the mutable case. We cannot combine the mutable
    +
    341 // and read-only cases because this triggers ambiguity
    +
    342 template <typename BitField, int NumBits, typename Layout>
    +
    343 struct pixel_reference_type
    +
    344  <
    +
    345  packed_dynamic_channel_reference<BitField, NumBits, true> const,
    +
    346  Layout, false, true
    +
    347  >
    +
    348 {
    +
    349 private:
    +
    350  using channel_bit_sizes_t = mp11::mp_repeat
    +
    351  <
    +
    352  mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
    +
    353  mp11::mp_size<typename Layout::color_space_t>
    +
    354  >;
    +
    355 
    +
    356 public:
    +
    357  using type = bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, true>;
    +
    358 };
    +
    359 
    +
    360 } } // namespace boost::gil
    +
    361 
    +
    362 namespace std {
    +
    363 
    +
    364 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
    +
    365 // swap with 'left bias':
    +
    366 // - swap between proxy and anything
    +
    367 // - swap between value type and proxy
    +
    368 // - swap between proxy and proxy
    +
    369 // Having three overloads allows us to swap between different (but compatible) models of PixelConcept
    +
    370 
    +
    371 template <typename B, typename C, typename L, typename R> inline
    +
    372 void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, R& y) {
    +
    373  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
    +
    374 }
    +
    375 
    +
    376 
    +
    377 template <typename B, typename C, typename L> inline
    +
    378 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) {
    +
    379  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
    +
    380 }
    +
    381 
    +
    382 
    +
    383 template <typename B, typename C, typename L> inline
    +
    384 void swap(const boost::gil::bit_aligned_pixel_reference<B,C,L,true> x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
    +
    385  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
    +
    386 }
    +
    387 
    +
    388 } // namespace std
    +
    389 
    +
    390 #endif
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
    Definition: metafunctions.hpp:24
    +
    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
    +
    Definition: bit_aligned_pixel_reference.hpp:34
    +
    BOOST_FORCEINLINE bool operator!=(const point< T > &p1, const point< T > &p2)
    Definition: point.hpp:137
    +
    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:1076
    +
    BOOST_FORCEINLINE bool operator==(const point< T > &p1, const point< T > &p2)
    Definition: point.hpp:129
    diff --git a/develop/doc/html/reference/bit__operations_8hpp_source.html b/develop/doc/html/reference/bit__operations_8hpp_source.html index d22023fcc..29713a1f1 100644 --- a/develop/doc/html/reference/bit__operations_8hpp_source.html +++ b/develop/doc/html/reference/bit__operations_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_operations.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    -
    Definition: algorithm.hpp:30
    -
    Definition: algorithm.hpp:133
    -
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    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
    +
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    diff --git a/develop/doc/html/reference/bmp_8hpp_source.html b/develop/doc/html/reference/bmp_8hpp_source.html index 8386370fc..0383ce23a 100644 --- a/develop/doc/html/reference/bmp_8hpp_source.html +++ b/develop/doc/html/reference/bmp_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bmp.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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/develop/doc/html/reference/channel_8hpp_source.html b/develop/doc/html/reference/channel_8hpp_source.html index 6df1c033e..0aeecb7c0 100644 --- a/develop/doc/html/reference/channel_8hpp_source.html +++ b/develop/doc/html/reference/channel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    23 #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  scoped_channel_value& operator++() { ++value_; return *this; }
    202  scoped_channel_value& operator--() { --value_; return *this; }
    203 
    204  scoped_channel_value operator++(int) { scoped_channel_value tmp=*this; this->operator++(); return tmp; }
    205  scoped_channel_value operator--(int) { scoped_channel_value tmp=*this; this->operator--(); return tmp; }
    206 
    207  template <typename Scalar2> scoped_channel_value& operator+=(Scalar2 v) { value_+=v; return *this; }
    208  template <typename Scalar2> scoped_channel_value& operator-=(Scalar2 v) { value_-=v; return *this; }
    209  template <typename Scalar2> scoped_channel_value& operator*=(Scalar2 v) { value_*=v; return *this; }
    210  template <typename Scalar2> scoped_channel_value& operator/=(Scalar2 v) { value_/=v; return *this; }
    211 
    212  operator BaseChannelValue() const { return value_; }
    213 private:
    214  BaseChannelValue value_{};
    215 };
    216 
    217 template <typename T>
    218 struct float_point_zero
    219 {
    220  static constexpr T apply() { return 0.0f; }
    221 };
    222 
    223 template <typename T>
    224 struct float_point_one
    225 {
    226  static constexpr T apply() { return 1.0f; }
    227 };
    228 
    232 
    233 // 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:
    234 // - Any operation that requires returning the result by value will otherwise return the built-in integral type, which will have incorrect range
    235 // That means that after getting the value of the channel we cannot properly do channel_convert, channel_invert, etc.
    236 // - 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
    237 namespace detail {
    238 
    239 // returns the smallest fast unsigned integral type that has at least NumBits bits
    240 template <int NumBits>
    241 struct min_fast_uint :
    242  std::conditional
    243  <
    244  NumBits <= 8,
    245  std::uint_least8_t,
    246  typename std::conditional
    247  <
    248  NumBits <= 16,
    249  std::uint_least16_t,
    250  typename std::conditional
    251  <
    252  NumBits <= 32,
    253  std::uint_least32_t,
    254  std::uintmax_t
    255  >::type
    256  >::type
    257  >
    258 {};
    259 
    260 template <int NumBits>
    261 struct num_value_fn
    262  : std::conditional<NumBits < 32, std::uint32_t, std::uint64_t>
    263 {};
    264 
    265 template <int NumBits>
    266 struct max_value_fn
    267  : std::conditional<NumBits <= 32, std::uint32_t, std::uint64_t>
    268 {};
    269 
    270 } // namespace detail
    271 
    285 
    288 template <int NumBits>
    289 class packed_channel_value
    290 {
    291 public:
    292  using integer_t = typename detail::min_fast_uint<NumBits>::type;
    293 
    294  using value_type = packed_channel_value<NumBits>;
    295  using reference = value_type&;
    296  using const_reference = value_type const&;
    297  using pointer = value_type*;
    298  using const_pointer = value_type const*;
    299  static constexpr bool is_mutable = true;
    300 
    301  static value_type min_value() { return 0; }
    302  static value_type max_value() { return low_bits_mask_t< NumBits >::sig_bits; }
    303 
    304  packed_channel_value() = default;
    305  packed_channel_value(integer_t v)
    306  {
    307  value_ = static_cast<integer_t>(v & low_bits_mask_t<NumBits>::sig_bits_fast);
    308  }
    309 
    310  template <typename Scalar>
    311  packed_channel_value(Scalar v)
    312  {
    313  value_ = packed_channel_value(static_cast<integer_t>(v));
    314  }
    315 
    316  static unsigned int num_bits() { return NumBits; }
    317 
    318  operator integer_t() const { return value_; }
    319 
    320 private:
    321  integer_t value_{};
    322 };
    323 
    324 namespace detail {
    325 
    326 template <std::size_t K>
    327 struct static_copy_bytes
    328 {
    329  void operator()(unsigned char const* from, unsigned char* to) const
    330  {
    331  *to = *from;
    332  static_copy_bytes<K - 1>()(++from, ++to);
    333  }
    334 };
    335 
    336 template <>
    337 struct static_copy_bytes<0>
    338 {
    339  void operator()(unsigned char const*, unsigned char*) const {}
    340 };
    341 
    342 template <typename Derived, typename BitField, int NumBits, bool IsMutable>
    343 class packed_channel_reference_base
    344 {
    345 protected:
    346  using data_ptr_t = typename std::conditional<IsMutable, void*, void const*>::type;
    347 public:
    348  data_ptr_t _data_ptr; // void* pointer to the first byte of the bit range
    349 
    350  using value_type = packed_channel_value<NumBits>;
    351  using reference = const Derived;
    352  using pointer = value_type *;
    353  using const_pointer = const value_type *;
    354  static constexpr int num_bits = NumBits;
    355  static constexpr bool is_mutable = IsMutable;
    356 
    357  static value_type min_value() { return channel_traits<value_type>::min_value(); }
    358  static value_type max_value() { return channel_traits<value_type>::max_value(); }
    359 
    360  using bitfield_t = BitField;
    361  using integer_t = typename value_type::integer_t;
    362 
    363  packed_channel_reference_base(data_ptr_t data_ptr) : _data_ptr(data_ptr) {}
    364  packed_channel_reference_base(const packed_channel_reference_base& ref) : _data_ptr(ref._data_ptr) {}
    365  const Derived& operator=(integer_t v) const { set(v); return derived(); }
    366 
    367  const Derived& operator++() const { set(get()+1); return derived(); }
    368  const Derived& operator--() const { set(get()-1); return derived(); }
    369 
    370  Derived operator++(int) const { Derived tmp=derived(); this->operator++(); return tmp; }
    371  Derived operator--(int) const { Derived tmp=derived(); this->operator--(); return tmp; }
    372 
    373  template <typename Scalar2> const Derived& operator+=(Scalar2 v) const { set( static_cast<integer_t>( get() + v )); return derived(); }
    374  template <typename Scalar2> const Derived& operator-=(Scalar2 v) const { set( static_cast<integer_t>( get() - v )); return derived(); }
    375  template <typename Scalar2> const Derived& operator*=(Scalar2 v) const { set( static_cast<integer_t>( get() * v )); return derived(); }
    376  template <typename Scalar2> const Derived& operator/=(Scalar2 v) const { set( static_cast<integer_t>( get() / v )); return derived(); }
    377 
    378  operator integer_t() const { return get(); }
    379  data_ptr_t operator &() const {return _data_ptr;}
    380 protected:
    381 
    382  using num_value_t = typename detail::num_value_fn<NumBits>::type;
    383  using max_value_t = typename detail::max_value_fn<NumBits>::type;
    384 
    385  static const num_value_t num_values = static_cast< num_value_t >( 1 ) << NumBits ;
    386  static const max_value_t max_val = static_cast< max_value_t >( num_values - 1 );
    387 
    388 #if defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
    389  const bitfield_t& get_data() const { return *static_cast<const bitfield_t*>(_data_ptr); }
    390  void set_data(const bitfield_t& val) const { *static_cast< bitfield_t*>(_data_ptr) = val; }
    391 #else
    392  bitfield_t get_data() const {
    393  bitfield_t ret;
    394  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(_data_ptr),gil_reinterpret_cast<unsigned char*>(&ret));
    395  return ret;
    396  }
    397  void set_data(const bitfield_t& val) const {
    398  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(&val),gil_reinterpret_cast<unsigned char*>(_data_ptr));
    399  }
    400 #endif
    401 
    402 private:
    403  void set(integer_t value) const { // can this be done faster??
    404  this->derived().set_unsafe(((value % num_values) + num_values) % num_values);
    405  }
    406  integer_t get() const { return derived().get(); }
    407  const Derived& derived() const { return static_cast<const Derived&>(*this); }
    408 };
    409 } // namespace detail
    410 
    424 
    428 template <typename BitField, int FirstBit, int NumBits, bool IsMutable>
    429 class packed_channel_reference;
    430 
    434 template <typename BitField, int NumBits, bool IsMutable>
    435 class packed_dynamic_channel_reference;
    436 
    439 template <typename BitField, int FirstBit, int NumBits>
    440 class packed_channel_reference<BitField, FirstBit, NumBits, false>
    441  : public detail::packed_channel_reference_base
    442  <
    443  packed_channel_reference<BitField, FirstBit, NumBits, false>,
    444  BitField,
    445  NumBits,
    446  false
    447  >
    448 {
    449  using parent_t = detail::packed_channel_reference_base
    450  <
    451  packed_channel_reference<BitField, FirstBit, NumBits, false>,
    452  BitField,
    453  NumBits,
    454  false
    455  >;
    456 
    457  friend class packed_channel_reference<BitField, FirstBit, NumBits, true>;
    458 
    459  static const BitField channel_mask = static_cast<BitField>(parent_t::max_val) << FirstBit;
    460 
    461  void operator=(packed_channel_reference const&);
    462 public:
    463  using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
    464  using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
    465  using integer_t = typename parent_t::integer_t;
    466 
    467  explicit packed_channel_reference(const void* data_ptr) : parent_t(data_ptr) {}
    468  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
    469  packed_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr) {}
    470 
    471  unsigned first_bit() const { return FirstBit; }
    472 
    473  integer_t get() const { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
    474 };
    475 
    478 template <typename BitField, int FirstBit, int NumBits>
    479 class packed_channel_reference<BitField,FirstBit,NumBits,true>
    480  : public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>
    481 {
    482  using parent_t = detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>;
    483  friend class packed_channel_reference<BitField,FirstBit,NumBits,false>;
    484 
    485  static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
    486 
    487 public:
    488  using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
    489  using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
    490  using integer_t = typename parent_t::integer_t;
    491 
    492  explicit packed_channel_reference(void* data_ptr) : parent_t(data_ptr) {}
    493  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
    494 
    495  packed_channel_reference const& operator=(integer_t value) const
    496  {
    497  BOOST_ASSERT(value <= parent_t::max_val);
    498  set_unsafe(value);
    499  return *this;
    500  }
    501 
    502  const packed_channel_reference& operator=(const mutable_reference& ref) const { set_from_reference(ref.get_data()); return *this; }
    503  const packed_channel_reference& operator=(const const_reference& ref) const { set_from_reference(ref.get_data()); return *this; }
    504 
    505  template <bool Mutable1>
    506  const packed_channel_reference& operator=(const packed_dynamic_channel_reference<BitField,NumBits,Mutable1>& ref) const { set_unsafe(ref.get()); return *this; }
    507 
    508  unsigned first_bit() const { return FirstBit; }
    509 
    510  integer_t get() const { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
    511  void set_unsafe(integer_t value) const { this->set_data((this->get_data() & ~channel_mask) | (( static_cast< BitField >( value )<<FirstBit))); }
    512 private:
    513  void set_from_reference(const BitField& other_bits) const { this->set_data((this->get_data() & ~channel_mask) | (other_bits & channel_mask)); }
    514 };
    515 
    516 }} // namespace boost::gil
    517 
    518 namespace std {
    519 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
    520 // swap with 'left bias':
    521 // - swap between proxy and anything
    522 // - swap between value type and proxy
    523 // - swap between proxy and proxy
    524 
    527 template <typename BF, int FB, int NB, bool M, typename R>
    528 inline
    529 void swap(boost::gil::packed_channel_reference<BF, FB, NB, M> const x, R& y)
    530 {
    531  boost::gil::swap_proxy
    532  <
    533  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
    534  >(x, y);
    535 }
    536 
    537 
    540 template <typename BF, int FB, int NB, bool M>
    541 inline
    542 void swap(
    543  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type& x,
    544  boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
    545 {
    546  boost::gil::swap_proxy
    547  <
    548  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
    549  >(x,y);
    550 }
    551 
    554 template <typename BF, int FB, int NB, bool M> inline
    555 void swap(
    556  boost::gil::packed_channel_reference<BF, FB, NB, M> const x,
    557  boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
    558 {
    559  boost::gil::swap_proxy
    560  <
    561  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
    562  >(x,y);
    563 }
    564 
    565 } // namespace std
    566 
    567 namespace boost { namespace gil {
    568 
    583 
    587 template <typename BitField, int NumBits>
    588 class packed_dynamic_channel_reference<BitField,NumBits,false>
    589  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>
    590 {
    591  using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>;
    592  friend class packed_dynamic_channel_reference<BitField,NumBits,true>;
    593 
    594  unsigned _first_bit; // 0..7
    595 
    596  void operator=(const packed_dynamic_channel_reference&);
    597 public:
    598  using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
    599  using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
    600  using integer_t = typename parent_t::integer_t;
    601 
    602  packed_dynamic_channel_reference(const void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
    603  packed_dynamic_channel_reference(const const_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    604  packed_dynamic_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    605 
    606  unsigned first_bit() const { return _first_bit; }
    607 
    608  integer_t get() const {
    609  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) <<_first_bit;
    610  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
    611  }
    612 };
    613 
    617 template <typename BitField, int NumBits>
    618 class packed_dynamic_channel_reference<BitField,NumBits,true>
    619  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>
    620 {
    621  using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>;
    622  friend class packed_dynamic_channel_reference<BitField,NumBits,false>;
    623 
    624  unsigned _first_bit;
    625 
    626 public:
    627  using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
    628  using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
    629  using integer_t = typename parent_t::integer_t;
    630 
    631  packed_dynamic_channel_reference(void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
    632  packed_dynamic_channel_reference(const packed_dynamic_channel_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    633 
    634  packed_dynamic_channel_reference const& operator=(integer_t value) const
    635  {
    636  BOOST_ASSERT(value <= parent_t::max_val);
    637  set_unsafe(value);
    638  return *this;
    639  }
    640 
    641  const packed_dynamic_channel_reference& operator=(const mutable_reference& ref) const { set_unsafe(ref.get()); return *this; }
    642  const packed_dynamic_channel_reference& operator=(const const_reference& ref) const { set_unsafe(ref.get()); return *this; }
    643 
    644  template <typename BitField1, int FirstBit1, bool Mutable1>
    645  const packed_dynamic_channel_reference& operator=(const packed_channel_reference<BitField1, FirstBit1, NumBits, Mutable1>& ref) const
    646  { set_unsafe(ref.get()); return *this; }
    647 
    648  unsigned first_bit() const { return _first_bit; }
    649 
    650  integer_t get() const {
    651  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
    652  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
    653  }
    654 
    655  void set_unsafe(integer_t value) const {
    656  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
    657  this->set_data((this->get_data() & ~channel_mask) | value<<_first_bit);
    658  }
    659 };
    660 } } // namespace boost::gil
    661 
    662 namespace std {
    663 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
    664 // swap with 'left bias':
    665 // - swap between proxy and anything
    666 // - swap between value type and proxy
    667 // - swap between proxy and proxy
    668 
    669 
    672 template <typename BF, int NB, bool M, typename R> inline
    673 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, R& y) {
    674  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
    675 }
    676 
    677 
    680 template <typename BF, int NB, bool M> inline
    681 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) {
    682  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
    683 }
    684 
    687 template <typename BF, int NB, bool M> inline
    688 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
    689  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
    690 }
    691 } // namespace std
    692 
    693 // \brief Determines the fundamental type which may be used, e.g., to cast from larger to smaller channel types.
    694 namespace boost { namespace gil {
    695 template <typename T>
    696 struct base_channel_type_impl { using type = T; };
    697 
    698 template <int N>
    699 struct base_channel_type_impl<packed_channel_value<N> >
    700 { using type = typename packed_channel_value<N>::integer_t; };
    701 
    702 template <typename B, int F, int N, bool M>
    703 struct base_channel_type_impl<packed_channel_reference<B, F, N, M> >
    704 {
    705  using type = typename packed_channel_reference<B,F,N,M>::integer_t;
    706 };
    707 
    708 template <typename B, int N, bool M>
    709 struct base_channel_type_impl<packed_dynamic_channel_reference<B, N, M> >
    710 {
    711  using type = typename packed_dynamic_channel_reference<B,N,M>::integer_t;
    712 };
    713 
    714 template <typename ChannelValue, typename MinV, typename MaxV>
    715 struct base_channel_type_impl<scoped_channel_value<ChannelValue, MinV, MaxV> >
    716 { using type = ChannelValue; };
    717 
    718 template <typename T>
    719 struct base_channel_type : base_channel_type_impl<typename std::remove_cv<T>::type> {};
    720 
    721 }} //namespace boost::gil
    722 
    723 #endif
    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:688
    -
    Definition: algorithm.hpp:30
    -
    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.
    Definition: channel.hpp:588
    -
    Definition: algorithm.hpp:133
    -
    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.
    Definition: channel.hpp:618
    +
    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
    +
    23 #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  scoped_channel_value& operator++() { ++value_; return *this; }
    +
    202  scoped_channel_value& operator--() { --value_; return *this; }
    +
    203 
    +
    204  scoped_channel_value operator++(int) { scoped_channel_value tmp=*this; this->operator++(); return tmp; }
    +
    205  scoped_channel_value operator--(int) { scoped_channel_value tmp=*this; this->operator--(); return tmp; }
    +
    206 
    +
    207  template <typename Scalar2> scoped_channel_value& operator+=(Scalar2 v) { value_+=v; return *this; }
    +
    208  template <typename Scalar2> scoped_channel_value& operator-=(Scalar2 v) { value_-=v; return *this; }
    +
    209  template <typename Scalar2> scoped_channel_value& operator*=(Scalar2 v) { value_*=v; return *this; }
    +
    210  template <typename Scalar2> scoped_channel_value& operator/=(Scalar2 v) { value_/=v; return *this; }
    +
    211 
    +
    212  operator BaseChannelValue() const { return value_; }
    +
    213 private:
    +
    214  BaseChannelValue value_{};
    +
    215 };
    +
    216 
    +
    217 template <typename T>
    +
    218 struct float_point_zero
    +
    219 {
    +
    220  static constexpr T apply() { return 0.0f; }
    +
    221 };
    +
    222 
    +
    223 template <typename T>
    +
    224 struct float_point_one
    +
    225 {
    +
    226  static constexpr T apply() { return 1.0f; }
    +
    227 };
    +
    228 
    +
    232 
    +
    233 // 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:
    +
    234 // - Any operation that requires returning the result by value will otherwise return the built-in integral type, which will have incorrect range
    +
    235 // That means that after getting the value of the channel we cannot properly do channel_convert, channel_invert, etc.
    +
    236 // - 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
    +
    237 namespace detail {
    +
    238 
    +
    239 // returns the smallest fast unsigned integral type that has at least NumBits bits
    +
    240 template <int NumBits>
    +
    241 struct min_fast_uint :
    +
    242  std::conditional
    +
    243  <
    +
    244  NumBits <= 8,
    +
    245  std::uint_least8_t,
    +
    246  typename std::conditional
    +
    247  <
    +
    248  NumBits <= 16,
    +
    249  std::uint_least16_t,
    +
    250  typename std::conditional
    +
    251  <
    +
    252  NumBits <= 32,
    +
    253  std::uint_least32_t,
    +
    254  std::uintmax_t
    +
    255  >::type
    +
    256  >::type
    +
    257  >
    +
    258 {};
    +
    259 
    +
    260 template <int NumBits>
    +
    261 struct num_value_fn
    +
    262  : std::conditional<NumBits < 32, std::uint32_t, std::uint64_t>
    +
    263 {};
    +
    264 
    +
    265 template <int NumBits>
    +
    266 struct max_value_fn
    +
    267  : std::conditional<NumBits <= 32, std::uint32_t, std::uint64_t>
    +
    268 {};
    +
    269 
    +
    270 } // namespace detail
    +
    271 
    +
    285 
    +
    288 template <int NumBits>
    +
    289 class packed_channel_value
    +
    290 {
    +
    291 public:
    +
    292  using integer_t = typename detail::min_fast_uint<NumBits>::type;
    +
    293 
    +
    294  using value_type = packed_channel_value<NumBits>;
    +
    295  using reference = value_type&;
    +
    296  using const_reference = value_type const&;
    +
    297  using pointer = value_type*;
    +
    298  using const_pointer = value_type const*;
    +
    299  static constexpr bool is_mutable = true;
    +
    300 
    +
    301  static value_type min_value() { return 0; }
    +
    302  static value_type max_value() { return low_bits_mask_t< NumBits >::sig_bits; }
    +
    303 
    +
    304  packed_channel_value() = default;
    +
    305  packed_channel_value(integer_t v)
    +
    306  {
    +
    307  value_ = static_cast<integer_t>(v & low_bits_mask_t<NumBits>::sig_bits_fast);
    +
    308  }
    +
    309 
    +
    310  template <typename Scalar>
    +
    311  packed_channel_value(Scalar v)
    +
    312  {
    +
    313  value_ = packed_channel_value(static_cast<integer_t>(v));
    +
    314  }
    +
    315 
    +
    316  static unsigned int num_bits() { return NumBits; }
    +
    317 
    +
    318  operator integer_t() const { return value_; }
    +
    319 
    +
    320 private:
    +
    321  integer_t value_{};
    +
    322 };
    +
    323 
    +
    324 namespace detail {
    +
    325 
    +
    326 template <std::size_t K>
    +
    327 struct static_copy_bytes
    +
    328 {
    +
    329  void operator()(unsigned char const* from, unsigned char* to) const
    +
    330  {
    +
    331  *to = *from;
    +
    332  static_copy_bytes<K - 1>()(++from, ++to);
    +
    333  }
    +
    334 };
    +
    335 
    +
    336 template <>
    +
    337 struct static_copy_bytes<0>
    +
    338 {
    +
    339  void operator()(unsigned char const*, unsigned char*) const {}
    +
    340 };
    +
    341 
    +
    342 template <typename Derived, typename BitField, int NumBits, bool IsMutable>
    +
    343 class packed_channel_reference_base
    +
    344 {
    +
    345 protected:
    +
    346  using data_ptr_t = typename std::conditional<IsMutable, void*, void const*>::type;
    +
    347 public:
    +
    348  data_ptr_t _data_ptr; // void* pointer to the first byte of the bit range
    +
    349 
    +
    350  using value_type = packed_channel_value<NumBits>;
    +
    351  using reference = const Derived;
    +
    352  using pointer = value_type *;
    +
    353  using const_pointer = const value_type *;
    +
    354  static constexpr int num_bits = NumBits;
    +
    355  static constexpr bool is_mutable = IsMutable;
    +
    356 
    +
    357  static value_type min_value() { return channel_traits<value_type>::min_value(); }
    +
    358  static value_type max_value() { return channel_traits<value_type>::max_value(); }
    +
    359 
    +
    360  using bitfield_t = BitField;
    +
    361  using integer_t = typename value_type::integer_t;
    +
    362 
    +
    363  packed_channel_reference_base(data_ptr_t data_ptr) : _data_ptr(data_ptr) {}
    +
    364  packed_channel_reference_base(const packed_channel_reference_base& ref) : _data_ptr(ref._data_ptr) {}
    +
    365  const Derived& operator=(integer_t v) const { set(v); return derived(); }
    +
    366 
    +
    367  const Derived& operator++() const { set(get()+1); return derived(); }
    +
    368  const Derived& operator--() const { set(get()-1); return derived(); }
    +
    369 
    +
    370  Derived operator++(int) const { Derived tmp=derived(); this->operator++(); return tmp; }
    +
    371  Derived operator--(int) const { Derived tmp=derived(); this->operator--(); return tmp; }
    +
    372 
    +
    373  template <typename Scalar2> const Derived& operator+=(Scalar2 v) const { set( static_cast<integer_t>( get() + v )); return derived(); }
    +
    374  template <typename Scalar2> const Derived& operator-=(Scalar2 v) const { set( static_cast<integer_t>( get() - v )); return derived(); }
    +
    375  template <typename Scalar2> const Derived& operator*=(Scalar2 v) const { set( static_cast<integer_t>( get() * v )); return derived(); }
    +
    376  template <typename Scalar2> const Derived& operator/=(Scalar2 v) const { set( static_cast<integer_t>( get() / v )); return derived(); }
    +
    377 
    +
    378  operator integer_t() const { return get(); }
    +
    379  data_ptr_t operator &() const {return _data_ptr;}
    +
    380 protected:
    +
    381 
    +
    382  using num_value_t = typename detail::num_value_fn<NumBits>::type;
    +
    383  using max_value_t = typename detail::max_value_fn<NumBits>::type;
    +
    384 
    +
    385  static const num_value_t num_values = static_cast< num_value_t >( 1 ) << NumBits ;
    +
    386  static const max_value_t max_val = static_cast< max_value_t >( num_values - 1 );
    +
    387 
    +
    388 #if defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
    +
    389  const bitfield_t& get_data() const { return *static_cast<const bitfield_t*>(_data_ptr); }
    +
    390  void set_data(const bitfield_t& val) const { *static_cast< bitfield_t*>(_data_ptr) = val; }
    +
    391 #else
    +
    392  bitfield_t get_data() const {
    +
    393  bitfield_t ret;
    +
    394  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(_data_ptr),gil_reinterpret_cast<unsigned char*>(&ret));
    +
    395  return ret;
    +
    396  }
    +
    397  void set_data(const bitfield_t& val) const {
    +
    398  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(&val),gil_reinterpret_cast<unsigned char*>(_data_ptr));
    +
    399  }
    +
    400 #endif
    +
    401 
    +
    402 private:
    +
    403  void set(integer_t value) const { // can this be done faster??
    +
    404  this->derived().set_unsafe(((value % num_values) + num_values) % num_values);
    +
    405  }
    +
    406  integer_t get() const { return derived().get(); }
    +
    407  const Derived& derived() const { return static_cast<const Derived&>(*this); }
    +
    408 };
    +
    409 } // namespace detail
    +
    410 
    +
    424 
    +
    428 template <typename BitField, int FirstBit, int NumBits, bool IsMutable>
    +
    429 class packed_channel_reference;
    +
    430 
    +
    434 template <typename BitField, int NumBits, bool IsMutable>
    +
    435 class packed_dynamic_channel_reference;
    +
    436 
    +
    439 template <typename BitField, int FirstBit, int NumBits>
    +
    440 class packed_channel_reference<BitField, FirstBit, NumBits, false>
    +
    441  : public detail::packed_channel_reference_base
    +
    442  <
    +
    443  packed_channel_reference<BitField, FirstBit, NumBits, false>,
    +
    444  BitField,
    +
    445  NumBits,
    +
    446  false
    +
    447  >
    +
    448 {
    +
    449  using parent_t = detail::packed_channel_reference_base
    +
    450  <
    +
    451  packed_channel_reference<BitField, FirstBit, NumBits, false>,
    +
    452  BitField,
    +
    453  NumBits,
    +
    454  false
    +
    455  >;
    +
    456 
    +
    457  friend class packed_channel_reference<BitField, FirstBit, NumBits, true>;
    +
    458 
    +
    459  static const BitField channel_mask = static_cast<BitField>(parent_t::max_val) << FirstBit;
    +
    460 
    +
    461  void operator=(packed_channel_reference const&);
    +
    462 public:
    +
    463  using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
    +
    464  using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
    +
    465  using integer_t = typename parent_t::integer_t;
    +
    466 
    +
    467  explicit packed_channel_reference(const void* data_ptr) : parent_t(data_ptr) {}
    +
    468  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
    +
    469  packed_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr) {}
    +
    470 
    +
    471  unsigned first_bit() const { return FirstBit; }
    +
    472 
    +
    473  integer_t get() const { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
    +
    474 };
    +
    475 
    +
    478 template <typename BitField, int FirstBit, int NumBits>
    +
    479 class packed_channel_reference<BitField,FirstBit,NumBits,true>
    +
    480  : public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>
    +
    481 {
    +
    482  using parent_t = detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>;
    +
    483  friend class packed_channel_reference<BitField,FirstBit,NumBits,false>;
    +
    484 
    +
    485  static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
    +
    486 
    +
    487 public:
    +
    488  using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
    +
    489  using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
    +
    490  using integer_t = typename parent_t::integer_t;
    +
    491 
    +
    492  explicit packed_channel_reference(void* data_ptr) : parent_t(data_ptr) {}
    +
    493  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
    +
    494 
    +
    495  packed_channel_reference const& operator=(integer_t value) const
    +
    496  {
    +
    497  BOOST_ASSERT(value <= parent_t::max_val);
    +
    498  set_unsafe(value);
    +
    499  return *this;
    +
    500  }
    +
    501 
    +
    502  const packed_channel_reference& operator=(const mutable_reference& ref) const { set_from_reference(ref.get_data()); return *this; }
    +
    503  const packed_channel_reference& operator=(const const_reference& ref) const { set_from_reference(ref.get_data()); return *this; }
    +
    504 
    +
    505  template <bool Mutable1>
    +
    506  const packed_channel_reference& operator=(const packed_dynamic_channel_reference<BitField,NumBits,Mutable1>& ref) const { set_unsafe(ref.get()); return *this; }
    +
    507 
    +
    508  unsigned first_bit() const { return FirstBit; }
    +
    509 
    +
    510  integer_t get() const { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
    +
    511  void set_unsafe(integer_t value) const { this->set_data((this->get_data() & ~channel_mask) | (( static_cast< BitField >( value )<<FirstBit))); }
    +
    512 private:
    +
    513  void set_from_reference(const BitField& other_bits) const { this->set_data((this->get_data() & ~channel_mask) | (other_bits & channel_mask)); }
    +
    514 };
    +
    515 
    +
    516 }} // namespace boost::gil
    +
    517 
    +
    518 namespace std {
    +
    519 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
    +
    520 // swap with 'left bias':
    +
    521 // - swap between proxy and anything
    +
    522 // - swap between value type and proxy
    +
    523 // - swap between proxy and proxy
    +
    524 
    +
    527 template <typename BF, int FB, int NB, bool M, typename R>
    +
    528 inline
    +
    529 void swap(boost::gil::packed_channel_reference<BF, FB, NB, M> const x, R& y)
    +
    530 {
    +
    531  boost::gil::swap_proxy
    +
    532  <
    +
    533  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
    +
    534  >(x, y);
    +
    535 }
    +
    536 
    +
    537 
    +
    540 template <typename BF, int FB, int NB, bool M>
    +
    541 inline
    +
    542 void swap(
    +
    543  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type& x,
    +
    544  boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
    +
    545 {
    +
    546  boost::gil::swap_proxy
    +
    547  <
    +
    548  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
    +
    549  >(x,y);
    +
    550 }
    +
    551 
    +
    554 template <typename BF, int FB, int NB, bool M> inline
    +
    555 void swap(
    +
    556  boost::gil::packed_channel_reference<BF, FB, NB, M> const x,
    +
    557  boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
    +
    558 {
    +
    559  boost::gil::swap_proxy
    +
    560  <
    +
    561  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
    +
    562  >(x,y);
    +
    563 }
    +
    564 
    +
    565 } // namespace std
    +
    566 
    +
    567 namespace boost { namespace gil {
    +
    568 
    +
    583 
    +
    587 template <typename BitField, int NumBits>
    +
    588 class packed_dynamic_channel_reference<BitField,NumBits,false>
    +
    589  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>
    +
    590 {
    +
    591  using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>;
    +
    592  friend class packed_dynamic_channel_reference<BitField,NumBits,true>;
    +
    593 
    +
    594  unsigned _first_bit; // 0..7
    +
    595 
    +
    596  void operator=(const packed_dynamic_channel_reference&);
    +
    597 public:
    +
    598  using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
    +
    599  using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
    +
    600  using integer_t = typename parent_t::integer_t;
    +
    601 
    +
    602  packed_dynamic_channel_reference(const void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
    +
    603  packed_dynamic_channel_reference(const const_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    +
    604  packed_dynamic_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    +
    605 
    +
    606  unsigned first_bit() const { return _first_bit; }
    +
    607 
    +
    608  integer_t get() const {
    +
    609  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) <<_first_bit;
    +
    610  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
    +
    611  }
    +
    612 };
    +
    613 
    +
    617 template <typename BitField, int NumBits>
    +
    618 class packed_dynamic_channel_reference<BitField,NumBits,true>
    +
    619  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>
    +
    620 {
    +
    621  using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>;
    +
    622  friend class packed_dynamic_channel_reference<BitField,NumBits,false>;
    +
    623 
    +
    624  unsigned _first_bit;
    +
    625 
    +
    626 public:
    +
    627  using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
    +
    628  using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
    +
    629  using integer_t = typename parent_t::integer_t;
    +
    630 
    +
    631  packed_dynamic_channel_reference(void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
    +
    632  packed_dynamic_channel_reference(const packed_dynamic_channel_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
    +
    633 
    +
    634  packed_dynamic_channel_reference const& operator=(integer_t value) const
    +
    635  {
    +
    636  BOOST_ASSERT(value <= parent_t::max_val);
    +
    637  set_unsafe(value);
    +
    638  return *this;
    +
    639  }
    +
    640 
    +
    641  const packed_dynamic_channel_reference& operator=(const mutable_reference& ref) const { set_unsafe(ref.get()); return *this; }
    +
    642  const packed_dynamic_channel_reference& operator=(const const_reference& ref) const { set_unsafe(ref.get()); return *this; }
    +
    643 
    +
    644  template <typename BitField1, int FirstBit1, bool Mutable1>
    +
    645  const packed_dynamic_channel_reference& operator=(const packed_channel_reference<BitField1, FirstBit1, NumBits, Mutable1>& ref) const
    +
    646  { set_unsafe(ref.get()); return *this; }
    +
    647 
    +
    648  unsigned first_bit() const { return _first_bit; }
    +
    649 
    +
    650  integer_t get() const {
    +
    651  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
    +
    652  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
    +
    653  }
    +
    654 
    +
    655  void set_unsafe(integer_t value) const {
    +
    656  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
    +
    657  this->set_data((this->get_data() & ~channel_mask) | value<<_first_bit);
    +
    658  }
    +
    659 };
    +
    660 } } // namespace boost::gil
    +
    661 
    +
    662 namespace std {
    +
    663 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
    +
    664 // swap with 'left bias':
    +
    665 // - swap between proxy and anything
    +
    666 // - swap between value type and proxy
    +
    667 // - swap between proxy and proxy
    +
    668 
    +
    669 
    +
    672 template <typename BF, int NB, bool M, typename R> inline
    +
    673 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, R& y) {
    +
    674  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
    +
    675 }
    +
    676 
    +
    677 
    +
    680 template <typename BF, int NB, bool M> inline
    +
    681 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) {
    +
    682  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
    +
    683 }
    +
    684 
    +
    687 template <typename BF, int NB, bool M> inline
    +
    688 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
    +
    689  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
    +
    690 }
    +
    691 } // namespace std
    +
    692 
    +
    693 // \brief Determines the fundamental type which may be used, e.g., to cast from larger to smaller channel types.
    +
    694 namespace boost { namespace gil {
    +
    695 template <typename T>
    +
    696 struct base_channel_type_impl { using type = T; };
    +
    697 
    +
    698 template <int N>
    +
    699 struct base_channel_type_impl<packed_channel_value<N> >
    +
    700 { using type = typename packed_channel_value<N>::integer_t; };
    +
    701 
    +
    702 template <typename B, int F, int N, bool M>
    +
    703 struct base_channel_type_impl<packed_channel_reference<B, F, N, M> >
    +
    704 {
    +
    705  using type = typename packed_channel_reference<B,F,N,M>::integer_t;
    +
    706 };
    +
    707 
    +
    708 template <typename B, int N, bool M>
    +
    709 struct base_channel_type_impl<packed_dynamic_channel_reference<B, N, M> >
    +
    710 {
    +
    711  using type = typename packed_dynamic_channel_reference<B,N,M>::integer_t;
    +
    712 };
    +
    713 
    +
    714 template <typename ChannelValue, typename MinV, typename MaxV>
    +
    715 struct base_channel_type_impl<scoped_channel_value<ChannelValue, MinV, MaxV> >
    +
    716 { using type = ChannelValue; };
    +
    717 
    +
    718 template <typename T>
    +
    719 struct base_channel_type : base_channel_type_impl<typename std::remove_cv<T>::type> {};
    +
    720 
    +
    721 }} //namespace boost::gil
    +
    722 
    +
    723 #endif
    +
    Models a mutable subbyte channel reference whose bit offset is a runtime parameter....
    Definition: channel.hpp:618
    +
    Models a constant subbyte channel reference whose bit offset is a runtime parameter....
    Definition: channel.hpp:588
    +
    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:688
    diff --git a/develop/doc/html/reference/channel__algorithm_8hpp_source.html b/develop/doc/html/reference/channel__algorithm_8hpp_source.html index f03a4f7c3..20c748296 100644 --- a/develop/doc/html/reference/channel__algorithm_8hpp_source.html +++ b/develop/doc/html/reference/channel__algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_algorithm.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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>
    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, 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  DstChannelV operator()(SrcChannelV src) const {
    152  return DstChannelV(channel_traits<DstChannelV>::min_value() +
    153  (src - channel_traits<SrcChannelV>::min_value()) / channel_range<SrcChannelV>() * channel_range<DstChannelV>());
    154  }
    155 private:
    156  template <typename C>
    157  static double channel_range() {
    158  return double(channel_traits<C>::max_value()) - double(channel_traits<C>::min_value());
    159  }
    160 };
    161 
    162 // When both the source and the destination are integral channels, perform a faster conversion
    163 template <typename SrcChannelV, typename DstChannelV>
    164 struct channel_converter_unsigned_impl<SrcChannelV, DstChannelV, true, true>
    165  : channel_converter_unsigned_integral
    166  <
    167  SrcChannelV,
    168  DstChannelV,
    169  mp11::mp_less
    170  <
    171  unsigned_integral_max_value<SrcChannelV>,
    172  unsigned_integral_max_value<DstChannelV>
    173  >::value
    174  >
    175 {};
    176 
    180 
    181 template <typename SrcChannelV, typename DstChannelV>
    182 struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,true>
    183  : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,
    184  !(unsigned_integral_max_value<DstChannelV>::value % unsigned_integral_max_value<SrcChannelV>::value) > {};
    185 
    186 template <typename SrcChannelV, typename DstChannelV>
    187 struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,false>
    188  : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,
    189  !(unsigned_integral_max_value<SrcChannelV>::value % unsigned_integral_max_value<DstChannelV>::value) > {};
    190 
    191 
    195 
    196 // Both source and destination are unsigned integral channels,
    197 // the src max value is less than the dst max value,
    198 // and the dst max value is divisible by the src max value
    199 template <typename SrcChannelV, typename DstChannelV>
    200 struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,true> {
    201  DstChannelV operator()(SrcChannelV src) const {
    202  using integer_t = typename unsigned_integral_max_value<DstChannelV>::value_type;
    203  static const integer_t mul = unsigned_integral_max_value<DstChannelV>::value / unsigned_integral_max_value<SrcChannelV>::value;
    204  return DstChannelV(src * mul);
    205  }
    206 };
    207 
    208 // Both source and destination are unsigned integral channels,
    209 // the dst max value is less than (or equal to) the src max value,
    210 // and the src max value is divisible by the dst max value
    211 template <typename SrcChannelV, typename DstChannelV>
    212 struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,true> {
    213  DstChannelV operator()(SrcChannelV src) const {
    214  using integer_t = typename unsigned_integral_max_value<SrcChannelV>::value_type;
    215  static const integer_t div = unsigned_integral_max_value<SrcChannelV>::value / unsigned_integral_max_value<DstChannelV>::value;
    216  static const integer_t div2 = div/2;
    217  return DstChannelV((src + div2) / div);
    218  }
    219 };
    220 
    221 // Prevent overflow for the largest integral type
    222 template <typename DstChannelV>
    223 struct channel_converter_unsigned_integral_impl<uintmax_t,DstChannelV,false,true> {
    224  DstChannelV operator()(uintmax_t src) const {
    225  static const uintmax_t div = unsigned_integral_max_value<uint32_t>::value / unsigned_integral_max_value<DstChannelV>::value;
    226  static const uintmax_t div2 = div/2;
    227  if (src > unsigned_integral_max_value<uintmax_t>::value - div2)
    228  return unsigned_integral_max_value<DstChannelV>::value;
    229  return DstChannelV((src + div2) / div);
    230  }
    231 };
    232 
    233 // Both source and destination are unsigned integral channels,
    234 // and the dst max value is not divisible by the src max value
    235 // See if you can represent the expression (src * dst_max) / src_max in integral form
    236 template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst>
    237 struct channel_converter_unsigned_integral_impl<SrcChannelV, DstChannelV, SrcLessThanDst, false>
    238  : channel_converter_unsigned_integral_nondivisible
    239  <
    240  SrcChannelV,
    241  DstChannelV,
    242  SrcLessThanDst,
    243  mp11::mp_less
    244  <
    245  unsigned_integral_num_bits<uintmax_t>,
    246  mp11::mp_plus
    247  <
    248  unsigned_integral_num_bits<SrcChannelV>,
    249  unsigned_integral_num_bits<DstChannelV>
    250  >
    251  >::value
    252  >
    253 {};
    254 
    255 // Both source and destination are unsigned integral channels,
    256 // the src max value is less than the dst max value,
    257 // and the dst max value is not divisible by the src max value
    258 // The expression (src * dst_max) / src_max fits in an integer
    259 template <typename SrcChannelV, typename DstChannelV>
    260 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, false>
    261 {
    262  DstChannelV operator()(SrcChannelV src) const
    263  {
    264  using dest_t = typename base_channel_type<DstChannelV>::type;
    265  return DstChannelV(
    266  static_cast<dest_t>(src * unsigned_integral_max_value<DstChannelV>::value)
    267  / unsigned_integral_max_value<SrcChannelV>::value);
    268  }
    269 };
    270 
    271 // Both source and destination are unsigned integral channels,
    272 // the src max value is less than the dst max value,
    273 // and the dst max value is not divisible by the src max value
    274 // The expression (src * dst_max) / src_max cannot fit in an integer (overflows). Use a double
    275 template <typename SrcChannelV, typename DstChannelV>
    276 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, true>
    277 {
    278  DstChannelV operator()(SrcChannelV src) const
    279  {
    280  static const double mul
    281  = unsigned_integral_max_value<DstChannelV>::value
    282  / double(unsigned_integral_max_value<SrcChannelV>::value);
    283  return DstChannelV(src * mul);
    284  }
    285 };
    286 
    287 // Both source and destination are unsigned integral channels,
    288 // the dst max value is less than (or equal to) the src max value,
    289 // and the src max value is not divisible by the dst max value
    290 template <typename SrcChannelV, typename DstChannelV, bool CannotFit>
    291 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV,DstChannelV,false,CannotFit> {
    292  DstChannelV operator()(SrcChannelV src) const {
    293 
    294  using src_integer_t = typename detail::unsigned_integral_max_value<SrcChannelV>::value_type;
    295  using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
    296 
    297  static const double div = unsigned_integral_max_value<SrcChannelV>::value
    298  / static_cast< double >( unsigned_integral_max_value<DstChannelV>::value );
    299 
    300  static const src_integer_t div2 = static_cast< src_integer_t >( div / 2.0 );
    301 
    302  return DstChannelV( static_cast< dst_integer_t >(( static_cast< double >( src + div2 ) / div )));
    303  }
    304 };
    305 
    306 } // namespace detail
    307 
    311 
    312 template <typename DstChannelV> struct channel_converter_unsigned<float32_t,DstChannelV> {
    313  using argument_type = float32_t;
    314  using result_type = DstChannelV;
    315  DstChannelV operator()(float32_t x) const
    316  {
    317  using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
    318  return DstChannelV( static_cast< dst_integer_t >(x*channel_traits<DstChannelV>::max_value()+0.5f ));
    319  }
    320 };
    321 
    322 template <typename SrcChannelV> struct channel_converter_unsigned<SrcChannelV,float32_t> {
    323  using argument_type = float32_t;
    324  using result_type = SrcChannelV;
    325  float32_t operator()(SrcChannelV x) const { return float32_t(x/float(channel_traits<SrcChannelV>::max_value())); }
    326 };
    327 
    328 template <> struct channel_converter_unsigned<float32_t,float32_t> {
    329  using argument_type = float32_t;
    330  using result_type = float32_t;
    331  float32_t operator()(float32_t x) const { return x; }
    332 };
    333 
    334 
    336 template <> struct channel_converter_unsigned<uint32_t,float32_t> {
    337  using argument_type = uint32_t;
    338  using result_type = float32_t;
    339  float32_t operator()(uint32_t x) const {
    340  // 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
    341  if (x>=channel_traits<uint32_t>::max_value()) return channel_traits<float32_t>::max_value();
    342  return float(x) / float(channel_traits<uint32_t>::max_value());
    343  }
    344 };
    346 template <> struct channel_converter_unsigned<float32_t,uint32_t> {
    347  using argument_type = float32_t;
    348  using result_type = uint32_t;
    349  uint32_t operator()(float32_t x) const {
    350  // 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
    351  if (x>=channel_traits<float32_t>::max_value())
    352  return channel_traits<uint32_t>::max_value();
    353 
    354  auto const max_value = channel_traits<uint32_t>::max_value();
    355  auto const result = x * static_cast<float32_t::base_channel_t>(max_value) + 0.5f;
    356  return static_cast<uint32_t>(result);
    357  }
    358 };
    359 
    361 
    362 namespace detail {
    363 // Converting from signed to unsigned integral channel.
    364 // It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
    365 template <typename ChannelValue> // Model ChannelValueConcept
    366 struct channel_convert_to_unsigned : public detail::identity<ChannelValue> {
    367  using type = ChannelValue;
    368 };
    369 
    370 template <> struct channel_convert_to_unsigned<int8_t> {
    371  using argument_type = int8_t;
    372  using result_type = uint8_t;
    373  using type = uint8_t;
    374  type operator()(int8_t val) const {
    375  return static_cast<uint8_t>(static_cast<uint32_t>(val) + 128u);
    376  }
    377 };
    378 
    379 template <> struct channel_convert_to_unsigned<int16_t> {
    380  using argument_type = int16_t;
    381  using result_type = uint16_t;
    382  using type = uint16_t;
    383  type operator()(int16_t val) const {
    384  return static_cast<uint16_t>(static_cast<uint32_t>(val) + 32768u);
    385  }
    386 };
    387 
    388 template <> struct channel_convert_to_unsigned<int32_t> {
    389  using argument_type = int32_t;
    390  using result_type = uint32_t;
    391  using type = uint32_t;
    392  type operator()(int32_t val) const {
    393  return static_cast<uint32_t>(val)+(1u<<31);
    394  }
    395 };
    396 
    397 
    398 // Converting from unsigned to signed integral channel
    399 // It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
    400 template <typename ChannelValue> // Model ChannelValueConcept
    401 struct channel_convert_from_unsigned : public detail::identity<ChannelValue> {
    402  using type = ChannelValue;
    403 };
    404 
    405 template <> struct channel_convert_from_unsigned<int8_t> {
    406  using argument_type = uint8_t;
    407  using result_type = int8_t;
    408  using type = int8_t;
    409  type operator()(uint8_t val) const {
    410  return static_cast<int8_t>(static_cast<int32_t>(val) - 128);
    411  }
    412 };
    413 
    414 template <> struct channel_convert_from_unsigned<int16_t> {
    415  using argument_type = uint16_t;
    416  using result_type = int16_t;
    417  using type = int16_t;
    418  type operator()(uint16_t val) const {
    419  return static_cast<int16_t>(static_cast<int32_t>(val) - 32768);
    420  }
    421 };
    422 
    423 template <> struct channel_convert_from_unsigned<int32_t> {
    424  using argument_type = uint32_t;
    425  using result_type = int32_t;
    426  using type = int32_t;
    427  type operator()(uint32_t val) const {
    428  return static_cast<int32_t>(val - (1u<<31));
    429  }
    430 };
    431 
    432 } // namespace detail
    433 
    436 template <typename SrcChannelV, typename DstChannelV> // Model ChannelValueConcept
    438  using argument_type = SrcChannelV;
    439  using result_type = DstChannelV;
    440  DstChannelV operator()(const SrcChannelV& src) const {
    441  using to_unsigned = detail::channel_convert_to_unsigned<SrcChannelV>;
    442  using from_unsigned = detail::channel_convert_from_unsigned<DstChannelV>;
    443  using converter_unsigned = channel_converter_unsigned<typename to_unsigned::result_type, typename from_unsigned::argument_type>;
    444  return from_unsigned()(converter_unsigned()(to_unsigned()(src)));
    445  }
    446 };
    447 
    450 template <typename DstChannel, typename SrcChannel> // Model ChannelConcept (could be channel references)
    451 inline typename channel_traits<DstChannel>::value_type channel_convert(const SrcChannel& src) {
    453  typename channel_traits<DstChannel>::value_type>()(src);
    454 }
    455 
    461  template <typename Ch1, typename Ch2>
    462  void operator()(const Ch1& src, Ch2& dst) const {
    463  dst=channel_convert<Ch2>(src);
    464  }
    465 };
    466 
    467 namespace detail {
    468  // fast integer division by 255
    469  inline uint32_t div255(uint32_t in) { uint32_t tmp=in+128; return (tmp + (tmp>>8))>>8; }
    470 
    471  // fast integer divison by 32768
    472  inline uint32_t div32768(uint32_t in) { return (in+16384)>>15; }
    473 }
    474 
    487 
    489 template <typename ChannelValue>
    491  using first_argument_type = ChannelValue;
    492  using second_argument_type = ChannelValue;
    493  using result_type = ChannelValue;
    494  ChannelValue operator()(ChannelValue a, ChannelValue b) const {
    495  return ChannelValue(static_cast<typename base_channel_type<ChannelValue>::type>(a / double(channel_traits<ChannelValue>::max_value()) * b));
    496  }
    497 };
    498 
    500 template<> struct channel_multiplier_unsigned<uint8_t> {
    501  using first_argument_type = uint8_t;
    502  using second_argument_type = uint8_t;
    503  using result_type = uint8_t;
    504  uint8_t operator()(uint8_t a, uint8_t b) const { return uint8_t(detail::div255(uint32_t(a) * uint32_t(b))); }
    505 };
    506 
    508 template<> struct channel_multiplier_unsigned<uint16_t> {
    509  using first_argument_type = uint16_t;
    510  using second_argument_type = uint16_t;
    511  using result_type = uint16_t;
    512  uint16_t operator()(uint16_t a, uint16_t b) const { return uint16_t((uint32_t(a) * uint32_t(b))/65535); }
    513 };
    514 
    517  using first_argument_type = float32_t;
    518  using second_argument_type = float32_t;
    519  using result_type = float32_t;
    520  float32_t operator()(float32_t a, float32_t b) const { return a*b; }
    521 };
    522 
    524 template <typename ChannelValue>
    526  using first_argument_type = ChannelValue;
    527  using second_argument_type = ChannelValue;
    528  using result_type = ChannelValue;
    529  ChannelValue operator()(ChannelValue a, ChannelValue b) const {
    530  using to_unsigned = detail::channel_convert_to_unsigned<ChannelValue>;
    531  using from_unsigned = detail::channel_convert_from_unsigned<ChannelValue>;
    533  return from_unsigned()(multiplier_unsigned()(to_unsigned()(a), to_unsigned()(b)));
    534  }
    535 };
    536 
    538 template <typename Channel> // Models ChannelConcept (could be a channel reference)
    539 inline typename channel_traits<Channel>::value_type channel_multiply(Channel a, Channel b) {
    541 }
    543 
    555 
    558 template <typename Channel> // Models ChannelConcept (could be a channel reference)
    559 inline typename channel_traits<Channel>::value_type channel_invert(Channel x) {
    560 
    561  using base_t = typename base_channel_type<Channel>::type;
    562  using promoted_t = typename promote_integral<base_t>::type;
    563  promoted_t const promoted_x = x;
    564  promoted_t const promoted_max = channel_traits<Channel>::max_value();
    565  promoted_t const promoted_min = channel_traits<Channel>::min_value();
    566  promoted_t const promoted_inverted_x = promoted_max - promoted_x + promoted_min;
    567  auto const inverted_x = static_cast<base_t>(promoted_inverted_x);
    568  return inverted_x;
    569 }
    570 
    571 } } // namespace boost::gil
    572 
    573 #endif
    channel_traits< Channel >::value_type channel_invert(Channel x)
    Default implementation. Provide overloads for performance.
    Definition: channel_algorithm.hpp:559
    -
    Definition: algorithm.hpp:30
    -
    channel_traits< DstChannel >::value_type channel_convert(const SrcChannel &src)
    Converting from one channel type to another.
    Definition: channel_algorithm.hpp:451
    -
    channel_traits< Channel >::value_type channel_multiply(Channel a, Channel b)
    A function multiplying two channels. result = a * b / max_value.
    Definition: channel_algorithm.hpp:539
    -
    identity taken from SGI STL.
    Definition: utilities.hpp:209
    -
    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:124
    -
    Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
    Definition: channel_algorithm.hpp:460
    -
    A function object to multiply two channels. result = a * b / max_value.
    Definition: channel_algorithm.hpp:525
    -
    This is the default implementation. Performance specializatons are provided.
    Definition: channel_algorithm.hpp:490
    -
    This is the default implementation. Performance specializatons are provided.
    Definition: channel_algorithm.hpp:26
    -
    A unary function object converting between channel types.
    Definition: channel_algorithm.hpp:437
    +
    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>
    + +
    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  DstChannelV operator()(SrcChannelV src) const {
    +
    152  return DstChannelV(channel_traits<DstChannelV>::min_value() +
    +
    153  (src - channel_traits<SrcChannelV>::min_value()) / channel_range<SrcChannelV>() * channel_range<DstChannelV>());
    +
    154  }
    +
    155 private:
    +
    156  template <typename C>
    +
    157  static double channel_range() {
    +
    158  return double(channel_traits<C>::max_value()) - double(channel_traits<C>::min_value());
    +
    159  }
    +
    160 };
    +
    161 
    +
    162 // When both the source and the destination are integral channels, perform a faster conversion
    +
    163 template <typename SrcChannelV, typename DstChannelV>
    +
    164 struct channel_converter_unsigned_impl<SrcChannelV, DstChannelV, true, true>
    +
    165  : channel_converter_unsigned_integral
    +
    166  <
    +
    167  SrcChannelV,
    +
    168  DstChannelV,
    +
    169  mp11::mp_less
    +
    170  <
    +
    171  unsigned_integral_max_value<SrcChannelV>,
    +
    172  unsigned_integral_max_value<DstChannelV>
    +
    173  >::value
    +
    174  >
    +
    175 {};
    +
    176 
    +
    180 
    +
    181 template <typename SrcChannelV, typename DstChannelV>
    +
    182 struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,true>
    +
    183  : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,
    +
    184  !(unsigned_integral_max_value<DstChannelV>::value % unsigned_integral_max_value<SrcChannelV>::value) > {};
    +
    185 
    +
    186 template <typename SrcChannelV, typename DstChannelV>
    +
    187 struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,false>
    +
    188  : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,
    +
    189  !(unsigned_integral_max_value<SrcChannelV>::value % unsigned_integral_max_value<DstChannelV>::value) > {};
    +
    190 
    +
    191 
    +
    195 
    +
    196 // Both source and destination are unsigned integral channels,
    +
    197 // the src max value is less than the dst max value,
    +
    198 // and the dst max value is divisible by the src max value
    +
    199 template <typename SrcChannelV, typename DstChannelV>
    +
    200 struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,true> {
    +
    201  DstChannelV operator()(SrcChannelV src) const {
    +
    202  using integer_t = typename unsigned_integral_max_value<DstChannelV>::value_type;
    +
    203  static const integer_t mul = unsigned_integral_max_value<DstChannelV>::value / unsigned_integral_max_value<SrcChannelV>::value;
    +
    204  return DstChannelV(src * mul);
    +
    205  }
    +
    206 };
    +
    207 
    +
    208 // Both source and destination are unsigned integral channels,
    +
    209 // the dst max value is less than (or equal to) the src max value,
    +
    210 // and the src max value is divisible by the dst max value
    +
    211 template <typename SrcChannelV, typename DstChannelV>
    +
    212 struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,true> {
    +
    213  DstChannelV operator()(SrcChannelV src) const {
    +
    214  using integer_t = typename unsigned_integral_max_value<SrcChannelV>::value_type;
    +
    215  static const integer_t div = unsigned_integral_max_value<SrcChannelV>::value / unsigned_integral_max_value<DstChannelV>::value;
    +
    216  static const integer_t div2 = div/2;
    +
    217  return DstChannelV((src + div2) / div);
    +
    218  }
    +
    219 };
    +
    220 
    +
    221 // Prevent overflow for the largest integral type
    +
    222 template <typename DstChannelV>
    +
    223 struct channel_converter_unsigned_integral_impl<uintmax_t,DstChannelV,false,true> {
    +
    224  DstChannelV operator()(uintmax_t src) const {
    +
    225  static const uintmax_t div = unsigned_integral_max_value<uint32_t>::value / unsigned_integral_max_value<DstChannelV>::value;
    +
    226  static const uintmax_t div2 = div/2;
    +
    227  if (src > unsigned_integral_max_value<uintmax_t>::value - div2)
    +
    228  return unsigned_integral_max_value<DstChannelV>::value;
    +
    229  return DstChannelV((src + div2) / div);
    +
    230  }
    +
    231 };
    +
    232 
    +
    233 // Both source and destination are unsigned integral channels,
    +
    234 // and the dst max value is not divisible by the src max value
    +
    235 // See if you can represent the expression (src * dst_max) / src_max in integral form
    +
    236 template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst>
    +
    237 struct channel_converter_unsigned_integral_impl<SrcChannelV, DstChannelV, SrcLessThanDst, false>
    +
    238  : channel_converter_unsigned_integral_nondivisible
    +
    239  <
    +
    240  SrcChannelV,
    +
    241  DstChannelV,
    +
    242  SrcLessThanDst,
    +
    243  mp11::mp_less
    +
    244  <
    +
    245  unsigned_integral_num_bits<uintmax_t>,
    +
    246  mp11::mp_plus
    +
    247  <
    +
    248  unsigned_integral_num_bits<SrcChannelV>,
    +
    249  unsigned_integral_num_bits<DstChannelV>
    +
    250  >
    +
    251  >::value
    +
    252  >
    +
    253 {};
    +
    254 
    +
    255 // Both source and destination are unsigned integral channels,
    +
    256 // the src max value is less than the dst max value,
    +
    257 // and the dst max value is not divisible by the src max value
    +
    258 // The expression (src * dst_max) / src_max fits in an integer
    +
    259 template <typename SrcChannelV, typename DstChannelV>
    +
    260 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, false>
    +
    261 {
    +
    262  DstChannelV operator()(SrcChannelV src) const
    +
    263  {
    +
    264  using dest_t = typename base_channel_type<DstChannelV>::type;
    +
    265  return DstChannelV(
    +
    266  static_cast<dest_t>(src * unsigned_integral_max_value<DstChannelV>::value)
    +
    267  / unsigned_integral_max_value<SrcChannelV>::value);
    +
    268  }
    +
    269 };
    +
    270 
    +
    271 // Both source and destination are unsigned integral channels,
    +
    272 // the src max value is less than the dst max value,
    +
    273 // and the dst max value is not divisible by the src max value
    +
    274 // The expression (src * dst_max) / src_max cannot fit in an integer (overflows). Use a double
    +
    275 template <typename SrcChannelV, typename DstChannelV>
    +
    276 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, true>
    +
    277 {
    +
    278  DstChannelV operator()(SrcChannelV src) const
    +
    279  {
    +
    280  static const double mul
    +
    281  = unsigned_integral_max_value<DstChannelV>::value
    +
    282  / double(unsigned_integral_max_value<SrcChannelV>::value);
    +
    283  return DstChannelV(src * mul);
    +
    284  }
    +
    285 };
    +
    286 
    +
    287 // Both source and destination are unsigned integral channels,
    +
    288 // the dst max value is less than (or equal to) the src max value,
    +
    289 // and the src max value is not divisible by the dst max value
    +
    290 template <typename SrcChannelV, typename DstChannelV, bool CannotFit>
    +
    291 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV,DstChannelV,false,CannotFit> {
    +
    292  DstChannelV operator()(SrcChannelV src) const {
    +
    293 
    +
    294  using src_integer_t = typename detail::unsigned_integral_max_value<SrcChannelV>::value_type;
    +
    295  using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
    +
    296 
    +
    297  static const double div = unsigned_integral_max_value<SrcChannelV>::value
    +
    298  / static_cast< double >( unsigned_integral_max_value<DstChannelV>::value );
    +
    299 
    +
    300  static const src_integer_t div2 = static_cast< src_integer_t >( div / 2.0 );
    +
    301 
    +
    302  return DstChannelV( static_cast< dst_integer_t >(( static_cast< double >( src + div2 ) / div )));
    +
    303  }
    +
    304 };
    +
    305 
    +
    306 } // namespace detail
    +
    307 
    +
    311 
    +
    312 template <typename DstChannelV> struct channel_converter_unsigned<float32_t,DstChannelV> {
    +
    313  using argument_type = float32_t;
    +
    314  using result_type = DstChannelV;
    +
    315  DstChannelV operator()(float32_t x) const
    +
    316  {
    +
    317  using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
    +
    318  return DstChannelV( static_cast< dst_integer_t >(x*channel_traits<DstChannelV>::max_value()+0.5f ));
    +
    319  }
    +
    320 };
    +
    321 
    +
    322 template <typename SrcChannelV> struct channel_converter_unsigned<SrcChannelV,float32_t> {
    +
    323  using argument_type = float32_t;
    +
    324  using result_type = SrcChannelV;
    +
    325  float32_t operator()(SrcChannelV x) const { return float32_t(x/float(channel_traits<SrcChannelV>::max_value())); }
    +
    326 };
    +
    327 
    +
    328 template <> struct channel_converter_unsigned<float32_t,float32_t> {
    +
    329  using argument_type = float32_t;
    +
    330  using result_type = float32_t;
    +
    331  float32_t operator()(float32_t x) const { return x; }
    +
    332 };
    +
    333 
    +
    334 
    +
    336 template <> struct channel_converter_unsigned<uint32_t,float32_t> {
    +
    337  using argument_type = uint32_t;
    +
    338  using result_type = float32_t;
    +
    339  float32_t operator()(uint32_t x) const {
    +
    340  // 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
    +
    341  if (x>=channel_traits<uint32_t>::max_value()) return channel_traits<float32_t>::max_value();
    +
    342  return float(x) / float(channel_traits<uint32_t>::max_value());
    +
    343  }
    +
    344 };
    +
    346 template <> struct channel_converter_unsigned<float32_t,uint32_t> {
    +
    347  using argument_type = float32_t;
    +
    348  using result_type = uint32_t;
    +
    349  uint32_t operator()(float32_t x) const {
    +
    350  // 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
    +
    351  if (x>=channel_traits<float32_t>::max_value())
    +
    352  return channel_traits<uint32_t>::max_value();
    +
    353 
    +
    354  auto const max_value = channel_traits<uint32_t>::max_value();
    +
    355  auto const result = x * static_cast<float32_t::base_channel_t>(max_value) + 0.5f;
    +
    356  return static_cast<uint32_t>(result);
    +
    357  }
    +
    358 };
    +
    359 
    +
    361 
    +
    362 namespace detail {
    +
    363 // Converting from signed to unsigned integral channel.
    +
    364 // It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
    +
    365 template <typename ChannelValue> // Model ChannelValueConcept
    +
    366 struct channel_convert_to_unsigned : public detail::identity<ChannelValue> {
    +
    367  using type = ChannelValue;
    +
    368 };
    +
    369 
    +
    370 template <> struct channel_convert_to_unsigned<int8_t> {
    +
    371  using argument_type = int8_t;
    +
    372  using result_type = uint8_t;
    +
    373  using type = uint8_t;
    +
    374  type operator()(int8_t val) const {
    +
    375  return static_cast<uint8_t>(static_cast<uint32_t>(val) + 128u);
    +
    376  }
    +
    377 };
    +
    378 
    +
    379 template <> struct channel_convert_to_unsigned<int16_t> {
    +
    380  using argument_type = int16_t;
    +
    381  using result_type = uint16_t;
    +
    382  using type = uint16_t;
    +
    383  type operator()(int16_t val) const {
    +
    384  return static_cast<uint16_t>(static_cast<uint32_t>(val) + 32768u);
    +
    385  }
    +
    386 };
    +
    387 
    +
    388 template <> struct channel_convert_to_unsigned<int32_t> {
    +
    389  using argument_type = int32_t;
    +
    390  using result_type = uint32_t;
    +
    391  using type = uint32_t;
    +
    392  type operator()(int32_t val) const {
    +
    393  return static_cast<uint32_t>(val)+(1u<<31);
    +
    394  }
    +
    395 };
    +
    396 
    +
    397 
    +
    398 // Converting from unsigned to signed integral channel
    +
    399 // It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
    +
    400 template <typename ChannelValue> // Model ChannelValueConcept
    +
    401 struct channel_convert_from_unsigned : public detail::identity<ChannelValue> {
    +
    402  using type = ChannelValue;
    +
    403 };
    +
    404 
    +
    405 template <> struct channel_convert_from_unsigned<int8_t> {
    +
    406  using argument_type = uint8_t;
    +
    407  using result_type = int8_t;
    +
    408  using type = int8_t;
    +
    409  type operator()(uint8_t val) const {
    +
    410  return static_cast<int8_t>(static_cast<int32_t>(val) - 128);
    +
    411  }
    +
    412 };
    +
    413 
    +
    414 template <> struct channel_convert_from_unsigned<int16_t> {
    +
    415  using argument_type = uint16_t;
    +
    416  using result_type = int16_t;
    +
    417  using type = int16_t;
    +
    418  type operator()(uint16_t val) const {
    +
    419  return static_cast<int16_t>(static_cast<int32_t>(val) - 32768);
    +
    420  }
    +
    421 };
    +
    422 
    +
    423 template <> struct channel_convert_from_unsigned<int32_t> {
    +
    424  using argument_type = uint32_t;
    +
    425  using result_type = int32_t;
    +
    426  using type = int32_t;
    +
    427  type operator()(uint32_t val) const {
    +
    428  return static_cast<int32_t>(val - (1u<<31));
    +
    429  }
    +
    430 };
    +
    431 
    +
    432 } // namespace detail
    +
    433 
    +
    436 template <typename SrcChannelV, typename DstChannelV> // Model ChannelValueConcept
    + +
    438  using argument_type = SrcChannelV;
    +
    439  using result_type = DstChannelV;
    +
    440  DstChannelV operator()(const SrcChannelV& src) const {
    +
    441  using to_unsigned = detail::channel_convert_to_unsigned<SrcChannelV>;
    +
    442  using from_unsigned = detail::channel_convert_from_unsigned<DstChannelV>;
    +
    443  using converter_unsigned = channel_converter_unsigned<typename to_unsigned::result_type, typename from_unsigned::argument_type>;
    +
    444  return from_unsigned()(converter_unsigned()(to_unsigned()(src)));
    +
    445  }
    +
    446 };
    +
    447 
    +
    450 template <typename DstChannel, typename SrcChannel> // Model ChannelConcept (could be channel references)
    +
    451 inline typename channel_traits<DstChannel>::value_type channel_convert(const SrcChannel& src) {
    + +
    453  typename channel_traits<DstChannel>::value_type>()(src);
    +
    454 }
    +
    455 
    + +
    461  template <typename Ch1, typename Ch2>
    +
    462  void operator()(const Ch1& src, Ch2& dst) const {
    +
    463  dst=channel_convert<Ch2>(src);
    +
    464  }
    +
    465 };
    +
    466 
    +
    467 namespace detail {
    +
    468  // fast integer division by 255
    +
    469  inline uint32_t div255(uint32_t in) { uint32_t tmp=in+128; return (tmp + (tmp>>8))>>8; }
    +
    470 
    +
    471  // fast integer divison by 32768
    +
    472  inline uint32_t div32768(uint32_t in) { return (in+16384)>>15; }
    +
    473 }
    +
    474 
    +
    487 
    +
    489 template <typename ChannelValue>
    + +
    491  using first_argument_type = ChannelValue;
    +
    492  using second_argument_type = ChannelValue;
    +
    493  using result_type = ChannelValue;
    +
    494  ChannelValue operator()(ChannelValue a, ChannelValue b) const {
    +
    495  return ChannelValue(static_cast<typename base_channel_type<ChannelValue>::type>(a / double(channel_traits<ChannelValue>::max_value()) * b));
    +
    496  }
    +
    497 };
    +
    498 
    +
    500 template<> struct channel_multiplier_unsigned<uint8_t> {
    +
    501  using first_argument_type = uint8_t;
    +
    502  using second_argument_type = uint8_t;
    +
    503  using result_type = uint8_t;
    +
    504  uint8_t operator()(uint8_t a, uint8_t b) const { return uint8_t(detail::div255(uint32_t(a) * uint32_t(b))); }
    +
    505 };
    +
    506 
    +
    508 template<> struct channel_multiplier_unsigned<uint16_t> {
    +
    509  using first_argument_type = uint16_t;
    +
    510  using second_argument_type = uint16_t;
    +
    511  using result_type = uint16_t;
    +
    512  uint16_t operator()(uint16_t a, uint16_t b) const { return uint16_t((uint32_t(a) * uint32_t(b))/65535); }
    +
    513 };
    +
    514 
    + +
    517  using first_argument_type = float32_t;
    +
    518  using second_argument_type = float32_t;
    +
    519  using result_type = float32_t;
    +
    520  float32_t operator()(float32_t a, float32_t b) const { return a*b; }
    +
    521 };
    +
    522 
    +
    524 template <typename ChannelValue>
    + +
    526  using first_argument_type = ChannelValue;
    +
    527  using second_argument_type = ChannelValue;
    +
    528  using result_type = ChannelValue;
    +
    529  ChannelValue operator()(ChannelValue a, ChannelValue b) const {
    +
    530  using to_unsigned = detail::channel_convert_to_unsigned<ChannelValue>;
    +
    531  using from_unsigned = detail::channel_convert_from_unsigned<ChannelValue>;
    + +
    533  return from_unsigned()(multiplier_unsigned()(to_unsigned()(a), to_unsigned()(b)));
    +
    534  }
    +
    535 };
    +
    536 
    +
    538 template <typename Channel> // Models ChannelConcept (could be a channel reference)
    +
    539 inline typename channel_traits<Channel>::value_type channel_multiply(Channel a, Channel b) {
    + +
    541 }
    +
    543 
    +
    555 
    +
    558 template <typename Channel> // Models ChannelConcept (could be a channel reference)
    +
    559 inline typename channel_traits<Channel>::value_type channel_invert(Channel x) {
    +
    560 
    +
    561  using base_t = typename base_channel_type<Channel>::type;
    +
    562  using promoted_t = typename promote_integral<base_t>::type;
    +
    563  promoted_t const promoted_x = x;
    +
    564  promoted_t const promoted_max = channel_traits<Channel>::max_value();
    +
    565  promoted_t const promoted_min = channel_traits<Channel>::min_value();
    +
    566  promoted_t const promoted_inverted_x = promoted_max - promoted_x + promoted_min;
    +
    567  auto const inverted_x = static_cast<base_t>(promoted_inverted_x);
    +
    568  return inverted_x;
    +
    569 }
    +
    570 
    +
    571 } } // namespace boost::gil
    +
    572 
    +
    573 #endif
    +
    This is the default implementation. Performance specializatons are provided.
    Definition: channel_algorithm.hpp:26
    +
    Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
    Definition: channel_algorithm.hpp:460
    +
    channel_traits< DstChannel >::value_type channel_convert(const SrcChannel &src)
    Converting from one channel type to another.
    Definition: channel_algorithm.hpp:451
    +
    identity taken from SGI STL.
    Definition: utilities.hpp:209
    +
    A function object to multiply two channels. result = a * b / max_value.
    Definition: channel_algorithm.hpp:525
    +
    channel_traits< Channel >::value_type channel_multiply(Channel a, Channel b)
    A function multiplying two channels. result = a * b / max_value.
    Definition: channel_algorithm.hpp:539
    +
    This is the default implementation. Performance specializatons are provided.
    Definition: channel_algorithm.hpp:490
    +
    A unary function object converting between channel types.
    Definition: channel_algorithm.hpp:437
    +
    channel_traits< Channel >::value_type channel_invert(Channel x)
    Default implementation. Provide overloads for performance.
    Definition: channel_algorithm.hpp:559
    +
    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:124
    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1any__image-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1any__image-members.html index b5bc9fbc0..bf0e7e323 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1any__image-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1any__image-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

    - - - + + + + + @@ -84,7 +76,7 @@ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1any__image.html b/develop/doc/html/reference/classboost_1_1gil_1_1any__image.html index 53c921fb0..6efba7fbd 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1any__image.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1any__image.html @@ -4,7 +4,7 @@ - + Generic Image Library: any_image< Images > Class Template Reference @@ -27,24 +27,16 @@

    - - - + + + + +
    -

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

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

    #include <any_image.hpp>

    @@ -69,79 +61,79 @@ - - - - -

    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_image (any_image const &img)
     
    +
    template<typename Image >
     any_image (Image const &img)
     
    +
    template<typename Image >
     any_image (Image &&img)
     
    +
    template<typename Image >
     any_image (Image &img, bool do_swap)
     
    -template<typename... OtherImages>
    +template<typename ... OtherImages>
     any_image (any_image< OtherImages... > const &img)
     
    +
    any_imageoperator= (any_image const &img)
     
    +
    template<typename Image >
    any_imageoperator= (Image const &img)
     
    -template<typename... OtherImages>
    +template<typename ... OtherImages>
    any_imageoperator= (any_image< OtherImages... > const &img)
     
    +
    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
     

    Detailed Description

    -

    template<typename... Images>
    +

    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.

    +

    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: @@ -151,7 +143,7 @@ class boost::gil::any_image< Images >

    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1any__image__view-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1any__image__view-members.html index 26eba1d9f..c41af3f6c 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1any__image__view-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1any__image__view-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

    - - - + + + + + @@ -81,7 +73,7 @@ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1any__image__view.html b/develop/doc/html/reference/classboost_1_1gil_1_1any__image__view.html index 05981fae6..c9855ef9a 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1any__image__view.html +++ b/develop/doc/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,24 +27,16 @@

    - - - + + + + +
    -

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

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

    #include <any_image_view.hpp>

    @@ -69,69 +61,69 @@ - - - - -

    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_view (any_image_view const &view)
     
    +
    template<typename View >
     any_image_view (View const &view)
     
    -template<typename... OtherViews>
    +template<typename ... OtherViews>
     any_image_view (any_image_view< OtherViews... > const &view)
     
    +
    any_image_viewoperator= (any_image_view const &view)
     
    +
    template<typename View >
    any_image_viewoperator= (View const &view)
     
    -template<typename... OtherViews>
    +template<typename ... OtherViews>
    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
     
    +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>
    +

    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.

    +

    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.

    +

    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 apply_operation(runtime_view, algorithm_fn);


    The documentation for this class was generated from the following file:

    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1bit__range-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1bit__range-members.html index 553a089a7..ba129f0fe 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1bit__range-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1bit__range-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

    - - - + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1bit__range.html b/develop/doc/html/reference/classboost_1_1gil_1_1bit__range.html index b2f059b35..ddeae64f0 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1bit__range.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1bit__range.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_range< RangeSize, IsMutable > Class Template Reference @@ -27,24 +27,16 @@

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

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

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

    #include <utilities.hpp>

    @@ -70,71 +62,71 @@ Inheritance diagram for deref_compose< D1, D2 >:
    - + 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 > - -
    + +
    - - - - - - - -

    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) 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
     
    @@ -142,7 +134,7 @@ static constexpr bool is_m

    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.

    +

    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: @@ -152,7 +144,7 @@ class boost::gil::deref_compose< D1, D2 > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html index c34a29599..3011bed2f 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

    - - - + + + + + @@ -84,7 +76,7 @@ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor.html b/develop/doc/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor.html index 7fda8b1a4..0344013fc 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor.html +++ b/develop/doc/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,24 +27,16 @@

    - - - + + + + +
    -

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

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

    #include <pixel_iterator_adaptor.hpp>

    @@ -70,69 +62,65 @@ - - - -

    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
     
    -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
     
    +
    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
     
    +const Iterator & base () const
     
    +const DFn & deref_fn () const
     
    - - - -

    Friends

    -template<typename Iterator1 , typename DFn1 >
    class dereference_iterator_adaptor
     
    +
    class boost::iterator_core_access
     
    @@ -140,9 +128,11 @@ class boost::iterator_core

    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.

    +

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

    Member Function Documentation

    - + +

    ◆ operator[]()

    +
    @@ -176,7 +166,7 @@ class boost::gil::dereference_iterator_adaptor< Iterator, DFn > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1derived__image__type-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1derived__image__type-members.html index b887e7981..620ec9f69 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1derived__image__type-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1derived__image__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@
    - - - + + + + +
    - - - + + + + +
    -

    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. +

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

    #include <metafunctions.hpp>

    -

    Public Types

    +
    using type = typename image_type< channel_t, layout_t, planar >::type
     
    @@ -74,8 +66,8 @@ using type = typename

    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.

    +

    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: @@ -85,7 +77,7 @@ class boost::gil::derived_image_type< Image, T, L, IsPlanar > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html index 0fd7c3b1e..ea1f6df3e 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

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

    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. +

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

    #include <metafunctions.hpp>

    -

    Public Types

    +
    using type = typename iterator_type< channel_t, layout_t, planar, step, mut >::type
     
    @@ -74,8 +66,8 @@ using type = typename

    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.

    +

    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: @@ -85,7 +77,7 @@ class boost::gil::derived_iterator_type< Iterator, T, L, IsPlanar, IsStep, Is diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html index e8d7cda6b..eb1f18568 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

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

    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. +

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

    #include <metafunctions.hpp>

    -

    Public Types

    +
    using type = typename pixel_reference_type< channel_t, layout_t, planar, mut >::type
     
    @@ -74,8 +66,8 @@ using type = typename

    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.

    +

    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: @@ -85,7 +77,7 @@ class boost::gil::derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutabl diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1derived__view__type-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1derived__view__type-members.html index 4786914e9..a7ac47590 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1derived__view__type-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1derived__view__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

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

    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. +

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

    #include <metafunctions.hpp>

    -

    Public Types

    +
    using type = typename view_type< channel_t, layout_t, planar, step, mut >::type
     
    @@ -74,8 +66,8 @@ using type = typename

    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.

    +

    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: @@ -85,7 +77,7 @@ class boost::gil::derived_view_type< View, T, L, IsPlanar, StepX, IsMutable & diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html index 3a3c186e4..674207017 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

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

    Constructor & Destructor Documentation

    - + +

    ◆ file_stream_device() [1/5]

    +
    @@ -200,7 +194,9 @@ class boost::gil::detail::file_stream_device< FormatTag > - + +

    ◆ file_stream_device() [2/5]

    +
    @@ -235,7 +231,9 @@ class boost::gil::detail::file_stream_device< FormatTag > - + +

    ◆ file_stream_device() [3/5]

    +
    @@ -270,7 +268,9 @@ class boost::gil::detail::file_stream_device< FormatTag > - + +

    ◆ file_stream_device() [4/5]

    +
    @@ -305,7 +305,9 @@ class boost::gil::detail::file_stream_device< FormatTag > - + +

    ◆ file_stream_device() [5/5]

    +
    @@ -331,7 +333,9 @@ class boost::gil::detail::file_stream_device< FormatTag >

    Member Function Documentation

    - + +

    ◆ read()

    +
    @@ -362,8 +366,8 @@ class boost::gil::detail::file_stream_device< FormatTag >
    -
    Todo:
    : change byte_t* to void*
    -
    Todo:
    : add compiler symbol to turn error checking on and off.
    +
    Todo:
    : change byte_t* to void*
    +
    Todo:
    : add compiler symbol to turn error checking on and off.
    @@ -376,7 +380,7 @@ class boost::gil::detail::file_stream_device< FormatTag > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html index f128ac0a0..929eab637 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

    - - - + + + + +
    - - - + + + + +
    - - - + + + + +
    - - - + + + + + @@ -73,7 +65,7 @@ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor.html index 4da3105f6..df56c03f8 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor.html +++ b/develop/doc/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,24 +27,16 @@

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

    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. +

    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...

    #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)
     
    +
    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)
     
    +
    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...
     Exchanges the elements of the current view with those of other in constant time. More...
     
    +
    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 is_1d_traversable () const
     
    bool empty () const
     Returns true if the view has no elements, false otherwise. More...
     
    auto front () const -> reference
     Returns a reference to the first element in raster order. More...
     Returns a reference to the first element in raster order. More...
     
    auto back () const -> reference
     Returns a reference to the last element in raster order. More...
     Returns a reference to the last element in raster order. More...
     
    -

    Static Public Attributes

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

    Friends

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

    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 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
     
    - + + + - - -

    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
     
    @@ -287,14 +279,17 @@ auto col_end (x_coord_

    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.

    +

    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);

    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.

    +

    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);
    +

    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()

    +
    @@ -322,7 +317,9 @@ class boost::gil::image_view< Loc > - + +

    ◆ empty()

    +
    @@ -349,7 +346,9 @@ class boost::gil::image_view< Loc > - + +

    ◆ front()

    +
    @@ -377,7 +376,9 @@ class boost::gil::image_view< Loc > - + +

    ◆ swap()

    +
    @@ -409,12 +410,13 @@ class boost::gil::image_view< Loc >
  • image_view.hpp
  • +
    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:359
    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html index 6b04586a1..51567b559 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@
    - - - + + + + +
    - + - + - + - - + +
    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 >
    is_1d_traversable() const (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
    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()=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 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
    operator=(iterator_from_2d const &other)=default (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
    operator[](difference_type d) const iterator_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 >
    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_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
    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
    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1iterator__from__2d.html b/develop/doc/html/reference/classboost_1_1gil_1_1iterator__from__2d.html index 7ec3c6752..45268353a 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1iterator__from__2d.html +++ b/develop/doc/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,24 +27,16 @@

    - - - + + + + +
    -

    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. +

    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...

    #include <iterator_from_2d.hpp>

    @@ -70,62 +62,58 @@ - - - - -

    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
     
    -bool is_1d_traversable () const
     
    +
    +std::ptrdiff_t width () const
     
    +std::ptrdiff_t x_pos () const
     
    +std::ptrdiff_t y_pos () 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

    -template<typename Loc >
    class iterator_from_2d
     
    +
    class boost::iterator_core_access
     
    @@ -133,10 +121,12 @@ class boost::iterator_core

    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.

    +

    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[]()

    +
    @@ -170,7 +160,7 @@ class boost::gil::iterator_from_2d< Loc2 > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html index a7cfedbc5..bc7dd0b64 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@
    - - - + + + + +
    -
    memory_based_2d_locator< StepIterator > Member List
    +
    memory_based_2d_locator Member List
    -

    This is the complete list of members for memory_based_2d_locator< StepIterator >, including all inherited members.

    +

    This is the complete list of members for memory_based_2d_locator, 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(const point_t &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
    cache_location(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
    cache_location(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
    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()(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
    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) (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) (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=(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 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 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
    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 >
    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_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(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
    x_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
    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 >
    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(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
    xy_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() 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_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_iterator typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
    cache_location(const difference_type &d) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    cache_location(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    cached_location_t typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    const_t typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    coord_t typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    difference_type typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    is_1d_traversable(x_coord_t width) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    memory_based_2d_locator (defined in memory_based_2d_locator)memory_based_2d_locatorfriend
    memory_based_2d_locator() (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    memory_based_2d_locator(const StepIterator &yit) (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    memory_based_2d_locator(const memory_based_2d_locator< SI > &loc, coord_t y_step) (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    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)memory_based_2d_locatorinline
    memory_based_2d_locator(x_iterator xit, std::ptrdiff_t row_bytes) (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    memory_based_2d_locator(const memory_based_2d_locator< X > &pl) (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    memory_based_2d_locator(const memory_based_2d_locator &pl) (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    operator()(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    operator+=(const difference_type &d) (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    operator-=(const difference_type &d) (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    operator=(memory_based_2d_locator const &other)=default (defined in memory_based_2d_locator)memory_based_2d_locator
    operator==(const this_t &p) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    operator[](const difference_type &d) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    operator[](const cached_location_t &loc) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    parent_t typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    pixel_size() const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    reference typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    row_size() const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    x() const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    x() (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    x_at(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    x_at(const difference_type &d) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    x_coord_t typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    x_iterator typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    xy_at(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    xy_at(const difference_type &d) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    y() const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    y() (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    y_coord_t typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    y_distance_to(this_t const &p2, x_coord_t xDiff) const (defined in memory_based_2d_locator)memory_based_2d_locatorinline
    y_iterator typedef (defined in memory_based_2d_locator)memory_based_2d_locator
    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html index c0e96b682..02c44ce5e 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html @@ -4,9 +4,9 @@ - + - Generic Image Library: memory_based_2d_locator< StepIterator > Class Template Reference + Generic Image Library: memory_based_2d_locator Class Reference @@ -27,24 +27,16 @@

    - - - + + + + +
    -

    Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConceptThe class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation. +

    Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...

    #include <locator.hpp>

    -
    -Inheritance diagram for memory_based_2d_locator< StepIterator >:
    -
    -
    - - -pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, 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 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
     
    +
    +bool operator== (const this_t &p) 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
     
    +
    +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 (const point_t &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
     
    - - - - -

    -Friends

    -template<typename X >
    class memory_based_2d_locator
     
    - - - - + + + + + + + + + + + + + +

    -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
     
    +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
     

    Detailed Description

    -

    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.

    +

    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.


    The documentation for this class was generated from the following files:
    • algorithm.hpp
    • locator.hpp
    • @@ -316,7 +192,7 @@ class boost::gil::memory_based_2d_locator< StepIterator > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.png b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.png deleted file mode 100644 index ceb2df7a0..000000000 Binary files a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.png and /dev/null differ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html index 016e23280..e368a594b 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

    - - - + + + + +
    -
    memory_based_step_iterator< Iterator > Member List
    +
    memory_based_step_iterator Member List
    -

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

    +

    This is the complete list of members for memory_based_step_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() (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
    base() 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 > >
    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(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
    operator[](difference_type d) const memory_based_step_iterator< Iterator >inline
    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 (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(const Iterator &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 >
    base() (defined in memory_based_step_iterator)memory_based_step_iteratorinline
    base() const (defined in memory_based_step_iterator)memory_based_step_iteratorinline
    difference_type typedef (defined in memory_based_step_iterator)memory_based_step_iterator
    memory_based_step_iterator() (defined in memory_based_step_iterator)memory_based_step_iteratorinline
    memory_based_step_iterator(Iterator it, std::ptrdiff_t memunit_step) (defined in memory_based_step_iterator)memory_based_step_iteratorinline
    memory_based_step_iterator(const memory_based_step_iterator< I2 > &it) (defined in memory_based_step_iterator)memory_based_step_iteratorinline
    operator[](difference_type d) constmemory_based_step_iteratorinline
    parent_t typedef (defined in memory_based_step_iterator)memory_based_step_iterator
    reference typedef (defined in memory_based_step_iterator)memory_based_step_iterator
    set_step(std::ptrdiff_t memunit_step) (defined in memory_based_step_iterator)memory_based_step_iteratorinline
    x_iterator typedef (defined in memory_based_step_iterator)memory_based_step_iterator
    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html index b71b17828..225e525bb 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html @@ -4,9 +4,9 @@ - + - Generic Image Library: memory_based_step_iterator< Iterator > Class Template Reference + Generic Image Library: memory_based_step_iterator Class Reference @@ -27,24 +27,16 @@

    - - - + + + + +
    -
    memory_based_step_iterator< Iterator > Class Template Reference
    +
    memory_based_step_iterator Class Reference
    @@ -64,90 +56,53 @@ More...

    #include <step_iterator.hpp>

    -
    -Inheritance diagram for memory_based_step_iterator< Iterator >:
    -
    -
    - - -step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > > - -
    - - - + + - - - - - - - - - - -

    Public Types

    -using parent_t = detail::step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator >>
     
    +
    +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 memunit_step_fn< Iterator >::difference_type >
     
    -using base_difference_type = typename std::iterator_traits< Iterator >::difference_type
     
    -using difference_type = typename memunit_step_fn< Iterator >::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)
     
    reference operator[] (difference_type d) const
     
    +
    reference operator[] (difference_type d) const
     
    void set_step (std::ptrdiff_t memunit_step)
     
    +
    x_iterator & base ()
     
    -x_iterator const & base () const
     
    - Public Member Functions inherited from step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
    step_iterator_adaptor (const Iterator &it, memunit_step_fn< Iterator >step_fn=memunit_step_fn< Iterator >())
     
    -difference_type step () const
     
    - - - - + +

    -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
     
    +x_iterator const & base () const
     

    Detailed Description

    -

    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

    +

    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[]()

    +
    @@ -182,7 +137,7 @@ class boost::gil::memory_based_step_iterator< Iterator > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.png b/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.png deleted file mode 100644 index 5559145a8..000000000 Binary files a/develop/doc/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.png and /dev/null differ diff --git a/develop/doc/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/develop/doc/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 bbc5956cf..ed00fae40 100644 --- a/develop/doc/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/develop/doc/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,24 +27,16 @@
    - - - + + + + +
    - - + + @@ -73,7 +65,7 @@ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4.html b/develop/doc/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4.html index 4307a609e..976a60797 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4.html +++ b/develop/doc/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,24 +27,16 @@
    - - - + + + + +
    const_reference typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >
    first_bit() const (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
    get() const (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
    first_bit() const (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
    get() const (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 >
    mutable_reference typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >
    packed_dynamic_channel_reference(const void *data_ptr, unsigned first_bit) (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
    - - -

    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 (const void *data_ptr, unsigned first_bit)
     
    +
     packed_dynamic_channel_reference (const const_reference &ref)
     
    +
     packed_dynamic_channel_reference (const mutable_reference &ref)
     
    -unsigned first_bit () const
     
    -integer_t get () const
     
    +unsigned first_bit () const
     
    +integer_t get () const
     
    -

    Friends

    +
    class packed_dynamic_channel_reference< BitField, NumBits, true >
     
    @@ -118,7 +110,7 @@ class boost::gil::packed_dynamic_channel_reference< BitField, NumBits, false diff --git a/develop/doc/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/develop/doc/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 db7d117ef..4aac87c94 100644 --- a/develop/doc/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/develop/doc/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,24 +27,16 @@

    - - - + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4.html b/develop/doc/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4.html index 5c5370522..03a7f6223 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4.html +++ b/develop/doc/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,24 +27,16 @@

    - - - + + + + +
    - - - + + + + + @@ -95,7 +87,7 @@ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base.html b/develop/doc/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base.html index 571362c40..e1493458a 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base.html +++ b/develop/doc/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,24 +27,16 @@

    - - - + + + + +
    -

    base class for models of PixelLocatorConceptPixel 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: +

    base class for models of PixelLocatorConcept More...

    #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 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
     
    +
    +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 ()
     
    +
    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 (const point_t &p) const
     
    -reference operator() (x_coord_t dx, y_coord_t dy) const
     
    -reference operator[] (const difference_type &d) const
     
    -reference operator* () const
     
    +
    axis< D >::iterator axis_iterator (const point_t &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
     
    +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
     
    - @@ -180,21 +172,54 @@ template<typename X >

    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;

    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.

    +

    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;
    +

    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
    template <typename Deref> struct add_deref {
    using type = ...; // locator that invokes the Deref dereference object upon pixel access
    static type make(const my_locator& loc, const Deref& d);
    };
    my_locator();
    my_locator(const my_locator& pl);
    // constructors with dynamic step in y (and x). Only valid for locators with dynamic steps
    my_locator(const my_locator& loc, coord_t y_step);
    my_locator(const my_locator& loc, coord_t x_step, coord_t y_step, bool transpose);
    bool operator==(const my_locator& p) const;
    // return _references_ to horizontal/vertical iterators. Advancing them moves this locator
    x_iterator& x();
    y_iterator& y();
    x_iterator const& x() const;
    y_iterator const& y() const;
    // return the vertical distance to another locator. Some models need the horizontal distance to compute it
    y_coord_t y_distance_to(const my_locator& loc2, x_coord_t xDiff) const;
    // return true iff incrementing an x-iterator located at the last column will position it at the first
    // column of the next row. Some models need the image width to determine that.
    bool is_1d_traversable(x_coord_t width) const;
    };

    Models may choose to override some of the functions in the base class with more efficient versions.

    +

    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
    +
    static type make(const my_locator& loc, const Deref& d);
    +
    };
    +
    +
    my_locator();
    +
    my_locator(const my_locator& pl);
    +
    +
    // constructors with dynamic step in y (and x). Only valid for locators with dynamic steps
    +
    my_locator(const my_locator& loc, coord_t y_step);
    +
    my_locator(const my_locator& loc, coord_t x_step, coord_t y_step, bool transpose);
    +
    +
    bool operator==(const my_locator& p) const;
    +
    +
    // return _references_ to horizontal/vertical iterators. Advancing them moves this locator
    +
    x_iterator& x();
    +
    y_iterator& y();
    +
    x_iterator const& x() const;
    +
    y_iterator const& y() const;
    +
    +
    // return the vertical distance to another locator. Some models need the horizontal distance to compute it
    +
    y_coord_t y_distance_to(const my_locator& loc2, x_coord_t xDiff) const;
    +
    +
    // return true iff incrementing an x-iterator located at the last column will position it at the first
    +
    // column of the next row. Some models need the image width to determine that.
    +
    bool is_1d_traversable(x_coord_t width) const;
    +
    };
    +

    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: +
    BOOST_FORCEINLINE bool operator==(const point< T > &p1, const point< T > &p2)
    Definition: point.hpp:129
    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1point-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1point-members.html index 15839203c..a4e819dd4 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1point-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1point-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@
    - - - + + + + +
    - - - + + + @@ -78,7 +70,7 @@ diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1point.html b/develop/doc/html/reference/classboost_1_1gil_1_1point.html index 265809658..fd69df828 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1point.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1point.html @@ -4,7 +4,7 @@ - + Generic Image Library: point< T > Class Template Reference @@ -27,24 +27,16 @@
    - - - + + + + +
    -

    2D point both axes of which have the same dimension typeModels: Point2DConcept +

    2D point both axes of which have the same dimension type More...

    #include <point.hpp>

    Friends

    +
    template<typename X >
    class pixel_2d_locator
     
    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::size_t i) 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) (defined in point< T >)point< T >inline
    point()=default (defined in point< T >)point< T >
    point(T px, T py) (defined in point< T >)point< T >inline
    -

    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
     
    +
    +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
     
    @@ -122,8 +114,8 @@ static constexpr std::size_t 

    template<typename T>
    class boost::gil::point< T >

    -

    2D point both axes of which have the same dimension type

    -

    Models: Point2DConcept

    +

    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
    • point.hpp
    • @@ -134,7 +126,7 @@ class boost::gil::point< T > diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1promote__integral-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1promote__integral-members.html index 3dc38a82c..c0fcafeef 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1promote__integral-members.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1promote__integral-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,24 +27,16 @@

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

    A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept. +

    A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept. More...

    #include <virtual_locator.hpp>

    @@ -70,195 +61,188 @@ Inheritance diagram for virtual_2d_locator< DerefFn, IsTransposed >:
    - + pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-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 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
     
    +
    +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
     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 (const point_t &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
     
    - - - - +

    -Friends

    -template<typename D , bool TR>
    class virtual_2d_locator
     
     
    -

    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
     
    @@ -266,16 +250,18 @@ static const std::size_t n

    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.

    +

    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
    - +
    DerefFnFunction object that given a point returns a reference. Models PixelDereferenceAdaptorConcept.
    DerefFnFunction object that given a point returns a reference. Models PixelDereferenceAdaptorConcept.
    IsTransposedIndicates if locator should navigate in transposed mode.

    Member Function Documentation

    - + +

    ◆ is_1d_traversable()

    +
    @@ -296,7 +282,7 @@ class boost::gil::virtual_2d_locator< DerefFn, IsTransposed >
    -
    Todo:
    TODO: is there no gap at the end of each row? i.e. can we use x_iterator to visit every pixel instead of nested loops?
    +
    Todo:
    TODO: is there no gap at the end of each row? i.e. can we use x_iterator to visit every pixel instead of nested loops?
    @@ -309,7 +295,7 @@ class boost::gil::virtual_2d_locator< DerefFn, IsTransposed > diff --git a/develop/doc/html/reference/classes.html b/develop/doc/html/reference/classes.html index 6f6b29e80..56c72e815 100644 --- a/develop/doc/html/reference/classes.html +++ b/develop/doc/html/reference/classes.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class Index @@ -27,175 +27,456 @@

    - - - + + + + +
    Class Index
    -
    A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | V | Y
    +
    a | b | c | d | e | f | g | h | i | k | l | m | n | o | p | r | s | t | v | y
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      A  
    -
    bit_aligned_image1_type (boost::gil)   homogeneous_color_base< Element, Layout, 5 > (boost::gil::detail)   
    bit_aligned_image2_type (boost::gil)   
      i  
    -
    Assignable (boost::gil)   bit_aligned_image3_type (boost::gil)   
      C  
    -
    bit_aligned_image4_type (boost::gil)   identity (boost::gil::detail)   
    bit_aligned_image5_type (boost::gil)   image (boost::gil)   
    ChannelConcept (boost::gil)   bit_aligned_image_type (boost::gil)   image_is_basic (boost::gil)   
    ChannelConvertibleConcept (boost::gil)   bit_aligned_pixel_iterator (boost::gil)   image_type (boost::gil)   
    ChannelIsMutableConcept (boost::gil::detail)   bit_range (boost::gil)   image_view (boost::gil)   
    ChannelMappingConcept (boost::gil)   black_t (boost::gil)   inc (boost::gil::detail)   
    ChannelsCompatibleConcept (boost::gil)   blue_t (boost::gil)   is_input_device (boost::gil::detail)   
    ChannelValueConcept (boost::gil)   byte_to_memunit (boost::gil)   is_iterator_adaptor (boost::gil)   
    CollectionImageViewConcept (boost::gil)   
      c  
    -
    is_output_device (boost::gil::detail)   
    ColorBaseConcept (boost::gil)   is_pixel< bit_aligned_pixel_reference< B, C, L, M > > (boost::gil)   
    ColorBasesCompatibleConcept (boost::gil)   channel_converter (boost::gil)   is_pixel< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   
    ColorBaseValueConcept (boost::gil)   channel_converter_unsigned< float32_t, DstChannelV > (boost::gil)   is_planar< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   
    ColorSpaceConcept (boost::gil)   channel_converter_unsigned< float32_t, uint32_t > (boost::gil)   is_read_device (boost::gil::detail)   
    ColorSpacesCompatibleConcept (boost::gil)   channel_converter_unsigned< T, T > (boost::gil)   is_read_only (boost::gil::detail)   
    CopyConstructible (boost::gil)   channel_converter_unsigned< uint32_t, float32_t > (boost::gil)   is_read_supported (boost::gil)   
      D  
    -
    channel_converter_unsigned_impl (boost::gil::detail)   is_write_device (boost::gil::detail)   
    channel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   istream_device (boost::gil::detail)   
    DefaultConstructible (boost::gil)   channel_multiplier (boost::gil)   iterator_adaptor_get_base (boost::gil)   
      E  
    -
    channel_multiplier_unsigned (boost::gil)   iterator_adaptor_rebind (boost::gil)   
    channel_multiplier_unsigned< float32_t > (boost::gil)   iterator_add_deref (boost::gil)   
    EqualityComparable (boost::gil)   channel_multiplier_unsigned< uint16_t > (boost::gil)   iterator_add_deref< dereference_iterator_adaptor< Iterator, PREV_DEREF >, Deref > (boost::gil)   
      F  
    -
    channel_multiplier_unsigned< uint8_t > (boost::gil)   iterator_from_2d (boost::gil)   
    channel_type (boost::gil)   iterator_is_basic (boost::gil)   
    ForwardCollectionImageViewConcept (boost::gil)   channel_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   iterator_is_basic< memory_based_step_iterator< pixel< T, L > * > > (boost::gil)   
      H  
    -
    channels_are_compatible (boost::gil)   iterator_is_basic< memory_based_step_iterator< pixel< T, L > const * > > (boost::gil)   
    color_convert_deref_fn (boost::gil)   iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T *, CS > > > (boost::gil)   
    HasDynamicXStepTypeConcept (boost::gil)   color_converted_view_type (boost::gil)   iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T const *, CS > > > (boost::gil)   
    HasDynamicYStepTypeConcept (boost::gil)   color_converted_view_type< any_image_view< Views... >, DstP > (boost::gil)   iterator_is_basic< pixel< T, L > * > (boost::gil)   
    HasTransposedTypeConcept (boost::gil)   color_converted_view_type< any_image_view< Views... >, DstP, CC > (boost::gil)   iterator_is_basic< pixel< T, L > const * > (boost::gil)   
    HomogeneousColorBaseConcept (boost::gil)   color_element_const_reference_type (boost::gil)   iterator_is_basic< planar_pixel_iterator< T *, CS > > (boost::gil)   
    HomogeneousColorBaseValueConcept (boost::gil)   color_element_reference_type (boost::gil)   iterator_is_basic< planar_pixel_iterator< T const *, CS > > (boost::gil)   
    HomogeneousPixelBasedConcept (boost::gil)   color_element_type (boost::gil)   iterator_is_mutable (boost::gil)   
    HomogeneousPixelConcept (boost::gil)   color_space_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   iterator_is_step (boost::gil)   
    HomogeneousPixelValueConcept (boost::gil)   const_iterator_type (boost::gil)   iterator_type (boost::gil)   
      I  
    -
    contains_color (boost::gil)   iterator_type_from_pixel (boost::gil)   
    copier_n (boost::gil::detail)   
      k  
    -
    ImageConcept (boost::gil)   copier_n< I, iterator_from_2d< OL > > (boost::gil::detail)   
    ImageViewConcept (boost::gil)   copier_n< iterator_from_2d< IL >, iterator_from_2d< OL > > (boost::gil::detail)   kth_channel_deref_fn (boost::gil::detail)   
    IteratorAdaptorConcept (boost::gil)   copier_n< iterator_from_2d< IL >, O > (boost::gil::detail)   kth_channel_view_type (boost::gil)   
      M  
    -
    cyan_t (boost::gil)   kth_semantic_element_const_reference_type (boost::gil)   
      d  
    -
    kth_semantic_element_reference_type (boost::gil)   
    MemoryBasedIteratorConcept (boost::gil)   kth_semantic_element_type (boost::gil)   
    Metafunction (boost::gil)   dec (boost::gil::detail)   
      l  
    -
    MutableChannelConcept (boost::gil)   default_channel_converter (boost::gil)   
    MutableColorBaseConcept (boost::gil)   default_color_converter (boost::gil)   layout (boost::gil)   
    MutableHomogeneousColorBaseConcept (boost::gil)   default_color_converter_impl (boost::gil)   locator_is_basic (boost::gil)   
    MutableHomogeneousPixelConcept (boost::gil)   default_color_converter_impl< C, C > (boost::gil)   locator_is_mutable (boost::gil)   
    MutableImageViewConcept (boost::gil)   default_color_converter_impl< C1, rgba_t > (boost::gil)   locator_is_step_in_x (boost::gil)   
    MutableIteratorAdaptorConcept (boost::gil)   default_color_converter_impl< cmyk_t, gray_t > (boost::gil)   locator_is_step_in_y (boost::gil)   
    MutablePixelConcept (boost::gil)   default_color_converter_impl< cmyk_t, rgb_t > (boost::gil)   locator_type (boost::gil)   
    MutablePixelIteratorConcept (boost::gil)   default_color_converter_impl< gray_t, cmyk_t > (boost::gil)   
      m  
    -
    MutablePixelLocatorConcept (boost::gil)   default_color_converter_impl< gray_t, rgb_t > (boost::gil)   
    MutableRandomAccess2DImageViewConcept (boost::gil)   default_color_converter_impl< rgb_t, cmyk_t > (boost::gil)   magenta_t (boost::gil)   
    MutableRandomAccess2DLocatorConcept (boost::gil)   default_color_converter_impl< rgb_t, gray_t > (boost::gil)   memory_based_2d_locator (boost::gil)   
    MutableRandomAccessNDImageViewConcept (boost::gil)   default_color_converter_impl< rgba_t, C2 > (boost::gil)   memory_based_step_iterator (boost::gil)   
    MutableRandomAccessNDLocatorConcept (boost::gil)   default_color_converter_impl< rgba_t, rgba_t > (boost::gil)   memunit_step_fn (boost::gil)   
    MutableStepIteratorConcept (boost::gil)   deref_base (boost::gil)   
      n  
    -
      P  
    -
    deref_compose (boost::gil)   
    dereference_iterator_adaptor (boost::gil)   nth_channel_deref_fn (boost::gil::detail)   
    PixelBasedConcept (boost::gil)   derived_image_type (boost::gil)   nth_channel_view_type (boost::gil)   
    PixelConcept (boost::gil)   derived_iterator_type (boost::gil)   nth_channel_view_type< any_image_view< Views... > > (boost::gil)   
    PixelConvertibleConcept (boost::gil)   derived_pixel_reference_type (boost::gil)   num_channels (boost::gil)   
    PixelDereferenceAdaptorConcept (boost::gil)   derived_view_type (boost::gil)   
      o  
    -
    PixelImageViewIsMutableConcept (boost::gil::detail)   devicen_color_t (boost::gil)   
    PixelIteratorConcept (boost::gil)   devicen_layout_t (boost::gil)   ostream_device (boost::gil::detail)   
    PixelIteratorIsMutableConcept (boost::gil::detail)   devicen_t (boost::gil)   
      p  
    -
    PixelLocatorConcept (boost::gil)   dynamic_x_step_type (boost::gil)   
    PixelsCompatibleConcept (boost::gil)   dynamic_xy_step_transposed_type (boost::gil)   packed_dynamic_channel_reference< BitField, NumBits, false > (boost::gil)   
    PixelValueConcept (boost::gil)   dynamic_xy_step_type (boost::gil)   packed_dynamic_channel_reference< BitField, NumBits, true > (boost::gil)   
    Point2DConcept (boost::gil)   dynamic_y_step_type (boost::gil)   packed_image1_type (boost::gil)   
    PointNDConcept (boost::gil)   
      e  
    -
    packed_image2_type (boost::gil)   
      R  
    -
    packed_image3_type (boost::gil)   
    element_const_reference_type (boost::gil)   packed_image4_type (boost::gil)   
    RandomAccess2DImageConcept (boost::gil)   element_reference_type (boost::gil)   packed_image5_type (boost::gil)   
    RandomAccess2DImageViewConcept (boost::gil)   element_type (boost::gil)   packed_image_type (boost::gil)   
    RandomAccess2DImageViewIsMutableConcept (boost::gil::detail)   equal_n_fn< boost::gil::iterator_from_2d< Loc >, It > (boost::gil::detail)   packed_pixel (boost::gil)   
    RandomAccess2DLocatorConcept (boost::gil)   equal_n_fn< boost::gil::iterator_from_2d< Loc1 >, boost::gil::iterator_from_2d< Loc2 > > (boost::gil::detail)   packed_pixel_type (boost::gil)   
    RandomAccessNDImageConcept (boost::gil)   equal_n_fn< It, boost::gil::iterator_from_2d< Loc > > (boost::gil::detail)   pixel (boost::gil)   
    RandomAccessNDImageViewConcept (boost::gil)   equal_n_fn< pixel< T, CS > const *, pixel< T, CS > const * > (boost::gil::detail)   pixel_2d_locator_base (boost::gil)   
    RandomAccessNDImageViewIsMutableConcept (boost::gil::detail)   equal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > > (boost::gil::detail)   pixel_is_reference (boost::gil)   
    RandomAccessNDLocatorConcept (boost::gil)   
      f  
    -
    pixel_reference_is_basic (boost::gil)   
    RandomAccessNDLocatorIsMutableConcept (boost::gil::detail)   pixel_reference_is_mutable (boost::gil)   
    Regular (boost::gil)   file_stream_device (boost::gil::detail)   pixel_reference_is_proxy (boost::gil)   
    ReversibleCollectionImageViewConcept (boost::gil)   
      g  
    -
    pixel_reference_type (boost::gil)   
      S  
    -
    pixel_value_type (boost::gil)   
    get_dynamic_image_reader (boost::gil)   pixels_are_compatible (boost::gil)   
    SameType (boost::gil)   get_dynamic_image_writer (boost::gil)   planar_pixel_iterator (boost::gil)   
    StepIteratorConcept (boost::gil)   get_reader (boost::gil)   planar_pixel_reference (boost::gil)   
    Swappable (boost::gil)   get_reader_backend (boost::gil)   plus_asymmetric (boost::gil::detail)   
      V  
    -
    get_scanline_reader (boost::gil)   point (boost::gil)   
    get_writer (boost::gil)   position_iterator (boost::gil)   
    ViewsCompatibleConcept (boost::gil)   gray_color_t (boost::gil)   promote_integral (boost::gil)   
      a  
    -
    green_t (boost::gil)   
      r  
    -
      h  
    -
    alpha_t (boost::gil)   file_stream_device::read_tag (boost::gil::detail)   
    any_image (boost::gil)   homogeneous_color_base< Element, Layout, 1 > (boost::gil::detail)   reader_base (boost::gil)   
    any_image_view (boost::gil)   homogeneous_color_base< Element, Layout, 2 > (boost::gil::detail)   red_t (boost::gil)   
    equal_n_fn< pixel< T, CS > const *, pixel< T, CS > const * > (boost::gil::detail)   MutablePixelConcept (boost::gil)   
    equal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > > (boost::gil::detail)   MutablePixelIteratorConcept (boost::gil)   
    alpha_t (boost::gil)   EqualityComparable (boost::gil)   MutablePixelLocatorConcept (boost::gil)   
    any_image (boost::gil)   
      f  
    +
    MutableRandomAccess2DImageViewConcept (boost::gil)   
    any_image_view (boost::gil)   MutableRandomAccess2DLocatorConcept (boost::gil)   
    Assignable (boost::gil)   file_stream_device (boost::gil::detail)   MutableRandomAccessNDImageViewConcept (boost::gil)   
      b  
    -
    homogeneous_color_base< Element, Layout, 3 > (boost::gil::detail)   rgb_to_luminance_fn (boost::gil::detail)   
    homogeneous_color_base< Element, Layout, 4 > (boost::gil::detail)   
      s  
    -
    binary_operation_obj (boost::gil)   
    scanline_read_iterator (boost::gil)   
    filler (boost::gil::detail)   MutableRandomAccessNDLocatorConcept (boost::gil)   
    filler< 1 > (boost::gil::detail)   MutableStepIteratorConcept (boost::gil)   
    binary_operation_obj (boost::gil)   ForwardCollectionImageViewConcept (boost::gil)   
      n  
    +
    bit_aligned_image1_type (boost::gil)   
      g  
    +
    bit_aligned_image2_type (boost::gil)   nth_channel_deref_fn (boost::gil::detail)   
    bit_aligned_image3_type (boost::gil)   get_dynamic_image_reader (boost::gil)   nth_channel_view_type (boost::gil)   
    bit_aligned_image4_type (boost::gil)   get_dynamic_image_writer (boost::gil)   nth_channel_view_type< any_image_view< Views... > > (boost::gil)   
    bit_aligned_image5_type (boost::gil)   get_reader (boost::gil)   num_channels (boost::gil)   
    bit_aligned_image_type (boost::gil)   get_reader_backend (boost::gil)   
      o  
    +
    bit_aligned_pixel_iterator (boost::gil)   get_scanline_reader (boost::gil)   
    bit_range (boost::gil)   get_writer (boost::gil)   ostream_device (boost::gil::detail)   
    black_t (boost::gil)   gray_color_t (boost::gil)   
      p  
    +
    blue_t (boost::gil)   green_t (boost::gil)   
    byte_to_memunit (boost::gil)   
      h  
    +
    packed_dynamic_channel_reference< BitField, NumBits, false > (boost::gil)   
      c  
    +
    packed_dynamic_channel_reference< BitField, NumBits, true > (boost::gil)   
    HasDynamicXStepTypeConcept (boost::gil)   packed_image1_type (boost::gil)   
    channel_converter (boost::gil)   HasDynamicYStepTypeConcept (boost::gil)   packed_image2_type (boost::gil)   
    channel_converter_unsigned< float32_t, DstChannelV > (boost::gil)   hash_tuple (boost::gil::detail)   packed_image3_type (boost::gil)   
    channel_converter_unsigned< float32_t, uint32_t > (boost::gil)   HasTransposedTypeConcept (boost::gil)   packed_image4_type (boost::gil)   
    channel_converter_unsigned< T, T > (boost::gil)   histogram (boost::gil)   packed_image5_type (boost::gil)   
    channel_converter_unsigned< uint32_t, float32_t > (boost::gil)   homogeneous_color_base< Element, Layout, 1 > (boost::gil::detail)   packed_image_type (boost::gil)   
    channel_converter_unsigned_impl (boost::gil::detail)   homogeneous_color_base< Element, Layout, 2 > (boost::gil::detail)   packed_pixel (boost::gil)   
    channel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   homogeneous_color_base< Element, Layout, 3 > (boost::gil::detail)   packed_pixel_type (boost::gil)   
    channel_multiplier (boost::gil)   homogeneous_color_base< Element, Layout, 4 > (boost::gil::detail)   pixel (boost::gil)   
    channel_multiplier_unsigned (boost::gil)   homogeneous_color_base< Element, Layout, 5 > (boost::gil::detail)   pixel_2d_locator_base (boost::gil)   
    channel_multiplier_unsigned< float32_t > (boost::gil)   HomogeneousColorBaseConcept (boost::gil)   pixel_is_reference (boost::gil)   
    channel_multiplier_unsigned< uint16_t > (boost::gil)   HomogeneousColorBaseValueConcept (boost::gil)   pixel_reference_is_basic (boost::gil)   
    channel_multiplier_unsigned< uint8_t > (boost::gil)   HomogeneousPixelBasedConcept (boost::gil)   pixel_reference_is_mutable (boost::gil)   
    channel_type (boost::gil)   HomogeneousPixelConcept (boost::gil)   pixel_reference_is_proxy (boost::gil)   
    channel_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   HomogeneousPixelValueConcept (boost::gil)   pixel_reference_type (boost::gil)   
    ChannelConcept (boost::gil)   hough_parameter (boost::gil)   pixel_value_type (boost::gil)   
    ChannelConvertibleConcept (boost::gil)   
      i  
    +
    PixelBasedConcept (boost::gil)   
    ChannelIsMutableConcept (boost::gil::detail)   PixelConcept (boost::gil)   
    ChannelMappingConcept (boost::gil)   identity (boost::gil::detail)   PixelConvertibleConcept (boost::gil)   
    channels_are_compatible (boost::gil)   image (boost::gil)   PixelDereferenceAdaptorConcept (boost::gil)   
    ChannelsCompatibleConcept (boost::gil)   image_is_basic (boost::gil)   PixelImageViewIsMutableConcept (boost::gil::detail)   
    ChannelValueConcept (boost::gil)   image_type (boost::gil)   PixelIteratorConcept (boost::gil)   
    CollectionImageViewConcept (boost::gil)   image_view (boost::gil)   PixelIteratorIsMutableConcept (boost::gil::detail)   
    color_convert_deref_fn (boost::gil)   ImageConcept (boost::gil)   PixelLocatorConcept (boost::gil)   
    color_converted_view_type (boost::gil)   ImageViewConcept (boost::gil)   pixels_are_compatible (boost::gil)   
    color_converted_view_type< any_image_view< Views... >, DstP > (boost::gil)   inc (boost::gil::detail)   PixelsCompatibleConcept (boost::gil)   
    color_converted_view_type< any_image_view< Views... >, DstP, CC > (boost::gil)   is_input_device (boost::gil::detail)   PixelValueConcept (boost::gil)   
    color_element_const_reference_type (boost::gil)   is_iterator_adaptor (boost::gil)   planar_pixel_iterator (boost::gil)   
    color_element_reference_type (boost::gil)   is_output_device (boost::gil::detail)   planar_pixel_reference (boost::gil)   
    color_element_type (boost::gil)   is_pixel< bit_aligned_pixel_reference< B, C, L, M > > (boost::gil)   plus_asymmetric (boost::gil::detail)   
    color_space_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   is_pixel< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   point (boost::gil)   
    ColorBaseConcept (boost::gil)   is_planar< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)   Point2DConcept (boost::gil)   
    ColorBasesCompatibleConcept (boost::gil)   is_read_device (boost::gil::detail)   PointNDConcept (boost::gil)   
    ColorBaseValueConcept (boost::gil)   is_read_only (boost::gil::detail)   position_iterator (boost::gil)   
    ColorSpaceConcept (boost::gil)   is_read_supported (boost::gil)   promote_integral (boost::gil)   
    ColorSpacesCompatibleConcept (boost::gil)   is_write_device (boost::gil::detail)   
      r  
    +
    const_iterator_type (boost::gil)   istream_device (boost::gil::detail)   
    contains_color (boost::gil)   iterator_adaptor_get_base (boost::gil)   RandomAccess2DImageConcept (boost::gil)   
    copier_n (boost::gil::detail)   iterator_adaptor_rebind (boost::gil)   RandomAccess2DImageViewConcept (boost::gil)   
    copier_n< I, iterator_from_2d< OL > > (boost::gil::detail)   iterator_add_deref (boost::gil)   RandomAccess2DImageViewIsMutableConcept (boost::gil::detail)   
    copier_n< iterator_from_2d< IL >, iterator_from_2d< OL > > (boost::gil::detail)   iterator_add_deref< dereference_iterator_adaptor< Iterator, PREV_DEREF >, Deref > (boost::gil)   RandomAccess2DLocatorConcept (boost::gil)   
    copier_n< iterator_from_2d< IL >, O > (boost::gil::detail)   iterator_from_2d (boost::gil)   RandomAccessNDImageConcept (boost::gil)   
    CopyConstructible (boost::gil)   iterator_is_basic (boost::gil)   RandomAccessNDImageViewConcept (boost::gil)   
    cyan_t (boost::gil)   iterator_is_basic< memory_based_step_iterator< pixel< T, L > * > > (boost::gil)   RandomAccessNDImageViewIsMutableConcept (boost::gil::detail)   
      d  
    +
    iterator_is_basic< memory_based_step_iterator< pixel< T, L > const * > > (boost::gil)   RandomAccessNDLocatorConcept (boost::gil)   
    iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T *, CS > > > (boost::gil)   RandomAccessNDLocatorIsMutableConcept (boost::gil::detail)   
    dec (boost::gil::detail)   iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T const *, CS > > > (boost::gil)   file_stream_device::read_tag (boost::gil::detail)   
    default_channel_converter (boost::gil)   iterator_is_basic< pixel< T, L > * > (boost::gil)   reader_base (boost::gil)   
    default_color_converter (boost::gil)   iterator_is_basic< pixel< T, L > const * > (boost::gil)   red_t (boost::gil)   
    default_color_converter_impl (boost::gil)   iterator_is_basic< planar_pixel_iterator< T *, CS > > (boost::gil)   Regular (boost::gil)   
    default_color_converter_impl< C, C > (boost::gil)   iterator_is_basic< planar_pixel_iterator< T const *, CS > > (boost::gil)   ReversibleCollectionImageViewConcept (boost::gil)   
    default_color_converter_impl< C1, rgba_t > (boost::gil)   iterator_is_mutable (boost::gil)   rgb_to_luminance_fn (boost::gil::detail)   
    default_color_converter_impl< cmyk_t, gray_t > (boost::gil)   iterator_is_step (boost::gil)   
      s  
    +
    default_color_converter_impl< cmyk_t, rgb_t > (boost::gil)   iterator_type (boost::gil)   
    default_color_converter_impl< gray_t, cmyk_t > (boost::gil)   iterator_type_from_pixel (boost::gil)   SameType (boost::gil)   
    default_color_converter_impl< gray_t, rgb_t > (boost::gil)   IteratorAdaptorConcept (boost::gil)   scanline_read_iterator (boost::gil)   
    default_color_converter_impl< rgb_t, cmyk_t > (boost::gil)   
      k  
    +
    size (boost::gil)   
    default_color_converter_impl< rgb_t, gray_t > (boost::gil)   std_fill_t (boost::gil::detail)   
    default_color_converter_impl< rgba_t, C2 > (boost::gil)   kth_channel_deref_fn (boost::gil::detail)   stencil_5points (boost::gil::laplace_function)   
    default_color_converter_impl< rgba_t, rgba_t > (boost::gil)   kth_channel_view_type (boost::gil)   stencil_9points_standard (boost::gil::laplace_function)   
    DefaultConstructible (boost::gil)   kth_semantic_element_const_reference_type (boost::gil)   step_iterator_adaptor (boost::gil::detail)   
    deref_base (boost::gil)   kth_semantic_element_reference_type (boost::gil)   StepIteratorConcept (boost::gil)   
    deref_compose (boost::gil)   kth_semantic_element_type (boost::gil)   Swappable (boost::gil)   
    dereference_iterator_adaptor (boost::gil)   
      l  
    +
      t  
    +
    derived_image_type (boost::gil)   
    derived_iterator_type (boost::gil)   layout (boost::gil)   transposed_type (boost::gil)   
    derived_pixel_reference_type (boost::gil)   locator_is_basic (boost::gil)   tuple_limit (boost::gil::detail)   
    derived_view_type (boost::gil)   locator_is_mutable (boost::gil)   type_from_x_iterator (boost::gil)   
    devicen_color_t (boost::gil)   locator_is_step_in_x (boost::gil)   type_to_index (boost::gil::detail)   
    devicen_layout_t (boost::gil)   locator_is_step_in_y (boost::gil)   
      v  
    +
    devicen_t (boost::gil)   locator_type (boost::gil)   
    dynamic_x_step_type (boost::gil)   
      m  
    +
    view_is_basic (boost::gil)   
    dynamic_x_step_type< const Pixel * > (boost::gil)   view_is_mutable (boost::gil)   
    dynamic_x_step_type< Pixel * > (boost::gil)   magenta_t (boost::gil)   view_is_step_in_x (boost::gil)   
    dynamic_xy_step_transposed_type (boost::gil)   memory_based_2d_locator (boost::gil)   view_is_step_in_y (boost::gil)   
    dynamic_xy_step_type (boost::gil)   memory_based_step_iterator (boost::gil)   view_type (boost::gil)   
    dynamic_y_step_type (boost::gil)   MemoryBasedIteratorConcept (boost::gil)   view_type_from_pixel (boost::gil)   
      e  
    +
    memunit_step_fn (boost::gil)   views_are_compatible (boost::gil)   
    Metafunction (boost::gil)   ViewsCompatibleConcept (boost::gil)   
    element_const_reference_type (boost::gil)   MutableChannelConcept (boost::gil)   virtual_2d_locator (boost::gil)   
    element_reference_type (boost::gil)   MutableColorBaseConcept (boost::gil)   
      y  
    +
    element_type (boost::gil)   MutableHomogeneousColorBaseConcept (boost::gil)   
    equal_n_fn< boost::gil::iterator_from_2d< Loc >, It > (boost::gil::detail)   MutableHomogeneousPixelConcept (boost::gil)   yellow_t (boost::gil)   
    equal_n_fn< boost::gil::iterator_from_2d< Loc1 >, boost::gil::iterator_from_2d< Loc2 > > (boost::gil::detail)   MutableImageViewConcept (boost::gil)   
    equal_n_fn< It, boost::gil::iterator_from_2d< Loc > > (boost::gil::detail)   MutableIteratorAdaptorConcept (boost::gil)   
    -
    A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | V | Y
    +
    a | b | c | d | e | f | g | h | i | k | l | m | n | o | p | r | s | t | v | y
    diff --git a/develop/doc/html/reference/cmyk_8hpp_source.html b/develop/doc/html/reference/cmyk_8hpp_source.html index c40d39c0a..893016ab9 100644 --- a/develop/doc/html/reference/cmyk_8hpp_source.html +++ b/develop/doc/html/reference/cmyk_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: cmyk.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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>
    44 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
    Magenta.
    Definition: cmyk.hpp:25
    -
    Definition: algorithm.hpp:30
    -
    Yellow.
    Definition: cmyk.hpp:28
    -
    An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
    Definition: algorithm.hpp:34
    -
    Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
    Definition: metafunctions.hpp:301
    -
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    -
    Black.
    Definition: cmyk.hpp:31
    -
    Cyan.
    Definition: cmyk.hpp:22
    -
    type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t > >::view_t 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)
    from raw CMYK planar data
    Definition: cmyk.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_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>
    + +
    44 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
    +
    Yellow.
    Definition: cmyk.hpp:28
    +
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    +
    type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t > >::view_t 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)
    from raw CMYK planar data
    Definition: cmyk.hpp:44
    +
    Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
    Definition: metafunctions.hpp:301
    +
    Black.
    Definition: cmyk.hpp:31
    +
    Cyan.
    Definition: cmyk.hpp:22
    +
    mp11::mp_list< cyan_t, magenta_t, yellow_t, black_t > cmyk_t
    Definition: cmyk.hpp:35
    +
    Magenta.
    Definition: cmyk.hpp:25
    +
    An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
    Definition: algorithm.hpp:34
    diff --git a/develop/doc/html/reference/color_8hpp_source.html b/develop/doc/html/reference/color_8hpp_source.html index 7ed2a278f..d2a0fdd6f 100644 --- a/develop/doc/html/reference/color_8hpp_source.html +++ b/develop/doc/html/reference/color_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    Channel mapping concept.
    Definition: color.hpp:78
    -
    Color space type concept.
    Definition: color.hpp:37
    -
    Two color spaces are compatible if they are the same.
    Definition: color.hpp:60
    +
    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
    +
    Two color spaces are compatible if they are the same.
    Definition: color.hpp:60
    +
    Color space type concept.
    Definition: color.hpp:37
    +
    Channel mapping concept.
    Definition: color.hpp:78
    diff --git a/develop/doc/html/reference/color__base_8hpp_source.html b/develop/doc/html/reference/color__base_8hpp_source.html index 80cdfcde2..86657190e 100644 --- a/develop/doc/html/reference/color__base_8hpp_source.html +++ b/develop/doc/html/reference/color__base_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_base.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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 typename kth_semantic_element_const_reference_type<ColorBase,K>::type semantic_at_c(const ColorBase& p);
    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  homogeneous_color_base() = default;
    83  homogeneous_color_base(Element v) : v0_(v) {}
    84 
    85  template <typename E2, typename L2>
    86  homogeneous_color_base(homogeneous_color_base<E2, L2, 1> const& c)
    87  : v0_(gil::at_c<0>(c))
    88  {}
    89 
    90  auto at(std::integral_constant<int, 0>)
    92  { return v0_; }
    93 
    94  auto at(std::integral_constant<int, 0>) const
    96  { return v0_; }
    97 
    98  // grayscale pixel values are convertible to channel type
    99  // FIXME: explicit?
    100  operator Element() const { return v0_; }
    101 
    102 private:
    103  Element v0_{};
    104 };
    105 
    109 template <typename Element, typename Layout>
    110 struct homogeneous_color_base<Element, Layout, 2>
    111 {
    112  using layout_t = Layout;
    113 
    114  homogeneous_color_base() = default;
    115  explicit homogeneous_color_base(Element v) : v0_(v), v1_(v) {}
    116  homogeneous_color_base(Element v0, Element v1) : v0_(v0), v1_(v1) {}
    117 
    118  template <typename E2, typename L2>
    119  homogeneous_color_base(homogeneous_color_base<E2, L2, 2> const& c)
    120  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    121  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    122  {}
    123 
    124  // Support for l-value reference proxy copy construction
    125  template <typename E2, typename L2>
    126  homogeneous_color_base(homogeneous_color_base<E2, L2, 2>& c)
    127  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    128  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    129  {}
    130 
    131  // Support for planar_pixel_iterator construction and dereferencing
    132  template <typename P>
    133  homogeneous_color_base(P* p, bool)
    134  : v0_(&semantic_at_c<0>(*p))
    135  , v1_(&semantic_at_c<1>(*p))
    136  {}
    137 
    138  // Support for planar_pixel_reference offset constructor
    139  template <typename Ptr>
    140  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
    141  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
    142  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
    143  {}
    144 
    145  template <typename Ref>
    146  Ref deref() const
    147  {
    148  return Ref(*semantic_at_c<0>(*this), *semantic_at_c<1>(*this));
    149  }
    150 
    151  auto at(std::integral_constant<int, 0>)
    153  { return v0_; }
    154 
    155  auto at(std::integral_constant<int, 0>) const
    157  { return v0_; }
    158 
    159  auto at(std::integral_constant<int, 1>)
    161  { return v1_; }
    162 
    163  auto at(std::integral_constant<int, 1>) const
    165  { return v1_; }
    166 
    167  // Support for planar_pixel_reference operator[]
    168  Element at_c_dynamic(std::size_t i) const
    169  {
    170  if (i == 0)
    171  return v0_;
    172  else
    173  return v1_;
    174  }
    175 
    176 private:
    177  Element v0_{};
    178  Element v1_{};
    179 };
    180 
    184 template <typename Element, typename Layout>
    185 struct homogeneous_color_base<Element, Layout, 3>
    186 {
    187  using layout_t = Layout;
    188 
    189  homogeneous_color_base() = default;
    190  explicit homogeneous_color_base(Element v) : v0_(v), v1_(v), v2_(v) {}
    191  homogeneous_color_base(Element v0, Element v1, Element v2)
    192  : v0_(v0), v1_(v1), v2_(v2)
    193  {}
    194 
    195  template <typename E2, typename L2>
    196  homogeneous_color_base(homogeneous_color_base<E2, L2, 3> const& c)
    197  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    198  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    199  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
    200  {}
    201 
    202  // Support for l-value reference proxy copy construction
    203  template <typename E2, typename L2>
    204  homogeneous_color_base(homogeneous_color_base<E2, L2, 3>& c)
    205  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    206  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    207  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
    208  {}
    209 
    210  // Support for planar_pixel_iterator construction and dereferencing
    211  template <typename P>
    212  homogeneous_color_base(P* p, bool)
    213  : v0_(&semantic_at_c<0>(*p))
    214  , v1_(&semantic_at_c<1>(*p))
    215  , v2_(&semantic_at_c<2>(*p))
    216  {}
    217 
    218  // Support for planar_pixel_reference offset constructor
    219  template <typename Ptr>
    220  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
    221  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
    222  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
    223  , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
    224  {}
    225 
    226  template <typename Ref>
    227  Ref deref() const
    228  {
    229  return Ref(
    230  *semantic_at_c<0>(*this),
    231  *semantic_at_c<1>(*this),
    232  *semantic_at_c<2>(*this));
    233  }
    234 
    235  auto at(std::integral_constant<int, 0>)
    237  { return v0_; }
    238 
    239  auto at(std::integral_constant<int, 0>) const
    241  { return v0_; }
    242 
    243  auto at(std::integral_constant<int, 1>)
    245  { return v1_; }
    246 
    247  auto at(std::integral_constant<int, 1>) const
    249  { return v1_; }
    250 
    251  auto at(std::integral_constant<int, 2>)
    253  { return v2_; }
    254 
    255  auto at(std::integral_constant<int, 2>) const
    257  { return v2_; }
    258 
    259  // Support for planar_pixel_reference operator[]
    260  Element at_c_dynamic(std::size_t i) const
    261  {
    262  switch (i)
    263  {
    264  case 0: return v0_;
    265  case 1: return v1_;
    266  }
    267  return v2_;
    268  }
    269 
    270 private:
    271  Element v0_{};
    272  Element v1_{};
    273  Element v2_{};
    274 };
    275 
    279 template <typename Element, typename Layout>
    280 struct homogeneous_color_base<Element, Layout, 4>
    281 {
    282  using layout_t = Layout;
    283 
    284  homogeneous_color_base() = default;
    285  explicit homogeneous_color_base(Element v) : v0_(v), v1_(v), v2_(v), v3_(v) {}
    286  homogeneous_color_base(Element v0, Element v1, Element v2, Element v3)
    287  : v0_(v0), v1_(v1), v2_(v2), v3_(v3)
    288  {}
    289 
    290  template <typename E2, typename L2>
    291  homogeneous_color_base(homogeneous_color_base<E2, L2, 4> const& c)
    292  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    293  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    294  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
    295  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
    296  {}
    297 
    298  // Support for l-value reference proxy copy construction
    299  template <typename E2, typename L2>
    300  homogeneous_color_base(homogeneous_color_base<E2, L2, 4>& c)
    301  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    302  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    303  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
    304  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
    305  {}
    306 
    307  // Support for planar_pixel_iterator construction and dereferencing
    308  template <typename P>
    309  homogeneous_color_base(P * p, bool)
    310  : v0_(&semantic_at_c<0>(*p))
    311  , v1_(&semantic_at_c<1>(*p))
    312  , v2_(&semantic_at_c<2>(*p))
    313  , v3_(&semantic_at_c<3>(*p))
    314  {}
    315 
    316  // Support for planar_pixel_reference offset constructor
    317  template <typename Ptr>
    318  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
    319  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
    320  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
    321  , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
    322  , v3_(*memunit_advanced(semantic_at_c<3>(ptr), diff))
    323  {}
    324 
    325  template <typename Ref>
    326  Ref deref() const
    327  {
    328  return Ref(
    329  *semantic_at_c<0>(*this),
    330  *semantic_at_c<1>(*this),
    331  *semantic_at_c<2>(*this),
    332  *semantic_at_c<3>(*this));
    333  }
    334 
    335  auto at(std::integral_constant<int, 0>)
    337  { return v0_; }
    338 
    339  auto at(std::integral_constant<int, 0>) const
    341  { return v0_; }
    342 
    343  auto at(std::integral_constant<int, 1>)
    345  { return v1_; }
    346 
    347  auto at(std::integral_constant<int, 1>) const
    349  { return v1_; }
    350 
    351  auto at(std::integral_constant<int, 2>)
    353  { return v2_; }
    354 
    355  auto at(std::integral_constant<int, 2>) const
    357  { return v2_; }
    358 
    359  auto at(std::integral_constant<int, 3>)
    361  { return v3_; }
    362 
    363  auto at(std::integral_constant<int, 3>) const
    365  { return v3_; }
    366 
    367  // Support for planar_pixel_reference operator[]
    368  Element at_c_dynamic(std::size_t i) const
    369  {
    370  switch (i)
    371  {
    372  case 0: return v0_;
    373  case 1: return v1_;
    374  case 2: return v2_;
    375  }
    376  return v3_;
    377  }
    378 
    379 private:
    380  Element v0_{};
    381  Element v1_{};
    382  Element v2_{};
    383  Element v3_{};
    384 };
    385 
    389 template <typename Element, typename Layout>
    390 struct homogeneous_color_base<Element, Layout, 5>
    391 {
    392  using layout_t = Layout;
    393 
    394  homogeneous_color_base() = default;
    395  explicit homogeneous_color_base(Element v)
    396  : v0_(v), v1_(v), v2_(v), v3_(v), v4_(v)
    397  {}
    398 
    399  homogeneous_color_base(Element v0, Element v1, Element v2, Element v3, Element v4)
    400  : v0_(v0), v1_(v1), v2_(v2), v3_(v3), v4_(v4)
    401  {}
    402 
    403  template <typename E2, typename L2>
    404  homogeneous_color_base(homogeneous_color_base<E2, L2, 5> const& c)
    405  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    406  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    407  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
    408  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
    409  , v4_(gil::at_c<mapping_transform<Layout, L2, 4>::value>(c))
    410  {}
    411 
    412  // Support for l-value reference proxy copy construction
    413  template <typename E2, typename L2>
    414  homogeneous_color_base(homogeneous_color_base<E2, L2, 5>& c)
    415  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
    416  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
    417  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
    418  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
    419  , v4_(gil::at_c<mapping_transform<Layout, L2, 4>::value>(c))
    420  {}
    421 
    422  // Support for planar_pixel_iterator construction and dereferencing
    423  template <typename P>
    424  homogeneous_color_base(P* p, bool)
    425  : v0_(&semantic_at_c<0>(*p))
    426  , v1_(&semantic_at_c<1>(*p))
    427  , v2_(&semantic_at_c<2>(*p))
    428  , v3_(&semantic_at_c<3>(*p))
    429  , v4_(&semantic_at_c<4>(*p))
    430  {}
    431 
    432  // Support for planar_pixel_reference offset constructor
    433  template <typename Ptr>
    434  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
    435  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
    436  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
    437  , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
    438  , v3_(*memunit_advanced(semantic_at_c<3>(ptr), diff))
    439  , v4_(*memunit_advanced(semantic_at_c<4>(ptr), diff))
    440  {}
    441 
    442 
    443  auto at(std::integral_constant<int, 0>)
    445  { return v0_; }
    446 
    447  auto at(std::integral_constant<int, 0>) const
    449  { return v0_; }
    450 
    451  auto at(std::integral_constant<int, 1>)
    453  { return v1_; }
    454 
    455  auto at(std::integral_constant<int, 1>) const
    457  { return v1_; }
    458 
    459  auto at(std::integral_constant<int, 2>)
    461  { return v2_; }
    462 
    463  auto at(std::integral_constant<int, 2>) const
    465  { return v2_; }
    466 
    467  auto at(std::integral_constant<int, 3>)
    469  { return v3_; }
    470 
    471  auto at(std::integral_constant<int, 3>) const
    473  { return v3_; }
    474 
    475  auto at(std::integral_constant<int, 4>)
    477  { return v4_; }
    478 
    479  auto at(std::integral_constant<int, 4>) const
    481  { return v4_; }
    482 
    483  template <typename Ref>
    484  Ref deref() const
    485  {
    486  return Ref(
    487  *semantic_at_c<0>(*this),
    488  *semantic_at_c<1>(*this),
    489  *semantic_at_c<2>(*this),
    490  *semantic_at_c<3>(*this),
    491  *semantic_at_c<4>(*this));
    492  }
    493 
    494  // Support for planar_pixel_reference operator[]
    495  Element at_c_dynamic(std::size_t i) const
    496  {
    497  switch (i)
    498  {
    499  case 0: return v0_;
    500  case 1: return v1_;
    501  case 2: return v2_;
    502  case 3: return v3_;
    503  }
    504  return v4_;
    505  }
    506 
    507 private:
    508  Element v0_{};
    509  Element v1_{};
    510  Element v2_{};
    511  Element v3_{};
    512  Element v4_{};
    513 };
    514 
    515 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    516 #pragma warning(pop)
    517 #endif
    518 
    519 // The following way of casting adjacent channels (the contents of color_base) into an array appears to be unsafe
    520 // -- there is no guarantee that the compiler won't add any padding between adjacent channels.
    521 // Note, however, that GIL _must_ be compiled with compiler settings ensuring there is no padding in the color base structs.
    522 // This is because the color base structs must model the interleaved organization in memory. In other words, the client may
    523 // 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)
    524 // with no padding. We have tested with char/int/float/double channels on gcc and VC and have so far discovered no problem.
    525 // We have even tried using strange channels consisting of short + char (3 bytes). With the default 4-byte alignment on VC, the size
    526 // 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.
    527 // However, the client must nevertheless ensure that proper compiler settings are used for their compiler and their channel types.
    528 
    529 template <typename Element, typename Layout, int K>
    530 auto dynamic_at_c(homogeneous_color_base<Element,Layout,K>& cb, std::size_t i)
    532 {
    533  BOOST_ASSERT(i < K);
    534  return (gil_reinterpret_cast<Element*>(&cb))[i];
    535 }
    536 
    537 template <typename Element, typename Layout, int K>
    538 auto dynamic_at_c(homogeneous_color_base<Element, Layout, K> const& cb, std::size_t i)
    539  -> typename element_const_reference_type
    540  <
    541  homogeneous_color_base<Element, Layout, K>
    542  >::type
    543 {
    544  BOOST_ASSERT(i < K);
    545  return (gil_reinterpret_cast_c<const Element*>(&cb))[i];
    546 }
    547 
    548 template <typename Element, typename Layout, int K>
    549 auto dynamic_at_c(homogeneous_color_base<Element&, Layout, K> const& cb, std::size_t i)
    550  -> typename element_reference_type
    551  <
    552  homogeneous_color_base<Element&, Layout, K>
    553  >::type
    554 {
    555  BOOST_ASSERT(i < K);
    556  return cb.at_c_dynamic(i);
    557 }
    558 
    559 template <typename Element, typename Layout, int K>
    560 auto dynamic_at_c(
    561  homogeneous_color_base<Element const&, Layout, K>const& cb, std::size_t i)
    562  -> typename element_const_reference_type
    563  <
    564  homogeneous_color_base<Element const&, Layout, K>
    565  >::type
    566 {
    567  BOOST_ASSERT(i < K);
    568  return cb.at_c_dynamic(i);
    569 }
    570 
    571 } // namespace detail
    572 
    573 template <typename Element, typename Layout, int K1, int K>
    574 struct kth_element_type<detail::homogeneous_color_base<Element, Layout, K1>, K>
    575 {
    576  using type = Element;
    577 };
    578 
    579 template <typename Element, typename Layout, int K1, int K>
    580 struct kth_element_reference_type<detail::homogeneous_color_base<Element, Layout, K1>, K>
    581  : std::add_lvalue_reference<Element>
    582 {};
    583 
    584 template <typename Element, typename Layout, int K1, int K>
    585 struct kth_element_const_reference_type
    586  <
    587  detail::homogeneous_color_base<Element, Layout, K1>,
    588  K
    589  >
    590  : std::add_lvalue_reference<typename std::add_const<Element>::type>
    591 {};
    592 
    595 template <int K, typename E, typename L, int N>
    596 inline
    597 auto at_c(detail::homogeneous_color_base<E, L, N>& p)
    598  -> typename std::add_lvalue_reference<E>::type
    599 {
    600  return p.at(std::integral_constant<int, K>());
    601 }
    602 
    605 template <int K, typename E, typename L, int N>
    606 inline
    607 auto at_c(const detail::homogeneous_color_base<E, L, N>& p)
    608  -> typename std::add_lvalue_reference<typename std::add_const<E>::type>::type
    609 {
    610  return p.at(std::integral_constant<int, K>());
    611 }
    612 
    613 namespace detail
    614 {
    615 
    616 struct swap_fn
    617 {
    618  template <typename T>
    619  void operator()(T& x, T& y) const
    620  {
    621  using std::swap;
    622  swap(x, y);
    623  }
    624 };
    625 
    626 } // namespace detail
    627 
    628 template <typename E, typename L, int N>
    629 inline
    630 void swap(
    631  detail::homogeneous_color_base<E, L, N>& x,
    632  detail::homogeneous_color_base<E, L, N>& y)
    633 {
    634  static_for_each(x, y, detail::swap_fn());
    635 }
    636 
    637 }} // namespace boost::gil
    638 
    639 #endif
    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:607
    -
    Definition: algorithm.hpp:30
    -
    Specifies the return type of the constant element accessor at_c of a homogeneous color base...
    Definition: color_base.hpp:41
    -
    kth_semantic_element_const_reference_type< ColorBase, K >::type semantic_at_c(const ColorBase &p)
    A constant accessor to the K-th semantic element of a color base.
    Definition: color_base_algorithm.hpp:133
    -
    Specifies the return type of the mutable element accessor at_c of a homogeneous color base...
    Definition: color_base.hpp:40
    -
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    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 typename kth_semantic_element_const_reference_type<ColorBase,K>::type semantic_at_c(const ColorBase& p);
    +
    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  Element at_c_dynamic(std::size_t i) const
    +
    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  Element at_c_dynamic(std::size_t i) const
    +
    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  Element at_c_dynamic(std::size_t i) const
    +
    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  Element at_c_dynamic(std::size_t i) const
    +
    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
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    Specifies the return type of the constant element accessor at_c of a homogeneous color base.
    Definition: color_base.hpp:41
    +
    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
    +
    Specifies the return type of the mutable element accessor at_c of a homogeneous color base.
    Definition: color_base.hpp:40
    +
    kth_semantic_element_const_reference_type< ColorBase, K >::type semantic_at_c(const ColorBase &p)
    A constant accessor to the K-th semantic element of a color base.
    Definition: color_base_algorithm.hpp:133
    diff --git a/develop/doc/html/reference/color__base__algorithm_8hpp_source.html b/develop/doc/html/reference/color__base__algorithm_8hpp_source.html index bf09ddab6..7652baa2a 100644 --- a/develop/doc/html/reference/color__base__algorithm_8hpp_source.html +++ b/develop/doc/html/reference/color__base__algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_base_algorithm.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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 
    39 template <typename ColorBase>
    42 struct size : public mp11::mp_size<typename ColorBase::layout_t::color_space_t> {};
    43 
    47 
    74 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 
    162 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 typename color_element_reference_type<ColorBase,Color>::type get_color(ColorBase& cb, Color=Color()) {
    192 }
    193 
    196 template <typename ColorBase, typename Color>
    197 typename color_element_const_reference_type<ColorBase,Color>::type get_color(const ColorBase& cb, Color=Color()) {
    199 }
    200 
    206 
    218 template <typename ColorBase>
    221 struct element_type : public kth_element_type<ColorBase, 0> {};
    222 
    225 template <typename ColorBase>
    226 struct element_reference_type : public kth_element_reference_type<ColorBase, 0> {};
    227 
    230 template <typename ColorBase>
    231 struct element_const_reference_type : public kth_element_const_reference_type<ColorBase, 0> {};
    232 
    233 
    234 namespace detail {
    235 
    236 // compile-time recursion for per-element operations on color bases
    237 template <int N>
    238 struct element_recursion
    239 {
    240 
    241 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    242 #pragma GCC diagnostic push
    243 #pragma GCC diagnostic ignored "-Wconversion"
    244 #pragma GCC diagnostic ignored "-Wfloat-equal"
    245 #endif
    246 
    247  template <typename P1,typename P2>
    248  static bool static_equal(const P1& p1, const P2& p2)
    249  {
    250  return element_recursion<N-1>::static_equal(p1,p2) &&
    251  semantic_at_c<N-1>(p1)==semantic_at_c<N-1>(p2);
    252  }
    253 
    254  template <typename P1,typename P2>
    255  static void static_copy(const P1& p1, P2& p2)
    256  {
    257  element_recursion<N-1>::static_copy(p1,p2);
    258  semantic_at_c<N-1>(p2)=semantic_at_c<N-1>(p1);
    259  }
    260 
    261  template <typename P,typename T2>
    262  static void static_fill(P& p, T2 v)
    263  {
    264  element_recursion<N-1>::static_fill(p,v);
    265  semantic_at_c<N-1>(p)=v;
    266  }
    267 
    268  template <typename Dst,typename Op>
    269  static void static_generate(Dst& dst, Op op)
    270  {
    271  element_recursion<N-1>::static_generate(dst,op);
    272  semantic_at_c<N-1>(dst)=op();
    273  }
    274 
    275 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    276 #pragma GCC diagnostic pop
    277 #endif
    278 
    279  //static_for_each with one source
    280  template <typename P1,typename Op>
    281  static Op static_for_each(P1& p1, Op op) {
    282  Op op2(element_recursion<N-1>::static_for_each(p1,op));
    283  op2(semantic_at_c<N-1>(p1));
    284  return op2;
    285  }
    286  template <typename P1,typename Op>
    287  static Op static_for_each(const P1& p1, Op op) {
    288  Op op2(element_recursion<N-1>::static_for_each(p1,op));
    289  op2(semantic_at_c<N-1>(p1));
    290  return op2;
    291  }
    292  //static_for_each with two sources
    293  template <typename P1,typename P2,typename Op>
    294  static Op static_for_each(P1& p1, P2& p2, Op op) {
    295  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    296  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    297  return op2;
    298  }
    299  template <typename P1,typename P2,typename Op>
    300  static Op static_for_each(P1& p1, const P2& p2, Op op) {
    301  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    302  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    303  return op2;
    304  }
    305  template <typename P1,typename P2,typename Op>
    306  static Op static_for_each(const P1& p1, P2& p2, Op op) {
    307  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    308  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    309  return op2;
    310  }
    311  template <typename P1,typename P2,typename Op>
    312  static Op static_for_each(const P1& p1, const P2& p2, Op op) {
    313  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    314  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    315  return op2;
    316  }
    317  //static_for_each with three sources
    318  template <typename P1,typename P2,typename P3,typename Op>
    319  static Op static_for_each(P1& p1, P2& p2, P3& p3, Op op) {
    320  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    321  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    322  return op2;
    323  }
    324  template <typename P1,typename P2,typename P3,typename Op>
    325  static Op static_for_each(P1& p1, P2& p2, const P3& p3, Op op) {
    326  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    327  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    328  return op2;
    329  }
    330  template <typename P1,typename P2,typename P3,typename Op>
    331  static Op static_for_each(P1& p1, const P2& p2, P3& p3, Op op) {
    332  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    333  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    334  return op2;
    335  }
    336  template <typename P1,typename P2,typename P3,typename Op>
    337  static Op static_for_each(P1& p1, const P2& p2, const P3& p3, Op op) {
    338  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    339  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    340  return op2;
    341  }
    342  template <typename P1,typename P2,typename P3,typename Op>
    343  static Op static_for_each(const P1& p1, P2& p2, P3& p3, Op op) {
    344  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    345  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    346  return op2;
    347  }
    348  template <typename P1,typename P2,typename P3,typename Op>
    349  static Op static_for_each(const P1& p1, P2& p2, const P3& p3, Op op) {
    350  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    351  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    352  return op2;
    353  }
    354  template <typename P1,typename P2,typename P3,typename Op>
    355  static Op static_for_each(const P1& p1, const P2& p2, P3& p3, Op op) {
    356  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    357  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    358  return op2;
    359  }
    360  template <typename P1,typename P2,typename P3,typename Op>
    361  static Op static_for_each(const P1& p1, const P2& p2, const P3& p3, Op op) {
    362  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    363  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    364  return op2;
    365  }
    366  //static_transform with one source
    367  template <typename P1,typename Dst,typename Op>
    368  static Op static_transform(P1& src, Dst& dst, Op op) {
    369  Op op2(element_recursion<N-1>::static_transform(src,dst,op));
    370  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
    371  return op2;
    372  }
    373  template <typename P1,typename Dst,typename Op>
    374  static Op static_transform(const P1& src, Dst& dst, Op op) {
    375  Op op2(element_recursion<N-1>::static_transform(src,dst,op));
    376  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
    377  return op2;
    378  }
    379  //static_transform with two sources
    380  template <typename P1,typename P2,typename Dst,typename Op>
    381  static Op static_transform(P1& src1, P2& src2, Dst& dst, Op op) {
    382  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    383  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    384  return op2;
    385  }
    386  template <typename P1,typename P2,typename Dst,typename Op>
    387  static Op static_transform(P1& src1, const P2& src2, Dst& dst, Op op) {
    388  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    389  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    390  return op2;
    391  }
    392  template <typename P1,typename P2,typename Dst,typename Op>
    393  static Op static_transform(const P1& src1, P2& src2, Dst& dst, Op op) {
    394  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    395  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    396  return op2;
    397  }
    398  template <typename P1,typename P2,typename Dst,typename Op>
    399  static Op static_transform(const P1& src1, const P2& src2, Dst& dst, Op op) {
    400  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    401  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    402  return op2;
    403  }
    404 };
    405 
    406 // Termination condition of the compile-time recursion for element operations on a color base
    407 template<> struct element_recursion<0> {
    408  //static_equal
    409  template <typename P1,typename P2>
    410  static bool static_equal(const P1&, const P2&) { return true; }
    411  //static_copy
    412  template <typename P1,typename P2>
    413  static void static_copy(const P1&, const P2&) {}
    414  //static_fill
    415  template <typename P, typename T2>
    416  static void static_fill(const P&, T2) {}
    417  //static_generate
    418  template <typename Dst,typename Op>
    419  static void static_generate(const Dst&,Op){}
    420  //static_for_each with one source
    421  template <typename P1,typename Op>
    422  static Op static_for_each(const P1&,Op op){return op;}
    423  //static_for_each with two sources
    424  template <typename P1,typename P2,typename Op>
    425  static Op static_for_each(const P1&,const P2&,Op op){return op;}
    426  //static_for_each with three sources
    427  template <typename P1,typename P2,typename P3,typename Op>
    428  static Op static_for_each(const P1&,const P2&,const P3&,Op op){return op;}
    429  //static_transform with one source
    430  template <typename P1,typename Dst,typename Op>
    431  static Op static_transform(const P1&,const Dst&,Op op){return op;}
    432  //static_transform with two sources
    433  template <typename P1,typename P2,typename Dst,typename Op>
    434  static Op static_transform(const P1&,const P2&,const Dst&,Op op){return op;}
    435 };
    436 
    437 // std::min and std::max don't have the mutable overloads...
    438 template <typename Q> inline const Q& mutable_min(const Q& x, const Q& y) { return x<y ? x : y; }
    439 template <typename Q> inline Q& mutable_min( Q& x, Q& y) { return x<y ? x : y; }
    440 template <typename Q> inline const Q& mutable_max(const Q& x, const Q& y) { return x<y ? y : x; }
    441 template <typename Q> inline Q& mutable_max( Q& x, Q& y) { return x<y ? y : x; }
    442 
    443 
    444 // compile-time recursion for min/max element
    445 template <int N>
    446 struct min_max_recur {
    447  template <typename P> static typename element_const_reference_type<P>::type max_(const P& p) {
    448  return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
    449  }
    450  template <typename P> static typename element_reference_type<P>::type max_( P& p) {
    451  return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
    452  }
    453  template <typename P> static typename element_const_reference_type<P>::type min_(const P& p) {
    454  return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
    455  }
    456  template <typename P> static typename element_reference_type<P>::type min_( P& p) {
    457  return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
    458  }
    459 };
    460 
    461 // termination condition of the compile-time recursion for min/max element
    462 template <>
    463 struct min_max_recur<1> {
    464  template <typename P> static typename element_const_reference_type<P>::type max_(const P& p) { return semantic_at_c<0>(p); }
    465  template <typename P> static typename element_reference_type<P>::type max_( P& p) { return semantic_at_c<0>(p); }
    466  template <typename P> static typename element_const_reference_type<P>::type min_(const P& p) { return semantic_at_c<0>(p); }
    467  template <typename P> static typename element_reference_type<P>::type min_( P& p) { return semantic_at_c<0>(p); }
    468 };
    469 } // namespace detail
    470 
    483 
    484 template <typename P>
    485 BOOST_FORCEINLINE
    486 typename element_const_reference_type<P>::type static_max(const P& p) { return detail::min_max_recur<size<P>::value>::max_(p); }
    487 
    488 template <typename P>
    489 BOOST_FORCEINLINE
    490 typename element_reference_type<P>::type static_max( P& p) { return detail::min_max_recur<size<P>::value>::max_(p); }
    491 
    492 template <typename P>
    493 BOOST_FORCEINLINE
    494 typename element_const_reference_type<P>::type static_min(const P& p) { return detail::min_max_recur<size<P>::value>::min_(p); }
    495 
    496 template <typename P>
    497 BOOST_FORCEINLINE
    498 typename element_reference_type<P>::type static_min( P& p) { return detail::min_max_recur<size<P>::value>::min_(p); }
    500 
    515 
    516 template <typename P1,typename P2>
    517 BOOST_FORCEINLINE
    518 bool static_equal(const P1& p1, const P2& p2) { return detail::element_recursion<size<P1>::value>::static_equal(p1,p2); }
    519 
    521 
    536 
    537 template <typename Src,typename Dst>
    538 BOOST_FORCEINLINE
    539 void static_copy(const Src& src, Dst& dst)
    540 {
    541  detail::element_recursion<size<Dst>::value>::static_copy(src, dst);
    542 }
    543 
    545 
    557 
    558 template <typename P,typename V>
    559 BOOST_FORCEINLINE
    560 void static_fill(P& p, const V& v)
    561 {
    562  detail::element_recursion<size<P>::value>::static_fill(p,v);
    563 }
    564 
    566 
    585 
    586 template <typename P1,typename Op>
    587 BOOST_FORCEINLINE
    588 void static_generate(P1& dst,Op op) { detail::element_recursion<size<P1>::value>::static_generate(dst,op); }
    590 
    616 
    617 //static_transform with one source
    618 template <typename Src,typename Dst,typename Op>
    619 BOOST_FORCEINLINE
    620 Op static_transform(Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
    621 template <typename Src,typename Dst,typename Op>
    622 BOOST_FORCEINLINE
    623 Op static_transform(const Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
    624 //static_transform with two sources
    625 template <typename P2,typename P3,typename Dst,typename Op>
    626 BOOST_FORCEINLINE
    627 Op static_transform(P2& p2,P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
    628 template <typename P2,typename P3,typename Dst,typename Op>
    629 BOOST_FORCEINLINE
    630 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); }
    631 template <typename P2,typename P3,typename Dst,typename Op>
    632 BOOST_FORCEINLINE
    633 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); }
    634 template <typename P2,typename P3,typename Dst,typename Op>
    635 BOOST_FORCEINLINE
    636 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); }
    638 
    663 
    664 //static_for_each with one source
    665 template <typename P1,typename Op>
    666 BOOST_FORCEINLINE
    667 Op static_for_each( P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
    668 template <typename P1,typename Op>
    669 BOOST_FORCEINLINE
    670 Op static_for_each(const P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
    671 //static_for_each with two sources
    672 template <typename P1,typename P2,typename Op>
    673 BOOST_FORCEINLINE
    674 Op static_for_each(P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
    675 template <typename P1,typename P2,typename Op>
    676 BOOST_FORCEINLINE
    677 Op static_for_each(P1& p1,const P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
    678 template <typename P1,typename P2,typename Op>
    679 BOOST_FORCEINLINE
    680 Op static_for_each(const P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
    681 template <typename P1,typename P2,typename Op>
    682 BOOST_FORCEINLINE
    683 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); }
    684 //static_for_each with three sources
    685 template <typename P1,typename P2,typename P3,typename Op>
    686 BOOST_FORCEINLINE
    687 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); }
    688 template <typename P1,typename P2,typename P3,typename Op>
    689 BOOST_FORCEINLINE
    690 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); }
    691 template <typename P1,typename P2,typename P3,typename Op>
    692 BOOST_FORCEINLINE
    693 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); }
    694 template <typename P1,typename P2,typename P3,typename Op>
    695 BOOST_FORCEINLINE
    696 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); }
    697 template <typename P1,typename P2,typename P3,typename Op>
    698 BOOST_FORCEINLINE
    699 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); }
    700 template <typename P1,typename P2,typename P3,typename Op>
    701 BOOST_FORCEINLINE
    702 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); }
    703 template <typename P1,typename P2,typename P3,typename Op>
    704 BOOST_FORCEINLINE
    705 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); }
    706 template <typename P1,typename P2,typename P3,typename Op>
    707 BOOST_FORCEINLINE
    708 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); }
    710 
    711 } } // namespace boost::gil
    712 
    713 #endif
    Definition: algorithm.hpp:30
    -
    Specifies the return type of the constant element accessor by color name, get_color(color_base, Color());.
    Definition: color_base_algorithm.hpp:185
    -
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    -
    Specifies the type of the K-th semantic element of a color base.
    Definition: color_base_algorithm.hpp:77
    -
    Specifies the return type of the mutable semantic_at_c<K>(color_base);.
    Definition: color_base_algorithm.hpp:90
    -
    A predicate metafunction determining whether a given color base contains a given color.
    Definition: color_base_algorithm.hpp:165
    -
    Specifies the return type of the constant element accessor at_c of a homogeneous color base...
    Definition: color_base.hpp:41
    -
    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.
    Definition: color_base_algorithm.hpp:133
    -
    Specifies the return type of the mutable element accessor at_c of a homogeneous color base...
    Definition: color_base.hpp:40
    -
    Specifies the type of the element associated with a given color tag.
    Definition: color_base_algorithm.hpp:175
    -
    Specifies the return type of the mutable element accessor by color name, get_color(color_base, Color());.
    Definition: color_base_algorithm.hpp:180
    -
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    -
    Specifies the return type of the constant semantic_at_c<K>(color_base);.
    Definition: color_base_algorithm.hpp:104
    -
    Returns the index corresponding to the first occurrance of a given given type in. ...
    Definition: utilities.hpp:249
    -
    color_element_const_reference_type< ColorBase, Color >::type get_color(const ColorBase &cb, Color=Color())
    Constant accessor to the element associated with a given color name.
    Definition: color_base_algorithm.hpp:197
    +
    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 
    +
    39 template <typename ColorBase>
    +
    42 struct size : public mp11::mp_size<typename ColorBase::layout_t::color_space_t> {};
    +
    43 
    +
    47 
    +
    74 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 
    +
    162 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 typename color_element_reference_type<ColorBase,Color>::type get_color(ColorBase& cb, Color=Color()) {
    + +
    192 }
    +
    193 
    +
    196 template <typename ColorBase, typename Color>
    +
    197 typename color_element_const_reference_type<ColorBase,Color>::type get_color(const ColorBase& cb, Color=Color()) {
    + +
    199 }
    +
    200 
    +
    206 
    +
    218 template <typename ColorBase>
    +
    221 struct element_type : public kth_element_type<ColorBase, 0> {};
    +
    222 
    +
    225 template <typename ColorBase>
    +
    226 struct element_reference_type : public kth_element_reference_type<ColorBase, 0> {};
    +
    227 
    +
    230 template <typename ColorBase>
    +
    231 struct element_const_reference_type : public kth_element_const_reference_type<ColorBase, 0> {};
    +
    232 
    +
    233 
    +
    234 namespace detail {
    +
    235 
    +
    236 // compile-time recursion for per-element operations on color bases
    +
    237 template <int N>
    +
    238 struct element_recursion
    +
    239 {
    +
    240 
    +
    241 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    +
    242 #pragma GCC diagnostic push
    +
    243 #pragma GCC diagnostic ignored "-Wconversion"
    +
    244 #pragma GCC diagnostic ignored "-Wfloat-equal"
    +
    245 #endif
    +
    246 
    +
    247  template <typename P1,typename P2>
    +
    248  static bool static_equal(const P1& p1, const P2& p2)
    +
    249  {
    +
    250  return element_recursion<N-1>::static_equal(p1,p2) &&
    +
    251  semantic_at_c<N-1>(p1)==semantic_at_c<N-1>(p2);
    +
    252  }
    +
    253 
    +
    254  template <typename P1,typename P2>
    +
    255  static void static_copy(const P1& p1, P2& p2)
    +
    256  {
    +
    257  element_recursion<N-1>::static_copy(p1,p2);
    +
    258  semantic_at_c<N-1>(p2)=semantic_at_c<N-1>(p1);
    +
    259  }
    +
    260 
    +
    261  template <typename P,typename T2>
    +
    262  static void static_fill(P& p, T2 v)
    +
    263  {
    +
    264  element_recursion<N-1>::static_fill(p,v);
    +
    265  semantic_at_c<N-1>(p)=v;
    +
    266  }
    +
    267 
    +
    268  template <typename Dst,typename Op>
    +
    269  static void static_generate(Dst& dst, Op op)
    +
    270  {
    +
    271  element_recursion<N-1>::static_generate(dst,op);
    +
    272  semantic_at_c<N-1>(dst)=op();
    +
    273  }
    +
    274 
    +
    275 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    +
    276 #pragma GCC diagnostic pop
    +
    277 #endif
    +
    278 
    +
    279  //static_for_each with one source
    +
    280  template <typename P1,typename Op>
    +
    281  static Op static_for_each(P1& p1, Op op) {
    +
    282  Op op2(element_recursion<N-1>::static_for_each(p1,op));
    +
    283  op2(semantic_at_c<N-1>(p1));
    +
    284  return op2;
    +
    285  }
    +
    286  template <typename P1,typename Op>
    +
    287  static Op static_for_each(const P1& p1, Op op) {
    +
    288  Op op2(element_recursion<N-1>::static_for_each(p1,op));
    +
    289  op2(semantic_at_c<N-1>(p1));
    +
    290  return op2;
    +
    291  }
    +
    292  //static_for_each with two sources
    +
    293  template <typename P1,typename P2,typename Op>
    +
    294  static Op static_for_each(P1& p1, P2& p2, Op op) {
    +
    295  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    +
    296  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    +
    297  return op2;
    +
    298  }
    +
    299  template <typename P1,typename P2,typename Op>
    +
    300  static Op static_for_each(P1& p1, const P2& p2, Op op) {
    +
    301  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    +
    302  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    +
    303  return op2;
    +
    304  }
    +
    305  template <typename P1,typename P2,typename Op>
    +
    306  static Op static_for_each(const P1& p1, P2& p2, Op op) {
    +
    307  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    +
    308  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    +
    309  return op2;
    +
    310  }
    +
    311  template <typename P1,typename P2,typename Op>
    +
    312  static Op static_for_each(const P1& p1, const P2& p2, Op op) {
    +
    313  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
    +
    314  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
    +
    315  return op2;
    +
    316  }
    +
    317  //static_for_each with three sources
    +
    318  template <typename P1,typename P2,typename P3,typename Op>
    +
    319  static Op static_for_each(P1& p1, P2& p2, P3& p3, Op op) {
    +
    320  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    321  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    322  return op2;
    +
    323  }
    +
    324  template <typename P1,typename P2,typename P3,typename Op>
    +
    325  static Op static_for_each(P1& p1, P2& p2, const P3& p3, Op op) {
    +
    326  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    327  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    328  return op2;
    +
    329  }
    +
    330  template <typename P1,typename P2,typename P3,typename Op>
    +
    331  static Op static_for_each(P1& p1, const P2& p2, P3& p3, Op op) {
    +
    332  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    333  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    334  return op2;
    +
    335  }
    +
    336  template <typename P1,typename P2,typename P3,typename Op>
    +
    337  static Op static_for_each(P1& p1, const P2& p2, const P3& p3, Op op) {
    +
    338  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    339  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    340  return op2;
    +
    341  }
    +
    342  template <typename P1,typename P2,typename P3,typename Op>
    +
    343  static Op static_for_each(const P1& p1, P2& p2, P3& p3, Op op) {
    +
    344  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    345  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    346  return op2;
    +
    347  }
    +
    348  template <typename P1,typename P2,typename P3,typename Op>
    +
    349  static Op static_for_each(const P1& p1, P2& p2, const P3& p3, Op op) {
    +
    350  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    351  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    352  return op2;
    +
    353  }
    +
    354  template <typename P1,typename P2,typename P3,typename Op>
    +
    355  static Op static_for_each(const P1& p1, const P2& p2, P3& p3, Op op) {
    +
    356  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    357  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    358  return op2;
    +
    359  }
    +
    360  template <typename P1,typename P2,typename P3,typename Op>
    +
    361  static Op static_for_each(const P1& p1, const P2& p2, const P3& p3, Op op) {
    +
    362  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
    +
    363  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
    +
    364  return op2;
    +
    365  }
    +
    366  //static_transform with one source
    +
    367  template <typename P1,typename Dst,typename Op>
    +
    368  static Op static_transform(P1& src, Dst& dst, Op op) {
    +
    369  Op op2(element_recursion<N-1>::static_transform(src,dst,op));
    +
    370  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
    +
    371  return op2;
    +
    372  }
    +
    373  template <typename P1,typename Dst,typename Op>
    +
    374  static Op static_transform(const P1& src, Dst& dst, Op op) {
    +
    375  Op op2(element_recursion<N-1>::static_transform(src,dst,op));
    +
    376  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
    +
    377  return op2;
    +
    378  }
    +
    379  //static_transform with two sources
    +
    380  template <typename P1,typename P2,typename Dst,typename Op>
    +
    381  static Op static_transform(P1& src1, P2& src2, Dst& dst, Op op) {
    +
    382  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    +
    383  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    +
    384  return op2;
    +
    385  }
    +
    386  template <typename P1,typename P2,typename Dst,typename Op>
    +
    387  static Op static_transform(P1& src1, const P2& src2, Dst& dst, Op op) {
    +
    388  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    +
    389  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    +
    390  return op2;
    +
    391  }
    +
    392  template <typename P1,typename P2,typename Dst,typename Op>
    +
    393  static Op static_transform(const P1& src1, P2& src2, Dst& dst, Op op) {
    +
    394  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    +
    395  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    +
    396  return op2;
    +
    397  }
    +
    398  template <typename P1,typename P2,typename Dst,typename Op>
    +
    399  static Op static_transform(const P1& src1, const P2& src2, Dst& dst, Op op) {
    +
    400  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
    +
    401  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
    +
    402  return op2;
    +
    403  }
    +
    404 };
    +
    405 
    +
    406 // Termination condition of the compile-time recursion for element operations on a color base
    +
    407 template<> struct element_recursion<0> {
    +
    408  //static_equal
    +
    409  template <typename P1,typename P2>
    +
    410  static bool static_equal(const P1&, const P2&) { return true; }
    +
    411  //static_copy
    +
    412  template <typename P1,typename P2>
    +
    413  static void static_copy(const P1&, const P2&) {}
    +
    414  //static_fill
    +
    415  template <typename P, typename T2>
    +
    416  static void static_fill(const P&, T2) {}
    +
    417  //static_generate
    +
    418  template <typename Dst,typename Op>
    +
    419  static void static_generate(const Dst&,Op){}
    +
    420  //static_for_each with one source
    +
    421  template <typename P1,typename Op>
    +
    422  static Op static_for_each(const P1&,Op op){return op;}
    +
    423  //static_for_each with two sources
    +
    424  template <typename P1,typename P2,typename Op>
    +
    425  static Op static_for_each(const P1&,const P2&,Op op){return op;}
    +
    426  //static_for_each with three sources
    +
    427  template <typename P1,typename P2,typename P3,typename Op>
    +
    428  static Op static_for_each(const P1&,const P2&,const P3&,Op op){return op;}
    +
    429  //static_transform with one source
    +
    430  template <typename P1,typename Dst,typename Op>
    +
    431  static Op static_transform(const P1&,const Dst&,Op op){return op;}
    +
    432  //static_transform with two sources
    +
    433  template <typename P1,typename P2,typename Dst,typename Op>
    +
    434  static Op static_transform(const P1&,const P2&,const Dst&,Op op){return op;}
    +
    435 };
    +
    436 
    +
    437 // std::min and std::max don't have the mutable overloads...
    +
    438 template <typename Q> inline const Q& mutable_min(const Q& x, const Q& y) { return x<y ? x : y; }
    +
    439 template <typename Q> inline Q& mutable_min( Q& x, Q& y) { return x<y ? x : y; }
    +
    440 template <typename Q> inline const Q& mutable_max(const Q& x, const Q& y) { return x<y ? y : x; }
    +
    441 template <typename Q> inline Q& mutable_max( Q& x, Q& y) { return x<y ? y : x; }
    +
    442 
    +
    443 
    +
    444 // compile-time recursion for min/max element
    +
    445 template <int N>
    +
    446 struct min_max_recur {
    +
    447  template <typename P> static typename element_const_reference_type<P>::type max_(const P& p) {
    +
    448  return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
    +
    449  }
    +
    450  template <typename P> static typename element_reference_type<P>::type max_( P& p) {
    +
    451  return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
    +
    452  }
    +
    453  template <typename P> static typename element_const_reference_type<P>::type min_(const P& p) {
    +
    454  return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
    +
    455  }
    +
    456  template <typename P> static typename element_reference_type<P>::type min_( P& p) {
    +
    457  return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
    +
    458  }
    +
    459 };
    +
    460 
    +
    461 // termination condition of the compile-time recursion for min/max element
    +
    462 template <>
    +
    463 struct min_max_recur<1> {
    +
    464  template <typename P> static typename element_const_reference_type<P>::type max_(const P& p) { return semantic_at_c<0>(p); }
    +
    465  template <typename P> static typename element_reference_type<P>::type max_( P& p) { return semantic_at_c<0>(p); }
    +
    466  template <typename P> static typename element_const_reference_type<P>::type min_(const P& p) { return semantic_at_c<0>(p); }
    +
    467  template <typename P> static typename element_reference_type<P>::type min_( P& p) { return semantic_at_c<0>(p); }
    +
    468 };
    +
    469 } // namespace detail
    +
    470 
    +
    483 
    +
    484 template <typename P>
    +
    485 BOOST_FORCEINLINE
    +
    486 typename element_const_reference_type<P>::type static_max(const P& p) { return detail::min_max_recur<size<P>::value>::max_(p); }
    +
    487 
    +
    488 template <typename P>
    +
    489 BOOST_FORCEINLINE
    +
    490 typename element_reference_type<P>::type static_max( P& p) { return detail::min_max_recur<size<P>::value>::max_(p); }
    +
    491 
    +
    492 template <typename P>
    +
    493 BOOST_FORCEINLINE
    +
    494 typename element_const_reference_type<P>::type static_min(const P& p) { return detail::min_max_recur<size<P>::value>::min_(p); }
    +
    495 
    +
    496 template <typename P>
    +
    497 BOOST_FORCEINLINE
    +
    498 typename element_reference_type<P>::type static_min( P& p) { return detail::min_max_recur<size<P>::value>::min_(p); }
    +
    500 
    +
    515 
    +
    516 template <typename P1,typename P2>
    +
    517 BOOST_FORCEINLINE
    +
    518 bool static_equal(const P1& p1, const P2& p2) { return detail::element_recursion<size<P1>::value>::static_equal(p1,p2); }
    +
    519 
    +
    521 
    +
    536 
    +
    537 template <typename Src,typename Dst>
    +
    538 BOOST_FORCEINLINE
    +
    539 void static_copy(const Src& src, Dst& dst)
    +
    540 {
    +
    541  detail::element_recursion<size<Dst>::value>::static_copy(src, dst);
    +
    542 }
    +
    543 
    +
    545 
    +
    557 
    +
    558 template <typename P,typename V>
    +
    559 BOOST_FORCEINLINE
    +
    560 void static_fill(P& p, const V& v)
    +
    561 {
    +
    562  detail::element_recursion<size<P>::value>::static_fill(p,v);
    +
    563 }
    +
    564 
    +
    566 
    +
    585 
    +
    586 template <typename P1,typename Op>
    +
    587 BOOST_FORCEINLINE
    +
    588 void static_generate(P1& dst,Op op) { detail::element_recursion<size<P1>::value>::static_generate(dst,op); }
    +
    590 
    +
    616 
    +
    617 //static_transform with one source
    +
    618 template <typename Src,typename Dst,typename Op>
    +
    619 BOOST_FORCEINLINE
    +
    620 Op static_transform(Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
    +
    621 template <typename Src,typename Dst,typename Op>
    +
    622 BOOST_FORCEINLINE
    +
    623 Op static_transform(const Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
    +
    624 //static_transform with two sources
    +
    625 template <typename P2,typename P3,typename Dst,typename Op>
    +
    626 BOOST_FORCEINLINE
    +
    627 Op static_transform(P2& p2,P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
    +
    628 template <typename P2,typename P3,typename Dst,typename Op>
    +
    629 BOOST_FORCEINLINE
    +
    630 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); }
    +
    631 template <typename P2,typename P3,typename Dst,typename Op>
    +
    632 BOOST_FORCEINLINE
    +
    633 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); }
    +
    634 template <typename P2,typename P3,typename Dst,typename Op>
    +
    635 BOOST_FORCEINLINE
    +
    636 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); }
    +
    638 
    +
    663 
    +
    664 //static_for_each with one source
    +
    665 template <typename P1,typename Op>
    +
    666 BOOST_FORCEINLINE
    +
    667 Op static_for_each( P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
    +
    668 template <typename P1,typename Op>
    +
    669 BOOST_FORCEINLINE
    +
    670 Op static_for_each(const P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
    +
    671 //static_for_each with two sources
    +
    672 template <typename P1,typename P2,typename Op>
    +
    673 BOOST_FORCEINLINE
    +
    674 Op static_for_each(P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
    +
    675 template <typename P1,typename P2,typename Op>
    +
    676 BOOST_FORCEINLINE
    +
    677 Op static_for_each(P1& p1,const P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
    +
    678 template <typename P1,typename P2,typename Op>
    +
    679 BOOST_FORCEINLINE
    +
    680 Op static_for_each(const P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
    +
    681 template <typename P1,typename P2,typename Op>
    +
    682 BOOST_FORCEINLINE
    +
    683 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); }
    +
    684 //static_for_each with three sources
    +
    685 template <typename P1,typename P2,typename P3,typename Op>
    +
    686 BOOST_FORCEINLINE
    +
    687 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); }
    +
    688 template <typename P1,typename P2,typename P3,typename Op>
    +
    689 BOOST_FORCEINLINE
    +
    690 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); }
    +
    691 template <typename P1,typename P2,typename P3,typename Op>
    +
    692 BOOST_FORCEINLINE
    +
    693 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); }
    +
    694 template <typename P1,typename P2,typename P3,typename Op>
    +
    695 BOOST_FORCEINLINE
    +
    696 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); }
    +
    697 template <typename P1,typename P2,typename P3,typename Op>
    +
    698 BOOST_FORCEINLINE
    +
    699 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); }
    +
    700 template <typename P1,typename P2,typename P3,typename Op>
    +
    701 BOOST_FORCEINLINE
    +
    702 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); }
    +
    703 template <typename P1,typename P2,typename P3,typename Op>
    +
    704 BOOST_FORCEINLINE
    +
    705 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); }
    +
    706 template <typename P1,typename P2,typename P3,typename Op>
    +
    707 BOOST_FORCEINLINE
    +
    708 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); }
    +
    710 
    +
    711 } } // namespace boost::gil
    +
    712 
    +
    713 #endif
    +
    Specifies the return type of the constant semantic_at_c<K>(color_base);.
    Definition: color_base_algorithm.hpp:104
    +
    A predicate metafunction determining whether a given color base contains a given color.
    Definition: color_base_algorithm.hpp:165
    +
    color_element_const_reference_type< ColorBase, Color >::type get_color(const ColorBase &cb, Color=Color())
    Constant accessor to the element associated with a given color name.
    Definition: color_base_algorithm.hpp:197
    +
    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
    +
    Specifies the type of the K-th semantic element of a color base.
    Definition: color_base_algorithm.hpp:77
    +
    Returns the index corresponding to the first occurrance of a given given type in.
    Definition: utilities.hpp:249
    +
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    +
    Specifies the return type of the mutable semantic_at_c<K>(color_base);.
    Definition: color_base_algorithm.hpp:90
    +
    Specifies the return type of the mutable element accessor at_c of a homogeneous color base.
    Definition: color_base.hpp:40
    +
    Specifies the return type of the constant element accessor by color name, get_color(color_base,...
    Definition: color_base_algorithm.hpp:185
    +
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    +
    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.
    Definition: color_base_algorithm.hpp:133
    diff --git a/develop/doc/html/reference/color__convert_8hpp_source.html b/develop/doc/html/reference/color__convert_8hpp_source.html index 91eefce24..1355b3f75 100644 --- a/develop/doc/html/reference/color__convert_8hpp_source.html +++ b/develop/doc/html/reference/color__convert_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_convert.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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  GrayChannelValue operator()(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) const {
    67  return channel_convert<GrayChannelValue>(float32_t(
    68  channel_convert<float32_t>(red )*0.30f +
    69  channel_convert<float32_t>(green)*0.59f +
    70  channel_convert<float32_t>(blue )*0.11f) );
    71  }
    72 };
    73 
    74 // performance specialization for unsigned char
    75 template <typename GrayChannelValue>
    76 struct rgb_to_luminance_fn<uint8_t,uint8_t,uint8_t, GrayChannelValue> {
    77  GrayChannelValue operator()(uint8_t red, uint8_t green, uint8_t blue) const {
    78  return channel_convert<GrayChannelValue>(uint8_t(
    79  ((uint32_t(red )*4915 + uint32_t(green)*9667 + uint32_t(blue )*1802) + 8192) >> 14));
    80  }
    81 };
    82 
    83 template <typename GrayChannel, typename RedChannel, typename GreenChannel, typename BlueChannel>
    84 typename channel_traits<GrayChannel>::value_type rgb_to_luminance(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) {
    85  return rgb_to_luminance_fn<RedChannel,GreenChannel,BlueChannel,
    86  typename channel_traits<GrayChannel>::value_type>()(red,green,blue);
    87 }
    88 
    89 } // namespace detail
    90 
    93 template <>
    94 struct default_color_converter_impl<gray_t,rgb_t> {
    95  template <typename P1, typename P2>
    96  void operator()(const P1& src, P2& dst) const {
    97  get_color(dst,red_t()) =
    98  channel_convert<typename color_element_type<P2, red_t >::type>(get_color(src,gray_color_t()));
    99  get_color(dst,green_t())=
    100  channel_convert<typename color_element_type<P2, green_t>::type>(get_color(src,gray_color_t()));
    101  get_color(dst,blue_t()) =
    102  channel_convert<typename color_element_type<P2, blue_t >::type>(get_color(src,gray_color_t()));
    103  }
    104 };
    105 
    110 template <>
    111 struct default_color_converter_impl<gray_t,cmyk_t> {
    112  template <typename P1, typename P2>
    113  void operator()(const P1& src, P2& dst) const {
    114  get_color(dst,cyan_t())=
    115  channel_traits<typename color_element_type<P2, cyan_t >::type>::min_value();
    116  get_color(dst,magenta_t())=
    117  channel_traits<typename color_element_type<P2, magenta_t>::type>::min_value();
    118  get_color(dst,yellow_t())=
    119  channel_traits<typename color_element_type<P2, yellow_t >::type>::min_value();
    120  get_color(dst,black_t())=
    121  channel_convert<typename color_element_type<P2, black_t >::type>(get_color(src,gray_color_t()));
    122  }
    123 };
    124 
    127 template <>
    128 struct default_color_converter_impl<rgb_t,gray_t> {
    129  template <typename P1, typename P2>
    130  void operator()(const P1& src, P2& dst) const {
    131  get_color(dst,gray_color_t()) =
    132  detail::rgb_to_luminance<typename color_element_type<P2,gray_color_t>::type>(
    133  get_color(src,red_t()), get_color(src,green_t()), get_color(src,blue_t())
    134  );
    135  }
    136 };
    137 
    138 
    153 template <>
    154 struct default_color_converter_impl<rgb_t, cmyk_t>
    155 {
    156  template <typename SrcPixel, typename DstPixel>
    157  void operator()(SrcPixel const& src, DstPixel& dst) const
    158  {
    159  using src_t = typename channel_type<SrcPixel>::type;
    160  src_t const r = get_color(src, red_t());
    161  src_t const g = get_color(src, green_t());
    162  src_t const b = get_color(src, blue_t());
    163 
    164  using uint_t = typename channel_type<cmyk8_pixel_t>::type;
    165  uint_t c = channel_invert(channel_convert<uint_t>(r)); // c = 1 - r
    166  uint_t m = channel_invert(channel_convert<uint_t>(g)); // m = 1 - g
    167  uint_t y = channel_invert(channel_convert<uint_t>(b)); // y = 1 - b
    168  uint_t k = (std::min)(c,(std::min)(m,y)); // k = minimum(c, m, y)
    169 
    170  // Apply color correction, strengthening, reducing non-zero components by
    171  // s = 1 / (1 - k) for k < 1, where 1 denotes dst_t max, otherwise s = 1 (literal).
    172  uint_t const dst_max = channel_traits<uint_t>::max_value();
    173  uint_t const s_div = dst_max - k;
    174  if (s_div != 0)
    175  {
    176  double const s = dst_max / static_cast<double>(s_div);
    177  c = (c - k) * s;
    178  m = (m - k) * s;
    179  y = (y - k) * s;
    180  }
    181  else
    182  {
    183  // Black only for k = 1 (max of dst_t)
    184  c = channel_traits<uint_t>::min_value();
    185  m = channel_traits<uint_t>::min_value();
    186  y = channel_traits<uint_t>::min_value();
    187  }
    188  using dst_t = typename channel_type<DstPixel>::type;
    189  get_color(dst, cyan_t()) = channel_convert<dst_t>(c);
    190  get_color(dst, magenta_t()) = channel_convert<dst_t>(m);
    191  get_color(dst, yellow_t()) = channel_convert<dst_t>(y);
    192  get_color(dst, black_t()) = channel_convert<dst_t>(k);
    193  }
    194 };
    195 
    196 
    203 template <>
    204 struct default_color_converter_impl<cmyk_t,rgb_t> {
    205  template <typename P1, typename P2>
    206  void operator()(const P1& src, P2& dst) const {
    207  using T1 = typename channel_type<P1>::type;
    208  get_color(dst,red_t()) =
    209  channel_convert<typename color_element_type<P2,red_t>::type>(
    210  channel_invert<T1>(
    211  (std::min)(channel_traits<T1>::max_value(),
    213  get_color(dst,green_t())=
    214  channel_convert<typename color_element_type<P2,green_t>::type>(
    215  channel_invert<T1>(
    216  (std::min)(channel_traits<T1>::max_value(),
    218  get_color(dst,blue_t()) =
    219  channel_convert<typename color_element_type<P2,blue_t>::type>(
    220  channel_invert<T1>(
    221  (std::min)(channel_traits<T1>::max_value(),
    223  }
    224 };
    225 
    226 
    231 template <>
    232 struct default_color_converter_impl<cmyk_t,gray_t> {
    233  template <typename P1, typename P2>
    234  void operator()(const P1& src, P2& dst) const {
    235  get_color(dst,gray_color_t())=
    236  channel_convert<typename color_element_type<P2,gray_color_t>::type>(
    239  detail::rgb_to_luminance<typename color_element_type<P1,black_t>::type>(
    240  get_color(src,cyan_t()),
    241  get_color(src,magenta_t()),
    242  get_color(src,yellow_t())
    243  )
    244  ),
    245  channel_invert(get_color(src,black_t()))));
    246  }
    247 };
    248 
    249 namespace detail {
    250 
    251 template <typename Pixel>
    252 auto alpha_or_max_impl(Pixel const& p, std::true_type) -> typename channel_type<Pixel>::type
    253 {
    254  return get_color(p,alpha_t());
    255 }
    256 template <typename Pixel>
    257 auto alpha_or_max_impl(Pixel const&, std::false_type) -> typename channel_type<Pixel>::type
    258 {
    259  return channel_traits<typename channel_type<Pixel>::type>::max_value();
    260 }
    261 
    262 } // namespace detail
    263 
    264 // Returns max_value if the pixel has no alpha channel. Otherwise returns the alpha.
    265 template <typename Pixel>
    266 auto alpha_or_max(Pixel const& p) -> typename channel_type<Pixel>::type
    267 {
    268  return detail::alpha_or_max_impl(
    269  p,
    270  mp11::mp_contains<typename color_space_type<Pixel>::type, alpha_t>());
    271 }
    272 
    273 
    276 template <typename C1>
    277 struct default_color_converter_impl<C1,rgba_t> {
    278  template <typename P1, typename P2>
    279  void operator()(const P1& src, P2& dst) const {
    280  using T2 = typename channel_type<P2>::type;
    283  get_color(dst,red_t()) =get_color(tmp,red_t());
    284  get_color(dst,green_t())=get_color(tmp,green_t());
    285  get_color(dst,blue_t()) =get_color(tmp,blue_t());
    286  get_color(dst,alpha_t())=channel_convert<T2>(alpha_or_max(src));
    287  }
    288 };
    289 
    296 template <typename C2>
    297 struct default_color_converter_impl<rgba_t,C2> {
    298  template <typename P1, typename P2>
    299  void operator()(const P1& src, P2& dst) const {
    300  using T1 = typename channel_type<P1>::type;
    305  ,dst);
    306  }
    307 };
    308 
    311 template <>
    312 struct default_color_converter_impl<rgba_t,rgba_t> {
    313  template <typename P1, typename P2>
    314  void operator()(const P1& src, P2& dst) const {
    315  static_for_each(src,dst,default_channel_converter());
    316  }
    317 };
    318 
    322 
    326  template <typename SrcP, typename DstP>
    327  void operator()(const SrcP& src,DstP& dst) const {
    328  using SrcColorSpace = typename color_space_type<SrcP>::type;
    329  using DstColorSpace = typename color_space_type<DstP>::type;
    331  }
    332 };
    333 
    338 template <typename SrcP, typename DstP>
    339 inline void color_convert(const SrcP& src, DstP& dst) {
    340  default_color_converter()(src,dst);
    341 }
    342 
    343 } } // namespace boost::gil
    344 
    345 #endif
    Magenta.
    Definition: cmyk.hpp:25
    -
    channel_traits< Channel >::value_type channel_invert(Channel x)
    Default implementation. Provide overloads for performance.
    Definition: channel_algorithm.hpp:559
    -
    Definition: algorithm.hpp:30
    -
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept.
    Definition: metafunctions.hpp:23
    -
    Yellow.
    Definition: cmyk.hpp:28
    -
    channel_traits< Channel >::value_type channel_multiply(Channel a, Channel b)
    A function multiplying two channels. result = a * b / max_value.
    Definition: channel_algorithm.hpp:539
    -
    color_element_reference_type< ColorBase, Color >::type get_color(ColorBase &cb, Color=Color())
    Mutable accessor to the element associated with a given color name.
    Definition: color_base_algorithm.hpp:190
    -
    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:124
    -
    Green.
    Definition: rgb.hpp:27
    -
    Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
    Definition: channel_algorithm.hpp:460
    -
    Alpha.
    Definition: rgba.hpp:22
    -
    Definition: color_convert.hpp:31
    -
    Color Convertion function object. To be specialized for every src/dst color space.
    Definition: color_convert.hpp:42
    -
    Blue.
    Definition: rgb.hpp:30
    -
    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:339
    -
    red * .3 + green * .59 + blue * .11 + .5
    Definition: color_convert.hpp:65
    -
    Black.
    Definition: cmyk.hpp:31
    -
    Red.
    Definition: rgb.hpp:24
    -
    Gray.
    Definition: gray.hpp:18
    -
    Cyan.
    Definition: cmyk.hpp:22
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    +
    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  GrayChannelValue operator()(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) const {
    +
    67  return channel_convert<GrayChannelValue>(float32_t(
    +
    68  channel_convert<float32_t>(red )*0.30f +
    +
    69  channel_convert<float32_t>(green)*0.59f +
    +
    70  channel_convert<float32_t>(blue )*0.11f) );
    +
    71  }
    +
    72 };
    +
    73 
    +
    74 // performance specialization for unsigned char
    +
    75 template <typename GrayChannelValue>
    +
    76 struct rgb_to_luminance_fn<uint8_t,uint8_t,uint8_t, GrayChannelValue> {
    +
    77  GrayChannelValue operator()(uint8_t red, uint8_t green, uint8_t blue) const {
    +
    78  return channel_convert<GrayChannelValue>(uint8_t(
    +
    79  ((uint32_t(red )*4915 + uint32_t(green)*9667 + uint32_t(blue )*1802) + 8192) >> 14));
    +
    80  }
    +
    81 };
    +
    82 
    +
    83 template <typename GrayChannel, typename RedChannel, typename GreenChannel, typename BlueChannel>
    +
    84 typename channel_traits<GrayChannel>::value_type rgb_to_luminance(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) {
    +
    85  return rgb_to_luminance_fn<RedChannel,GreenChannel,BlueChannel,
    +
    86  typename channel_traits<GrayChannel>::value_type>()(red,green,blue);
    +
    87 }
    +
    88 
    +
    89 } // namespace detail
    +
    90 
    +
    93 template <>
    + +
    95  template <typename P1, typename P2>
    +
    96  void operator()(const P1& src, P2& dst) const {
    +
    97  get_color(dst,red_t()) =
    +
    98  channel_convert<typename color_element_type<P2, red_t >::type>(get_color(src,gray_color_t()));
    +
    99  get_color(dst,green_t())=
    +
    100  channel_convert<typename color_element_type<P2, green_t>::type>(get_color(src,gray_color_t()));
    +
    101  get_color(dst,blue_t()) =
    +
    102  channel_convert<typename color_element_type<P2, blue_t >::type>(get_color(src,gray_color_t()));
    +
    103  }
    +
    104 };
    +
    105 
    +
    110 template <>
    + +
    112  template <typename P1, typename P2>
    +
    113  void operator()(const P1& src, P2& dst) const {
    +
    114  get_color(dst,cyan_t())=
    +
    115  channel_traits<typename color_element_type<P2, cyan_t >::type>::min_value();
    +
    116  get_color(dst,magenta_t())=
    +
    117  channel_traits<typename color_element_type<P2, magenta_t>::type>::min_value();
    +
    118  get_color(dst,yellow_t())=
    +
    119  channel_traits<typename color_element_type<P2, yellow_t >::type>::min_value();
    +
    120  get_color(dst,black_t())=
    +
    121  channel_convert<typename color_element_type<P2, black_t >::type>(get_color(src,gray_color_t()));
    +
    122  }
    +
    123 };
    +
    124 
    +
    127 template <>
    + +
    129  template <typename P1, typename P2>
    +
    130  void operator()(const P1& src, P2& dst) const {
    +
    131  get_color(dst,gray_color_t()) =
    +
    132  detail::rgb_to_luminance<typename color_element_type<P2,gray_color_t>::type>(
    +
    133  get_color(src,red_t()), get_color(src,green_t()), get_color(src,blue_t())
    +
    134  );
    +
    135  }
    +
    136 };
    +
    137 
    +
    138 
    +
    153 template <>
    + +
    155 {
    +
    156  template <typename SrcPixel, typename DstPixel>
    +
    157  void operator()(SrcPixel const& src, DstPixel& dst) const
    +
    158  {
    +
    159  using src_t = typename channel_type<SrcPixel>::type;
    +
    160  src_t const r = get_color(src, red_t());
    +
    161  src_t const g = get_color(src, green_t());
    +
    162  src_t const b = get_color(src, blue_t());
    +
    163 
    +
    164  using uint_t = typename channel_type<cmyk8_pixel_t>::type;
    +
    165  uint_t c = channel_invert(channel_convert<uint_t>(r)); // c = 1 - r
    +
    166  uint_t m = channel_invert(channel_convert<uint_t>(g)); // m = 1 - g
    +
    167  uint_t y = channel_invert(channel_convert<uint_t>(b)); // y = 1 - b
    +
    168  uint_t k = (std::min)(c,(std::min)(m,y)); // k = minimum(c, m, y)
    +
    169 
    +
    170  // Apply color correction, strengthening, reducing non-zero components by
    +
    171  // s = 1 / (1 - k) for k < 1, where 1 denotes dst_t max, otherwise s = 1 (literal).
    +
    172  uint_t const dst_max = channel_traits<uint_t>::max_value();
    +
    173  uint_t const s_div = static_cast<uint_t>(dst_max - k);
    +
    174  if (s_div != 0)
    +
    175  {
    +
    176  double const s = dst_max / static_cast<double>(s_div);
    +
    177  c = static_cast<uint_t>((c - k) * s);
    +
    178  m = static_cast<uint_t>((m - k) * s);
    +
    179  y = static_cast<uint_t>((y - k) * s);
    +
    180  }
    +
    181  else
    +
    182  {
    +
    183  // Black only for k = 1 (max of dst_t)
    +
    184  c = channel_traits<uint_t>::min_value();
    +
    185  m = channel_traits<uint_t>::min_value();
    +
    186  y = channel_traits<uint_t>::min_value();
    +
    187  }
    +
    188  using dst_t = typename channel_type<DstPixel>::type;
    +
    189  get_color(dst, cyan_t()) = channel_convert<dst_t>(c);
    +
    190  get_color(dst, magenta_t()) = channel_convert<dst_t>(m);
    +
    191  get_color(dst, yellow_t()) = channel_convert<dst_t>(y);
    +
    192  get_color(dst, black_t()) = channel_convert<dst_t>(k);
    +
    193  }
    +
    194 };
    +
    195 
    +
    196 
    +
    203 template <>
    + +
    205  template <typename P1, typename P2>
    +
    206  void operator()(const P1& src, P2& dst) const {
    +
    207  using T1 = typename channel_type<P1>::type;
    +
    208  get_color(dst,red_t()) =
    +
    209  channel_convert<typename color_element_type<P2,red_t>::type>(
    +
    210  channel_invert<T1>(
    +
    211  (std::min)(channel_traits<T1>::max_value(),
    + +
    213  get_color(dst,green_t())=
    +
    214  channel_convert<typename color_element_type<P2,green_t>::type>(
    +
    215  channel_invert<T1>(
    +
    216  (std::min)(channel_traits<T1>::max_value(),
    + +
    218  get_color(dst,blue_t()) =
    +
    219  channel_convert<typename color_element_type<P2,blue_t>::type>(
    +
    220  channel_invert<T1>(
    +
    221  (std::min)(channel_traits<T1>::max_value(),
    + +
    223  }
    +
    224 };
    +
    225 
    +
    226 
    +
    231 template <>
    + +
    233  template <typename P1, typename P2>
    +
    234  void operator()(const P1& src, P2& dst) const {
    +
    235  get_color(dst,gray_color_t())=
    +
    236  channel_convert<typename color_element_type<P2,gray_color_t>::type>(
    + + +
    239  detail::rgb_to_luminance<typename color_element_type<P1,black_t>::type>(
    +
    240  get_color(src,cyan_t()),
    +
    241  get_color(src,magenta_t()),
    +
    242  get_color(src,yellow_t())
    +
    243  )
    +
    244  ),
    +
    245  channel_invert(get_color(src,black_t()))));
    +
    246  }
    +
    247 };
    +
    248 
    +
    249 namespace detail {
    +
    250 
    +
    251 template <typename Pixel>
    +
    252 auto alpha_or_max_impl(Pixel const& p, std::true_type) -> typename channel_type<Pixel>::type
    +
    253 {
    +
    254  return get_color(p,alpha_t());
    +
    255 }
    +
    256 template <typename Pixel>
    +
    257 auto alpha_or_max_impl(Pixel const&, std::false_type) -> typename channel_type<Pixel>::type
    +
    258 {
    +
    259  return channel_traits<typename channel_type<Pixel>::type>::max_value();
    +
    260 }
    +
    261 
    +
    262 } // namespace detail
    +
    263 
    +
    264 // Returns max_value if the pixel has no alpha channel. Otherwise returns the alpha.
    +
    265 template <typename Pixel>
    +
    266 auto alpha_or_max(Pixel const& p) -> typename channel_type<Pixel>::type
    +
    267 {
    +
    268  return detail::alpha_or_max_impl(
    +
    269  p,
    +
    270  mp11::mp_contains<typename color_space_type<Pixel>::type, alpha_t>());
    +
    271 }
    +
    272 
    +
    273 
    +
    276 template <typename C1>
    + +
    278  template <typename P1, typename P2>
    +
    279  void operator()(const P1& src, P2& dst) const {
    +
    280  using T2 = typename channel_type<P2>::type;
    + + +
    283  get_color(dst,red_t()) =get_color(tmp,red_t());
    +
    284  get_color(dst,green_t())=get_color(tmp,green_t());
    +
    285  get_color(dst,blue_t()) =get_color(tmp,blue_t());
    +
    286  get_color(dst,alpha_t())=channel_convert<T2>(alpha_or_max(src));
    +
    287  }
    +
    288 };
    +
    289 
    +
    296 template <typename C2>
    + +
    298  template <typename P1, typename P2>
    +
    299  void operator()(const P1& src, P2& dst) const {
    +
    300  using T1 = typename channel_type<P1>::type;
    + + + + +
    305  ,dst);
    +
    306  }
    +
    307 };
    +
    308 
    +
    311 template <>
    + +
    313  template <typename P1, typename P2>
    +
    314  void operator()(const P1& src, P2& dst) const {
    +
    315  static_for_each(src,dst,default_channel_converter());
    +
    316  }
    +
    317 };
    +
    318 
    +
    322 
    + +
    326  template <typename SrcP, typename DstP>
    +
    327  void operator()(const SrcP& src,DstP& dst) const {
    +
    328  using SrcColorSpace = typename color_space_type<SrcP>::type;
    +
    329  using DstColorSpace = typename color_space_type<DstP>::type;
    + +
    331  }
    +
    332 };
    +
    333 
    +
    338 template <typename SrcP, typename DstP>
    +
    339 inline void color_convert(const SrcP& src, DstP& dst) {
    +
    340  default_color_converter()(src,dst);
    +
    341 }
    +
    342 
    +
    343 } } // namespace boost::gil
    +
    344 
    +
    345 #endif
    +
    color_element_reference_type< ColorBase, Color >::type get_color(ColorBase &cb, Color=Color())
    Mutable accessor to the element associated with a given color name.
    Definition: color_base_algorithm.hpp:190
    +
    Yellow.
    Definition: cmyk.hpp:28
    +
    Blue.
    Definition: rgb.hpp:30
    +
    Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
    Definition: channel_algorithm.hpp:460
    +
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
    Definition: metafunctions.hpp:23
    +
    Color Convertion function object. To be specialized for every src/dst color space.
    Definition: color_convert.hpp:42
    +
    Gray.
    Definition: gray.hpp:18
    +
    channel_traits< Channel >::value_type channel_multiply(Channel a, Channel b)
    A function multiplying two channels. result = a * b / max_value.
    Definition: channel_algorithm.hpp:539
    +
    Green.
    Definition: rgb.hpp:27
    +
    mp11::mp_list< red_t, green_t, blue_t, alpha_t > rgba_t
    Definition: rgba.hpp:25
    +
    mp11::mp_list< gray_color_t > gray_t
    Definition: gray.hpp:21
    +
    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:339
    +
    Alpha.
    Definition: rgba.hpp:22
    +
    Black.
    Definition: cmyk.hpp:31
    +
    mp11::mp_list< red_t, green_t, blue_t > rgb_t
    Definition: rgb.hpp:34
    +
    Cyan.
    Definition: cmyk.hpp:22
    +
    mp11::mp_list< cyan_t, magenta_t, yellow_t, black_t > cmyk_t
    Definition: cmyk.hpp:35
    +
    channel_traits< Channel >::value_type channel_invert(Channel x)
    Default implementation. Provide overloads for performance.
    Definition: channel_algorithm.hpp:559
    +
    Magenta.
    Definition: cmyk.hpp:25
    +
    Definition: color_convert.hpp:31
    +
    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:124
    +
    red * .3 + green * .59 + blue * .11 + .5
    Definition: color_convert.hpp:65
    +
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    +
    Red.
    Definition: rgb.hpp:24
    diff --git a/develop/doc/html/reference/concept__check_8hpp_source.html b/develop/doc/html/reference/concept__check_8hpp_source.html index a6f65ffbe..e44d4e8be 100644 --- a/develop/doc/html/reference/concept__check_8hpp_source.html +++ b/develop/doc/html/reference/concept__check_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: concept_check.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    +
    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
    diff --git a/develop/doc/html/reference/concepts_2channel_8hpp_source.html b/develop/doc/html/reference/concepts_2channel_8hpp_source.html index 308dd4525..a29324494 100644 --- a/develop/doc/html/reference/concepts_2channel_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2channel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    Definition: concepts/channel.hpp:98
    -
    channel_traits< DstChannel >::value_type channel_convert(const SrcChannel &src)
    Converting from one channel type to another.
    Definition: channel_algorithm.hpp:451
    -
    A channel is convertible to another one if the channel_convert algorithm is defined for the two chann...
    Definition: concepts/channel.hpp:193
    -
    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:74
    -
    A channel that supports default construction.
    Definition: concepts/channel.hpp:133
    -
    Predicate metafunction returning whether two channels are compatible.
    Definition: concepts/channel.hpp:154
    -
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    -
    Channels are compatible if their associated value types (ignoring constness and references) are the s...
    Definition: concepts/channel.hpp:173
    -
    A channel that allows for modifying its value.
    Definition: concepts/channel.hpp:118
    +
    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
    +
    A channel is convertible to another one if the channel_convert algorithm is defined for the two chann...
    Definition: concepts/channel.hpp:193
    +
    A channel that allows for modifying its value.
    Definition: concepts/channel.hpp:118
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    Predicate metafunction returning whether two channels are compatible.
    Definition: concepts/channel.hpp:154
    +
    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:74
    +
    A channel that supports default construction.
    Definition: concepts/channel.hpp:133
    +
    channel_traits< DstChannel >::value_type channel_convert(const SrcChannel &src)
    Converting from one channel type to another.
    Definition: channel_algorithm.hpp:451
    +
    Channels are compatible if their associated value types (ignoring constness and references) are the s...
    Definition: concepts/channel.hpp:173
    +
    Definition: concepts/channel.hpp:98
    diff --git a/develop/doc/html/reference/concepts_2color__base_8hpp_source.html b/develop/doc/html/reference/concepts_2color__base_8hpp_source.html index 1312ca63b..f0e2b6a31 100644 --- a/develop/doc/html/reference/concepts_2color__base_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2color__base_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_base.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Homogeneous color base that also has a default constructor. Refines Regular.
    Definition: concepts/color_base.hpp:282
    -
    Homogeneous color base that allows for modifying its elements.
    Definition: concepts/color_base.hpp:257
    -
    Definition: algorithm.hpp:30
    -
    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
    -
    Two color bases are compatible if they have the same color space and their elements are compatible...
    Definition: concepts/color_base.hpp:303
    -
    A color base is a container of color elements (such as channels, channel references or channel pointe...
    Definition: concepts/color_base.hpp:137
    -
    Color base which allows for modifying its elements.
    Definition: concepts/color_base.hpp:183
    -
    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:597
    -
    Color base that also has a default-constructor. Refines Regular.
    Definition: concepts/color_base.hpp:207
    -
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    -
    Color base whose elements all have the same type.
    Definition: concepts/color_base.hpp:227
    +
    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
    +
    Two color bases are compatible if they have the same color space and their elements are compatible,...
    Definition: concepts/color_base.hpp:303
    +
    Homogeneous color base that allows for modifying its elements.
    Definition: concepts/color_base.hpp:257
    +
    Color base that also has a default-constructor. Refines Regular.
    Definition: concepts/color_base.hpp:207
    +
    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
    +
    Homogeneous color base that also has a default constructor. Refines Regular.
    Definition: concepts/color_base.hpp:282
    +
    Color base whose elements all have the same type.
    Definition: concepts/color_base.hpp:227
    +
    A color base is a container of color elements (such as channels, channel references or channel pointe...
    Definition: concepts/color_base.hpp:137
    +
    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
    +
    Color base which allows for modifying its elements.
    Definition: concepts/color_base.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/develop/doc/html/reference/concepts_2dynamic__step_8hpp_source.html b/develop/doc/html/reference/concepts_2dynamic__step_8hpp_source.html index d5e2e1193..a8d40e83d 100644 --- a/develop/doc/html/reference/concepts_2dynamic__step_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2dynamic__step_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_step.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Concept for iterators, locators and views that can define a type just like the given iterator...
    Definition: concepts/dynamic_step.hpp:39
    -
    Definition: algorithm.hpp:30
    -
    Concept for locators and views that can define a type just like the given locator or view...
    Definition: concepts/dynamic_step.hpp:59
    -
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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
    +
    Concept for iterators, locators and views that can define a type just like the given iterator,...
    Definition: concepts/dynamic_step.hpp:39
    +
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    Concept for locators and views that can define a type just like the given locator or view,...
    Definition: concepts/dynamic_step.hpp:59
    +
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    diff --git a/develop/doc/html/reference/concepts_2image_8hpp_source.html b/develop/doc/html/reference/concepts_2image_8hpp_source.html index e18bb98a0..61e7c7bd8 100644 --- a/develop/doc/html/reference/concepts_2image_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    N-dimensional container of values.
    Definition: concepts/image.hpp:57
    -
    2-dimensional image whose value type models PixelValueConcept
    Definition: concepts/image.hpp:144
    -
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    -
    2-dimensional container of values
    Definition: concepts/image.hpp:109
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:552
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    - +
    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
    +
    2-dimensional image whose value type models PixelValueConcept
    Definition: concepts/image.hpp:144
    +
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    +
    N-dimensional container of values.
    Definition: concepts/image.hpp:57
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    + +
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:552
    +
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    +
    2-dimensional container of values
    Definition: concepts/image.hpp:109
    diff --git a/develop/doc/html/reference/concepts_2image__view_8hpp_source.html b/develop/doc/html/reference/concepts_2image__view_8hpp_source.html index 86fe0639c..5824339d7 100644 --- a/develop/doc/html/reference/concepts_2image__view_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2image__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    2-dimensional view over mutable values
    Definition: concepts/image_view.hpp:487
    -
    Definition: algorithm.hpp:30
    - -
    N-dimensional view over mutable values.
    Definition: concepts/image_view.hpp:470
    -
    GIL view as Collection.
    Definition: concepts/image_view.hpp:274
    -
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:522
    -
    GIL view as ReversibleCollection.
    Definition: concepts/image_view.hpp:336
    - -
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    GIL&#39;s 2-dimensional view over mutable GIL pixels.
    Definition: concepts/image_view.hpp:504
    -
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    -
    GIL&#39;s 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:375
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    2-dimensional view over immutable values
    Definition: concepts/image_view.hpp:221
    -
    GIL view as ForwardCollection.
    Definition: concepts/image_view.hpp:313
    -
    Views are compatible if they have the same color spaces and compatible channel values.
    Definition: concepts/image_view.hpp:539
    -
    N-dimensional view over immutable values.
    Definition: concepts/image_view.hpp:103
    -
    Definition: concepts/image_view.hpp:450
    - -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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
    + + +
    GIL's 2-dimensional view over mutable GIL pixels.
    Definition: concepts/image_view.hpp:504
    +
    GIL view as ForwardCollection.
    Definition: concepts/image_view.hpp:313
    +
    N-dimensional view over immutable values.
    Definition: concepts/image_view.hpp:103
    +
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    2-dimensional view over mutable values
    Definition: concepts/image_view.hpp:487
    +
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:522
    +
    GIL's 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:375
    +
    2-dimensional view over immutable values
    Definition: concepts/image_view.hpp:221
    +
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    + +
    Views are compatible if they have the same color spaces and compatible channel values.
    Definition: concepts/image_view.hpp:539
    +
    Definition: concepts/image_view.hpp:450
    +
    N-dimensional view over mutable values.
    Definition: concepts/image_view.hpp:470
    +
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    +
    GIL view as ReversibleCollection.
    Definition: concepts/image_view.hpp:336
    +
    GIL view as Collection.
    Definition: concepts/image_view.hpp:274
    diff --git a/develop/doc/html/reference/concepts_2pixel_8hpp_source.html b/develop/doc/html/reference/concepts_2pixel_8hpp_source.html index 3140cb3db..00918ea3e 100644 --- a/develop/doc/html/reference/concepts_2pixel_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2pixel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Homogeneous pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:148
    -
    Definition: algorithm.hpp:30
    -
    Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
    Definition: concepts/pixel.hpp:256
    -
    Pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:170
    -
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    -
    Homogeneous pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:188
    -
    Homogeneous pixel concept.
    Definition: concepts/pixel.hpp:123
    -
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:101
    -
    Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
    Definition: concepts/pixel.hpp:277
    -
    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:339
    -
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    -
    Pixel concept - A color base whose elements are channels.
    Definition: concepts/pixel.hpp:63
    +
    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
    +
    Homogeneous pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:148
    +
    Pixel concept - A color base whose elements are channels.
    Definition: concepts/pixel.hpp:63
    +
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:101
    +
    Homogeneous pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:188
    +
    Homogeneous pixel concept.
    Definition: concepts/pixel.hpp:123
    +
    Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
    Definition: concepts/pixel.hpp:277
    +
    Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
    Definition: concepts/pixel.hpp:256
    +
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    +
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    +
    Pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:170
    +
    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:339
    diff --git a/develop/doc/html/reference/concepts_2pixel__iterator_8hpp_source.html b/develop/doc/html/reference/concepts_2pixel__iterator_8hpp_source.html index b104c10ba..466f99360 100644 --- a/develop/doc/html/reference/concepts_2pixel__iterator_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2pixel__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_iterator.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:34
    -
    Pixel iterator that allows for changing its pixel.
    Definition: concepts/pixel_iterator.hpp:209
    -
    Concept of a random-access iterator that can be advanced in memory units (bytes or bits) ...
    Definition: concepts/pixel_iterator.hpp:236
    -
    Definition: algorithm.hpp:30
    -
    returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
    Definition: metafunctions.hpp:35
    -
    Iterator adaptor is a forward iterator adapting another forward iterator.
    Definition: concepts/pixel_iterator.hpp:317
    -
    Step iterator that allows for modifying its current value.
    Definition: concepts/pixel_iterator.hpp:275
    -
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    -
    Concept for locators and views that can define a type just like the given locator or view...
    Definition: concepts/pixel_iterator.hpp:137
    -
    Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
    Definition: pixel_iterator.hpp:36
    -
    Iterator adaptor that is mutable.
    Definition: concepts/pixel_iterator.hpp:342
    -
    Metafunction predicate returning whether the given iterator allows for changing its values...
    Definition: pixel_iterator.hpp:49
    -
    Definition: concepts/pixel_iterator.hpp:110
    -
    An STL random access traversal iterator over a model of PixelConcept.
    Definition: concepts/pixel_iterator.hpp:170
    -
    Returns the type of an iterator just like the input iterator, except operating over immutable values...
    Definition: pixel_iterator.hpp:40
    -
    Step iterator concept.
    Definition: concepts/pixel_iterator.hpp:257
    +
    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
    +
    returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
    Definition: metafunctions.hpp:35
    +
    Iterator adaptor is a forward iterator adapting another forward iterator.
    Definition: concepts/pixel_iterator.hpp:317
    +
    Metafunction predicate returning whether the given iterator allows for changing its values.
    Definition: pixel_iterator.hpp:49
    +
    Returns the type of an iterator just like the input iterator, except operating over immutable values.
    Definition: pixel_iterator.hpp:40
    +
    Concept for locators and views that can define a type just like the given locator or view,...
    Definition: concepts/pixel_iterator.hpp:137
    +
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:34
    +
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    +
    Step iterator concept.
    Definition: concepts/pixel_iterator.hpp:257
    +
    Pixel iterator that allows for changing its pixel.
    Definition: concepts/pixel_iterator.hpp:209
    +
    Iterator adaptor that is mutable.
    Definition: concepts/pixel_iterator.hpp:342
    +
    Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
    Definition: concepts/pixel_iterator.hpp:236
    +
    An STL random access traversal iterator over a model of PixelConcept.
    Definition: concepts/pixel_iterator.hpp:170
    +
    Definition: concepts/pixel_iterator.hpp:110
    +
    Step iterator that allows for modifying its current value.
    Definition: concepts/pixel_iterator.hpp:275
    +
    Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
    Definition: pixel_iterator.hpp:36
    diff --git a/develop/doc/html/reference/concepts_2point_8hpp_source.html b/develop/doc/html/reference/concepts_2point_8hpp_source.html index 258547449..cf7dd1df9 100644 --- a/develop/doc/html/reference/concepts_2point_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2point_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: point.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    N-dimensional point concept.
    Definition: concepts/point.hpp:61
    -
    2-dimensional point concept
    Definition: concepts/point.hpp:103
    -
    2D point both axes of which have the same dimension typeModels: Point2DConcept
    Definition: locator.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_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
    +
    T & axis_value(point< T > &p)
    Definition: point.hpp:234
    +
    2-dimensional point concept
    Definition: concepts/point.hpp:103
    +
    N-dimensional point concept.
    Definition: concepts/point.hpp:61
    +
    2D point both axes of which have the same dimension type
    Definition: locator.hpp:28
    diff --git a/develop/doc/html/reference/concepts_8hpp_source.html b/develop/doc/html/reference/concepts_8hpp_source.html index 96f099a58..212c369d2 100644 --- a/develop/doc/html/reference/concepts_8hpp_source.html +++ b/develop/doc/html/reference/concepts_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: concepts.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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/develop/doc/html/reference/conversion__policies_8hpp_source.html b/develop/doc/html/reference/conversion__policies_8hpp_source.html index 457a9d4fa..e8da1204d 100644 --- a/develop/doc/html/reference/conversion__policies_8hpp_source.html +++ b/develop/doc/html/reference/conversion__policies_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: conversion_policies.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    Determines if reader type is read only ( no conversion ).
    Definition: conversion_policies.hpp:97
    -
    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:139
    +
    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:139
    +
    Determines if reader type is read only ( no conversion ).
    Definition: conversion_policies.hpp:97
    diff --git a/develop/doc/html/reference/deprecated_8hpp_source.html b/develop/doc/html/reference/deprecated_8hpp_source.html index ab9ca6e10..a9a06a6b9 100644 --- a/develop/doc/html/reference/deprecated_8hpp_source.html +++ b/develop/doc/html/reference/deprecated_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: deprecated.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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_DEPRECATED_HPP
    9 #define BOOST_GIL_DEPRECATED_HPP
    10 
    11 #include <cstddef>
    12 
    15 
    16 #define planar_ptr planar_pixel_iterator
    17 #define planar_ref planar_pixel_reference
    18 #define membased_2d_locator memory_based_2d_locator
    19 #define pixel_step_iterator memory_based_step_iterator
    20 #define pixel_image_iterator iterator_from_2d
    21 
    22 #define equal_channels static_equal
    23 #define copy_channels static_copy
    24 #define fill_channels static_fill
    25 #define generate_channels static_generate
    26 #define for_each_channel static_for_each
    27 #define transform_channels static_transform
    28 #define max_channel static_max
    29 #define min_channel static_min
    30 
    31 #define semantic_channel semantic_at_c
    32 
    33 template <typename Img>
    34 void resize_clobber_image(Img& img, const typename Img::point_t& new_dims) {
    35  img.recreate(new_dims);
    36 }
    37 
    38 template <typename Img>
    39 void resize_clobber_image(Img& img, const typename Img::x_coord_t& width, const typename Img::y_coord_t& height) {
    40  img.recreate(width,height);
    41 }
    42 
    43 template <typename T> typename T::x_coord_t get_width(const T& a) { return a.width(); }
    44 template <typename T> typename T::y_coord_t get_height(const T& a) { return a.height(); }
    45 template <typename T> typename T::point_t get_dimensions(const T& a) { return a.dimensions(); }
    46 template <typename T> std::size_t get_num_channels(const T& a) { return a.num_channels(); }
    47 
    48 #define GIL boost::gil
    49 #define ADOBE_GIL_NAMESPACE_BEGIN namespace boost { namespace gil {
    50 #define ADOBE_GIL_NAMESPACE_END } }
    51 
    52 #define ByteAdvancableIteratorConcept MemoryBasedIteratorConcept
    53 #define byte_advance memunit_advance
    54 #define byte_advanced memunit_advanced
    55 #define byte_step memunit_step
    56 #define byte_distance memunit_distance
    57 
    58 #define byte_addressable_step_iterator memory_based_step_iterator
    59 #define byte_addressable_2d_locator memory_based_2d_locator
    60 
    61 // These are members of memory-based locators
    62 //#define row_bytes row_size // commented out because row_bytes is commonly used
    63 #define pix_bytestep pixel_size
    64 
    65 #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_DEPRECATED_HPP
    +
    9 #define BOOST_GIL_DEPRECATED_HPP
    +
    10 
    +
    11 #include <cstddef>
    +
    12 
    +
    15 
    +
    16 #define planar_ptr planar_pixel_iterator
    +
    17 #define planar_ref planar_pixel_reference
    +
    18 #define membased_2d_locator memory_based_2d_locator
    +
    19 #define pixel_step_iterator memory_based_step_iterator
    +
    20 #define pixel_image_iterator iterator_from_2d
    +
    21 
    +
    22 #define equal_channels static_equal
    +
    23 #define copy_channels static_copy
    +
    24 #define fill_channels static_fill
    +
    25 #define generate_channels static_generate
    +
    26 #define for_each_channel static_for_each
    +
    27 #define transform_channels static_transform
    +
    28 #define max_channel static_max
    +
    29 #define min_channel static_min
    +
    30 
    +
    31 #define semantic_channel semantic_at_c
    +
    32 
    +
    33 template <typename Img>
    +
    34 void resize_clobber_image(Img& img, const typename Img::point_t& new_dims) {
    +
    35  img.recreate(new_dims);
    +
    36 }
    +
    37 
    +
    38 template <typename Img>
    +
    39 void resize_clobber_image(Img& img, const typename Img::x_coord_t& width, const typename Img::y_coord_t& height) {
    +
    40  img.recreate(width,height);
    +
    41 }
    +
    42 
    +
    43 template <typename T> typename T::x_coord_t get_width(const T& a) { return a.width(); }
    +
    44 template <typename T> typename T::y_coord_t get_height(const T& a) { return a.height(); }
    +
    45 template <typename T> typename T::point_t get_dimensions(const T& a) { return a.dimensions(); }
    +
    46 template <typename T> std::size_t get_num_channels(const T& a) { return a.num_channels(); }
    +
    47 
    +
    48 #define GIL boost::gil
    +
    49 #define ADOBE_GIL_NAMESPACE_BEGIN namespace boost { namespace gil {
    +
    50 #define ADOBE_GIL_NAMESPACE_END } }
    +
    51 
    +
    52 #define ByteAdvancableIteratorConcept MemoryBasedIteratorConcept
    +
    53 #define byte_advance memunit_advance
    +
    54 #define byte_advanced memunit_advanced
    +
    55 #define byte_step memunit_step
    +
    56 #define byte_distance memunit_distance
    +
    57 
    +
    58 #define byte_addressable_step_iterator memory_based_step_iterator
    +
    59 #define byte_addressable_2d_locator memory_based_2d_locator
    +
    60 
    +
    61 // These are members of memory-based locators
    +
    62 //#define row_bytes row_size // commented out because row_bytes is commonly used
    +
    63 #define pix_bytestep pixel_size
    +
    64 
    +
    65 #endif
    +
    diff --git a/develop/doc/html/reference/device_8hpp_source.html b/develop/doc/html/reference/device_8hpp_source.html index 27832b7a9..49d284e86 100644 --- a/develop/doc/html/reference/device_8hpp_source.html +++ b/develop/doc/html/reference/device_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: device.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    1 //
    2 // Copyright 2007-2012 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_DEVICE_HPP
    9 #define BOOST_GIL_IO_DEVICE_HPP
    10 
    11 #include <boost/gil/detail/mp11.hpp>
    12 #include <boost/gil/io/base.hpp>
    13 
    14 #include <cstdio>
    15 #include <memory>
    16 #include <type_traits>
    17 
    18 namespace boost { namespace gil {
    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 detail {
    26 
    27 template < typename T > struct buff_item
    28 {
    29  static const unsigned int size = sizeof( T );
    30 };
    31 
    32 template <> struct buff_item< void >
    33 {
    34  static const unsigned int size = 1;
    35 };
    36 
    47 template< typename FormatTag >
    49 {
    50 public:
    51 
    52  using format_tag_t = FormatTag;
    53 
    54 public:
    55 
    57  struct read_tag {};
    58  struct write_tag {};
    59 
    63  file_stream_device( const std::string& file_name
    64  , read_tag tag = read_tag()
    65  )
    66  : file_stream_device(file_name.c_str(), tag)
    67  {}
    68 
    72  file_stream_device( const char* file_name
    73  , read_tag = read_tag()
    74  )
    75  {
    76  FILE* file = nullptr;
    77 
    78  io_error_if( ( file = fopen( file_name, "rb" )) == nullptr
    79  , "file_stream_device: failed to open file for reading"
    80  );
    81 
    82  _file = file_ptr_t( file
    83  , file_deleter
    84  );
    85  }
    86 
    90  file_stream_device( const std::string& file_name
    91  , write_tag tag
    92  )
    93  : file_stream_device(file_name.c_str(), tag)
    94  {}
    95 
    99  file_stream_device( const char* file_name
    100  , write_tag
    101  )
    102  {
    103  FILE* file = nullptr;
    104 
    105  io_error_if( ( file = fopen( file_name, "wb" )) == nullptr
    106  , "file_stream_device: failed to open file for writing"
    107  );
    108 
    109  _file = file_ptr_t( file
    110  , file_deleter
    111  );
    112  }
    113 
    117  file_stream_device( FILE* file )
    118  : _file( file
    119  , file_deleter
    120  )
    121  {}
    122 
    123  FILE* get() { return _file.get(); }
    124  const FILE* get() const { return _file.get(); }
    125 
    126  int getc_unchecked()
    127  {
    128  return std::getc( get() );
    129  }
    130 
    131  char getc()
    132  {
    133  int ch;
    134 
    135  io_error_if( ( ch = std::getc( get() )) == EOF
    136  , "file_stream_device: unexpected EOF"
    137  );
    138 
    139  return ( char ) ch;
    140  }
    141 
    143  std::size_t read( byte_t* data
    144  , std::size_t count
    145  )
    146  {
    147  std::size_t num_elements = fread( data
    148  , 1
    149  , static_cast<int>( count )
    150  , get()
    151  );
    152 
    154  io_error_if( ferror( get() )
    155  , "file_stream_device: file read error"
    156  );
    157 
    158  //libjpeg sometimes reads blocks in 4096 bytes even when the file is smaller than that.
    159  //return value indicates how much was actually read
    160  //returning less than "count" is not an error
    161  return num_elements;
    162  }
    163 
    165  template< typename T
    166  , int N
    167  >
    168  void read( T (&buf)[N] )
    169  {
    170  io_error_if( read( buf, N ) < N
    171  , "file_stream_device: file read error"
    172  );
    173  }
    174 
    176  uint8_t read_uint8()
    177  {
    178  byte_t m[1];
    179 
    180  read( m );
    181  return m[0];
    182  }
    183 
    185  uint16_t read_uint16()
    186  {
    187  byte_t m[2];
    188 
    189  read( m );
    190  return (m[1] << 8) | m[0];
    191  }
    192 
    194  uint32_t read_uint32()
    195  {
    196  byte_t m[4];
    197 
    198  read( m );
    199  return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
    200  }
    201 
    203  template < typename T >
    204  std::size_t write( const T* buf
    205  , std::size_t count
    206  )
    207  {
    208  std::size_t num_elements = fwrite( buf
    209  , buff_item<T>::size
    210  , count
    211  , get()
    212  );
    213 
    214  //return value indicates how much was actually written
    215  //returning less than "count" is not an error
    216  return num_elements;
    217  }
    218 
    220  template < typename T
    221  , std::size_t N
    222  >
    223  void write( const T (&buf)[N] )
    224  {
    225  io_error_if( write( buf, N ) < N
    226  , "file_stream_device: file write error"
    227  );
    228  return ;
    229  }
    230 
    232  void write_uint8( uint8_t x )
    233  {
    234  byte_t m[1] = { x };
    235  write(m);
    236  }
    237 
    239  void write_uint16( uint16_t x )
    240  {
    241  byte_t m[2];
    242 
    243  m[0] = byte_t( x >> 0 );
    244  m[1] = byte_t( x >> 8 );
    245 
    246  write( m );
    247  }
    248 
    250  void write_uint32( uint32_t x )
    251  {
    252  byte_t m[4];
    253 
    254  m[0] = byte_t( x >> 0 );
    255  m[1] = byte_t( x >> 8 );
    256  m[2] = byte_t( x >> 16 );
    257  m[3] = byte_t( x >> 24 );
    258 
    259  write( m );
    260  }
    261 
    262  void seek( long count, int whence = SEEK_SET )
    263  {
    264  io_error_if( fseek( get()
    265  , count
    266  , whence
    267  ) != 0
    268  , "file_stream_device: file seek error"
    269  );
    270  }
    271 
    272  long int tell()
    273  {
    274  long int pos = ftell( get() );
    275 
    276  io_error_if( pos == -1L
    277  , "file_stream_device: file position error"
    278  );
    279 
    280  return pos;
    281  }
    282 
    283  void flush()
    284  {
    285  fflush( get() );
    286  }
    287 
    289  void print_line( const std::string& line )
    290  {
    291  std::size_t num_elements = fwrite( line.c_str()
    292  , sizeof( char )
    293  , line.size()
    294  , get()
    295  );
    296 
    297  io_error_if( num_elements < line.size()
    298  , "file_stream_device: line print error"
    299  );
    300  }
    301 
    302  int error()
    303  {
    304  return ferror( get() );
    305  }
    306 
    307 private:
    308 
    309  static void file_deleter( FILE* file )
    310  {
    311  if( file )
    312  {
    313  fclose( file );
    314  }
    315  }
    316 
    317 private:
    318 
    319  using file_ptr_t = std::shared_ptr<FILE> ;
    320  file_ptr_t _file;
    321 };
    322 
    326 template< typename FormatTag >
    328 {
    329 public:
    330  istream_device( std::istream& in )
    331  : _in( in )
    332  {
    333  // does the file exists?
    334  io_error_if( !in
    335  , "istream_device: Stream is not valid."
    336  );
    337  }
    338 
    339  int getc_unchecked()
    340  {
    341  return _in.get();
    342  }
    343 
    344  char getc()
    345  {
    346  int ch;
    347 
    348  io_error_if( ( ch = _in.get() ) == EOF
    349  , "istream_device: unexpected EOF"
    350  );
    351 
    352  return ( char ) ch;
    353  }
    354 
    355  std::size_t read( byte_t* data
    356  , std::size_t count )
    357  {
    358  std::streamsize cr = 0;
    359 
    360  do
    361  {
    362  _in.peek();
    363  std::streamsize c = _in.readsome( reinterpret_cast< char* >( data )
    364  , static_cast< std::streamsize >( count ));
    365 
    366  count -= static_cast< std::size_t >( c );
    367  data += c;
    368  cr += c;
    369 
    370  } while( count && _in );
    371 
    372  return static_cast< std::size_t >( cr );
    373  }
    374 
    376  template<typename T, int N>
    377  void read(T (&buf)[N])
    378  {
    379  read(buf, N);
    380  }
    381 
    383  uint8_t read_uint8()
    384  {
    385  byte_t m[1];
    386 
    387  read( m );
    388  return m[0];
    389  }
    390 
    392  uint16_t read_uint16()
    393  {
    394  byte_t m[2];
    395 
    396  read( m );
    397  return (m[1] << 8) | m[0];
    398  }
    399 
    401  uint32_t read_uint32()
    402  {
    403  byte_t m[4];
    404 
    405  read( m );
    406  return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
    407  }
    408 
    409  void seek( long count, int whence = SEEK_SET )
    410  {
    411  _in.seekg( count
    412  , whence == SEEK_SET ? std::ios::beg
    413  :( whence == SEEK_CUR ? std::ios::cur
    414  : std::ios::end )
    415  );
    416  }
    417 
    418  void write(const byte_t*, std::size_t)
    419  {
    420  io_error( "istream_device: Bad io error." );
    421  }
    422 
    423  void flush() {}
    424 
    425 private:
    426 
    427  std::istream& _in;
    428 };
    429 
    433 template< typename FormatTag >
    435 {
    436 public:
    437  ostream_device( std::ostream & out )
    438  : _out( out )
    439  {
    440  }
    441 
    442  std::size_t read(byte_t *, std::size_t)
    443  {
    444  io_error( "ostream_device: Bad io error." );
    445  return 0;
    446  }
    447 
    448  void seek( long count, int whence )
    449  {
    450  _out.seekp( count
    451  , whence == SEEK_SET
    452  ? std::ios::beg
    453  : ( whence == SEEK_CUR
    454  ?std::ios::cur
    455  :std::ios::end )
    456  );
    457  }
    458 
    459  void write( const byte_t* data
    460  , std::size_t count )
    461  {
    462  _out.write( reinterpret_cast<char const*>( data )
    463  , static_cast<std::streamsize>( count )
    464  );
    465  }
    466 
    468  template < typename T
    469  , std::size_t N
    470  >
    471  void write( const T (&buf)[N] )
    472  {
    473  write( buf, N );
    474  }
    475 
    477  void write_uint8( uint8_t x )
    478  {
    479  byte_t m[1] = { x };
    480  write(m);
    481  }
    482 
    484  void write_uint16( uint16_t x )
    485  {
    486  byte_t m[2];
    487 
    488  m[0] = byte_t( x >> 0 );
    489  m[1] = byte_t( x >> 8 );
    490 
    491  write( m );
    492  }
    493 
    495  void write_uint32( uint32_t x )
    496  {
    497  byte_t m[4];
    498 
    499  m[0] = byte_t( x >> 0 );
    500  m[1] = byte_t( x >> 8 );
    501  m[2] = byte_t( x >> 16 );
    502  m[3] = byte_t( x >> 24 );
    503 
    504  write( m );
    505  }
    506 
    507  void flush()
    508  {
    509  _out << std::flush;
    510  }
    511 
    513  void print_line( const std::string& line )
    514  {
    515  _out << line;
    516  }
    517 
    518 
    519 
    520 private:
    521 
    522  std::ostream& _out;
    523 };
    524 
    525 
    530 template< typename IODevice > struct is_input_device : std::false_type{};
    531 template< typename FormatTag > struct is_input_device< file_stream_device< FormatTag > > : std::true_type{};
    532 template< typename FormatTag > struct is_input_device< istream_device< FormatTag > > : std::true_type{};
    533 
    534 template< typename FormatTag
    535  , typename T
    536  , typename D = void
    537  >
    538 struct is_adaptable_input_device : std::false_type{};
    539 
    540 template <typename FormatTag, typename T>
    541 struct is_adaptable_input_device
    542 <
    543  FormatTag,
    544  T,
    545  typename std::enable_if
    546  <
    547  mp11::mp_or
    548  <
    549  std::is_base_of<std::istream, T>,
    550  std::is_same<std::istream, T>
    551  >::value
    552  >::type
    553 > : std::true_type
    554 {
    555  using device_type = istream_device<FormatTag>;
    556 };
    557 
    558 template< typename FormatTag >
    559 struct is_adaptable_input_device< FormatTag
    560  , FILE*
    561  , void
    562  >
    563  : std::true_type
    564 {
    565  using device_type = file_stream_device<FormatTag>;
    566 };
    567 
    571 template< typename FormatTag
    572  , typename T
    573  , typename D = void
    574  >
    575 struct is_read_device : std::false_type
    576 {};
    577 
    578 template <typename FormatTag, typename T>
    579 struct is_read_device
    580 <
    581  FormatTag,
    582  T,
    583  typename std::enable_if
    584  <
    585  mp11::mp_or
    586  <
    587  is_input_device<FormatTag>,
    588  is_adaptable_input_device<FormatTag, T>
    589  >::value
    590  >::type
    591 > : std::true_type
    592 {
    593 };
    594 
    595 
    600 template<typename IODevice> struct is_output_device : std::false_type{};
    601 
    602 template< typename FormatTag > struct is_output_device< file_stream_device< FormatTag > > : std::true_type{};
    603 template< typename FormatTag > struct is_output_device< ostream_device < FormatTag > > : std::true_type{};
    604 
    605 template< typename FormatTag
    606  , typename IODevice
    607  , typename D = void
    608  >
    609 struct is_adaptable_output_device : std::false_type {};
    610 
    611 template <typename FormatTag, typename T>
    612 struct is_adaptable_output_device
    613 <
    614  FormatTag,
    615  T,
    616  typename std::enable_if
    617  <
    618  mp11::mp_or
    619  <
    620  std::is_base_of<std::ostream, T>,
    621  std::is_same<std::ostream, T>
    622  >::value
    623  >::type
    624 > : std::true_type
    625 {
    626  using device_type = ostream_device<FormatTag>;
    627 };
    628 
    629 template<typename FormatTag> struct is_adaptable_output_device<FormatTag,FILE*,void>
    630  : std::true_type
    631 {
    632  using device_type = file_stream_device<FormatTag>;
    633 };
    634 
    635 
    639 template< typename FormatTag
    640  , typename T
    641  , typename D = void
    642  >
    643 struct is_write_device : std::false_type
    644 {};
    645 
    646 template <typename FormatTag, typename T>
    647 struct is_write_device
    648 <
    649  FormatTag,
    650  T,
    651  typename std::enable_if
    652  <
    653  mp11::mp_or
    654  <
    655  is_output_device<FormatTag>,
    656  is_adaptable_output_device<FormatTag, T>
    657  >::value
    658  >::type
    659 > : std::true_type
    660 {
    661 };
    662 
    663 } // namespace detail
    664 
    665 template< typename Device, typename FormatTag > class scanline_reader;
    666 template< typename Device, typename FormatTag, typename ConversionPolicy > class reader;
    667 
    668 template< typename Device, typename FormatTag, typename Log = no_log > class writer;
    669 
    670 template< typename Device, typename FormatTag > class dynamic_image_reader;
    671 template< typename Device, typename FormatTag, typename Log = no_log > class dynamic_image_writer;
    672 
    673 
    674 namespace detail {
    675 
    676 template< typename T >
    677 struct is_reader : std::false_type
    678 {};
    679 
    680 template< typename Device
    681  , typename FormatTag
    682  , typename ConversionPolicy
    683  >
    684 struct is_reader< reader< Device
    685  , FormatTag
    686  , ConversionPolicy
    687  >
    688  > : std::true_type
    689 {};
    690 
    691 template< typename T >
    692 struct is_dynamic_image_reader : std::false_type
    693 {};
    694 
    695 template< typename Device
    696  , typename FormatTag
    697  >
    698 struct is_dynamic_image_reader< dynamic_image_reader< Device
    699  , FormatTag
    700  >
    701  > : std::true_type
    702 {};
    703 
    704 template< typename T >
    705 struct is_writer : std::false_type
    706 {};
    707 
    708 template< typename Device
    709  , typename FormatTag
    710  >
    711 struct is_writer< writer< Device
    712  , FormatTag
    713  >
    714  > : std::true_type
    715 {};
    716 
    717 template< typename T >
    718 struct is_dynamic_image_writer : std::false_type
    719 {};
    720 
    721 template< typename Device
    722  , typename FormatTag
    723  >
    724 struct is_dynamic_image_writer< dynamic_image_writer< Device
    725  , FormatTag
    726  >
    727  > : std::true_type
    728 {};
    729 
    730 } // namespace detail
    731 
    732 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    733 #pragma warning(pop)
    734 #endif
    735 
    736 } // namespace gil
    737 } // namespace boost
    738 
    739 #endif
    Definition: device.hpp:530
    -
    void write_uint8(uint8_t x)
    Writes byte.
    Definition: device.hpp:477
    -
    file_stream_device(const std::string &file_name, write_tag tag)
    Definition: device.hpp:90
    -
    Definition: algorithm.hpp:30
    -
    std::size_t read(byte_t *data, std::size_t count)
    Definition: device.hpp:143
    -
    void print_line(const std::string &line)
    Prints formatted ASCII text.
    Definition: device.hpp:289
    -
    void read(T(&buf)[N])
    Reads array.
    Definition: device.hpp:377
    -
    uint16_t read_uint16()
    Reads 16 bit little endian integer.
    Definition: device.hpp:185
    -
    std::size_t write(const T *buf, std::size_t count)
    Writes number of elements from a buffer.
    Definition: device.hpp:204
    -
    uint16_t read_uint16()
    Reads 16 bit little endian integer.
    Definition: device.hpp:392
    -
    void write(const T(&buf)[N])
    Writes array.
    Definition: device.hpp:223
    -
    Definition: device.hpp:575
    -
    void write_uint32(uint32_t x)
    Writes 32 bit little endian integer.
    Definition: device.hpp:250
    -
    void write_uint8(uint8_t x)
    Writes byte.
    Definition: device.hpp:232
    -
    uint32_t read_uint32()
    Reads 32 bit little endian integer.
    Definition: device.hpp:194
    -
    void write_uint16(uint16_t x)
    Writes 16 bit little endian integer.
    Definition: device.hpp:239
    -
    uint8_t read_uint8()
    Reads byte.
    Definition: device.hpp:383
    -
    Used to overload the constructor.
    Definition: device.hpp:57
    -
    uint8_t read_uint8()
    Reads byte.
    Definition: device.hpp:176
    -
    Definition: device.hpp:600
    -
    uint32_t read_uint32()
    Reads 32 bit little endian integer.
    Definition: device.hpp:401
    -
    file_stream_device(const char *file_name, read_tag=read_tag())
    Definition: device.hpp:72
    -
    void write(const T(&buf)[N])
    Writes array.
    Definition: device.hpp:471
    -
    file_stream_device(const std::string &file_name, read_tag tag=read_tag())
    Definition: device.hpp:63
    - -
    Definition: device.hpp:643
    -
    void write_uint16(uint16_t x)
    Writes 16 bit little endian integer.
    Definition: device.hpp:484
    -
    Definition: device.hpp:434
    -
    Definition: device.hpp:327
    -
    file_stream_device(FILE *file)
    Definition: device.hpp:117
    -
    void print_line(const std::string &line)
    Prints formatted ASCII text.
    Definition: device.hpp:513
    -
    void read(T(&buf)[N])
    Reads array.
    Definition: device.hpp:168
    -
    file_stream_device(const char *file_name, write_tag)
    Definition: device.hpp:99
    -
    void write_uint32(uint32_t x)
    Writes 32 bit little endian integer.
    Definition: device.hpp:495
    +
    1 //
    +
    2 // Copyright 2007-2012 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_DEVICE_HPP
    +
    9 #define BOOST_GIL_IO_DEVICE_HPP
    +
    10 
    +
    11 #include <boost/gil/detail/mp11.hpp>
    +
    12 #include <boost/gil/io/base.hpp>
    +
    13 
    +
    14 #include <cstdio>
    +
    15 #include <memory>
    +
    16 #include <type_traits>
    +
    17 
    +
    18 namespace boost { namespace gil {
    +
    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 detail {
    +
    26 
    +
    27 template < typename T > struct buff_item
    +
    28 {
    +
    29  static const unsigned int size = sizeof( T );
    +
    30 };
    +
    31 
    +
    32 template <> struct buff_item< void >
    +
    33 {
    +
    34  static const unsigned int size = 1;
    +
    35 };
    +
    36 
    +
    47 template< typename FormatTag >
    + +
    49 {
    +
    50 public:
    +
    51 
    +
    52  using format_tag_t = FormatTag;
    +
    53 
    +
    54 public:
    +
    55 
    +
    57  struct read_tag {};
    +
    58  struct write_tag {};
    +
    59 
    +
    63  file_stream_device( const std::string& file_name
    +
    64  , read_tag tag = read_tag()
    +
    65  )
    +
    66  : file_stream_device(file_name.c_str(), tag)
    +
    67  {}
    +
    68 
    +
    72  file_stream_device( const char* file_name
    +
    73  , read_tag = read_tag()
    +
    74  )
    +
    75  {
    +
    76  FILE* file = nullptr;
    +
    77 
    +
    78  io_error_if( ( file = fopen( file_name, "rb" )) == nullptr
    +
    79  , "file_stream_device: failed to open file for reading"
    +
    80  );
    +
    81 
    +
    82  _file = file_ptr_t( file
    +
    83  , file_deleter
    +
    84  );
    +
    85  }
    +
    86 
    +
    90  file_stream_device( const std::string& file_name
    +
    91  , write_tag tag
    +
    92  )
    +
    93  : file_stream_device(file_name.c_str(), tag)
    +
    94  {}
    +
    95 
    +
    99  file_stream_device( const char* file_name
    +
    100  , write_tag
    +
    101  )
    +
    102  {
    +
    103  FILE* file = nullptr;
    +
    104 
    +
    105  io_error_if( ( file = fopen( file_name, "wb" )) == nullptr
    +
    106  , "file_stream_device: failed to open file for writing"
    +
    107  );
    +
    108 
    +
    109  _file = file_ptr_t( file
    +
    110  , file_deleter
    +
    111  );
    +
    112  }
    +
    113 
    +
    117  file_stream_device( FILE* file )
    +
    118  : _file( file
    +
    119  , file_deleter
    +
    120  )
    +
    121  {}
    +
    122 
    +
    123  FILE* get() { return _file.get(); }
    +
    124  const FILE* get() const { return _file.get(); }
    +
    125 
    +
    126  int getc_unchecked()
    +
    127  {
    +
    128  return std::getc( get() );
    +
    129  }
    +
    130 
    +
    131  char getc()
    +
    132  {
    +
    133  int ch;
    +
    134 
    +
    135  io_error_if( ( ch = std::getc( get() )) == EOF
    +
    136  , "file_stream_device: unexpected EOF"
    +
    137  );
    +
    138 
    +
    139  return ( char ) ch;
    +
    140  }
    +
    141 
    +
    143  std::size_t read( byte_t* data
    +
    144  , std::size_t count
    +
    145  )
    +
    146  {
    +
    147  std::size_t num_elements = fread( data
    +
    148  , 1
    +
    149  , static_cast<int>( count )
    +
    150  , get()
    +
    151  );
    +
    152 
    +
    154  io_error_if( ferror( get() )
    +
    155  , "file_stream_device: file read error"
    +
    156  );
    +
    157 
    +
    158  //libjpeg sometimes reads blocks in 4096 bytes even when the file is smaller than that.
    +
    159  //return value indicates how much was actually read
    +
    160  //returning less than "count" is not an error
    +
    161  return num_elements;
    +
    162  }
    +
    163 
    +
    165  template< typename T
    +
    166  , int N
    +
    167  >
    +
    168  void read( T (&buf)[N] )
    +
    169  {
    +
    170  io_error_if( read( buf, N ) < N
    +
    171  , "file_stream_device: file read error"
    +
    172  );
    +
    173  }
    +
    174 
    +
    176  uint8_t read_uint8()
    +
    177  {
    +
    178  byte_t m[1];
    +
    179 
    +
    180  read( m );
    +
    181  return m[0];
    +
    182  }
    +
    183 
    +
    185  uint16_t read_uint16()
    +
    186  {
    +
    187  byte_t m[2];
    +
    188 
    +
    189  read( m );
    +
    190  return (m[1] << 8) | m[0];
    +
    191  }
    +
    192 
    +
    194  uint32_t read_uint32()
    +
    195  {
    +
    196  byte_t m[4];
    +
    197 
    +
    198  read( m );
    +
    199  return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
    +
    200  }
    +
    201 
    +
    203  template < typename T >
    +
    204  std::size_t write( const T* buf
    +
    205  , std::size_t count
    +
    206  )
    +
    207  {
    +
    208  std::size_t num_elements = fwrite( buf
    +
    209  , buff_item<T>::size
    +
    210  , count
    +
    211  , get()
    +
    212  );
    +
    213 
    +
    214  //return value indicates how much was actually written
    +
    215  //returning less than "count" is not an error
    +
    216  return num_elements;
    +
    217  }
    +
    218 
    +
    220  template < typename T
    +
    221  , std::size_t N
    +
    222  >
    +
    223  void write( const T (&buf)[N] )
    +
    224  {
    +
    225  io_error_if( write( buf, N ) < N
    +
    226  , "file_stream_device: file write error"
    +
    227  );
    +
    228  return ;
    +
    229  }
    +
    230 
    +
    232  void write_uint8( uint8_t x )
    +
    233  {
    +
    234  byte_t m[1] = { x };
    +
    235  write(m);
    +
    236  }
    +
    237 
    +
    239  void write_uint16( uint16_t x )
    +
    240  {
    +
    241  byte_t m[2];
    +
    242 
    +
    243  m[0] = byte_t( x >> 0 );
    +
    244  m[1] = byte_t( x >> 8 );
    +
    245 
    +
    246  write( m );
    +
    247  }
    +
    248 
    +
    250  void write_uint32( uint32_t x )
    +
    251  {
    +
    252  byte_t m[4];
    +
    253 
    +
    254  m[0] = byte_t( x >> 0 );
    +
    255  m[1] = byte_t( x >> 8 );
    +
    256  m[2] = byte_t( x >> 16 );
    +
    257  m[3] = byte_t( x >> 24 );
    +
    258 
    +
    259  write( m );
    +
    260  }
    +
    261 
    +
    262  void seek( long count, int whence = SEEK_SET )
    +
    263  {
    +
    264  io_error_if( fseek( get()
    +
    265  , count
    +
    266  , whence
    +
    267  ) != 0
    +
    268  , "file_stream_device: file seek error"
    +
    269  );
    +
    270  }
    +
    271 
    +
    272  long int tell()
    +
    273  {
    +
    274  long int pos = ftell( get() );
    +
    275 
    +
    276  io_error_if( pos == -1L
    +
    277  , "file_stream_device: file position error"
    +
    278  );
    +
    279 
    +
    280  return pos;
    +
    281  }
    +
    282 
    +
    283  void flush()
    +
    284  {
    +
    285  fflush( get() );
    +
    286  }
    +
    287 
    +
    289  void print_line( const std::string& line )
    +
    290  {
    +
    291  std::size_t num_elements = fwrite( line.c_str()
    +
    292  , sizeof( char )
    +
    293  , line.size()
    +
    294  , get()
    +
    295  );
    +
    296 
    +
    297  io_error_if( num_elements < line.size()
    +
    298  , "file_stream_device: line print error"
    +
    299  );
    +
    300  }
    +
    301 
    +
    302  int error()
    +
    303  {
    +
    304  return ferror( get() );
    +
    305  }
    +
    306 
    +
    307 private:
    +
    308 
    +
    309  static void file_deleter( FILE* file )
    +
    310  {
    +
    311  if( file )
    +
    312  {
    +
    313  fclose( file );
    +
    314  }
    +
    315  }
    +
    316 
    +
    317 private:
    +
    318 
    +
    319  using file_ptr_t = std::shared_ptr<FILE> ;
    +
    320  file_ptr_t _file;
    +
    321 };
    +
    322 
    +
    326 template< typename FormatTag >
    + +
    328 {
    +
    329 public:
    +
    330  istream_device( std::istream& in )
    +
    331  : _in( in )
    +
    332  {
    +
    333  // does the file exists?
    +
    334  io_error_if( !in
    +
    335  , "istream_device: Stream is not valid."
    +
    336  );
    +
    337  }
    +
    338 
    +
    339  int getc_unchecked()
    +
    340  {
    +
    341  return _in.get();
    +
    342  }
    +
    343 
    +
    344  char getc()
    +
    345  {
    +
    346  int ch;
    +
    347 
    +
    348  io_error_if( ( ch = _in.get() ) == EOF
    +
    349  , "istream_device: unexpected EOF"
    +
    350  );
    +
    351 
    +
    352  return ( char ) ch;
    +
    353  }
    +
    354 
    +
    355  std::size_t read( byte_t* data
    +
    356  , std::size_t count )
    +
    357  {
    +
    358  std::streamsize cr = 0;
    +
    359 
    +
    360  do
    +
    361  {
    +
    362  _in.peek();
    +
    363  std::streamsize c = _in.readsome( reinterpret_cast< char* >( data )
    +
    364  , static_cast< std::streamsize >( count ));
    +
    365 
    +
    366  count -= static_cast< std::size_t >( c );
    +
    367  data += c;
    +
    368  cr += c;
    +
    369 
    +
    370  } while( count && _in );
    +
    371 
    +
    372  return static_cast< std::size_t >( cr );
    +
    373  }
    +
    374 
    +
    376  template<typename T, int N>
    +
    377  void read(T (&buf)[N])
    +
    378  {
    +
    379  read(buf, N);
    +
    380  }
    +
    381 
    +
    383  uint8_t read_uint8()
    +
    384  {
    +
    385  byte_t m[1];
    +
    386 
    +
    387  read( m );
    +
    388  return m[0];
    +
    389  }
    +
    390 
    +
    392  uint16_t read_uint16()
    +
    393  {
    +
    394  byte_t m[2];
    +
    395 
    +
    396  read( m );
    +
    397  return (m[1] << 8) | m[0];
    +
    398  }
    +
    399 
    +
    401  uint32_t read_uint32()
    +
    402  {
    +
    403  byte_t m[4];
    +
    404 
    +
    405  read( m );
    +
    406  return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
    +
    407  }
    +
    408 
    +
    409  void seek( long count, int whence = SEEK_SET )
    +
    410  {
    +
    411  _in.seekg( count
    +
    412  , whence == SEEK_SET ? std::ios::beg
    +
    413  :( whence == SEEK_CUR ? std::ios::cur
    +
    414  : std::ios::end )
    +
    415  );
    +
    416  }
    +
    417 
    +
    418  void write(const byte_t*, std::size_t)
    +
    419  {
    +
    420  io_error( "istream_device: Bad io error." );
    +
    421  }
    +
    422 
    +
    423  void flush() {}
    +
    424 
    +
    425 private:
    +
    426 
    +
    427  std::istream& _in;
    +
    428 };
    +
    429 
    +
    433 template< typename FormatTag >
    + +
    435 {
    +
    436 public:
    +
    437  ostream_device( std::ostream & out )
    +
    438  : _out( out )
    +
    439  {
    +
    440  }
    +
    441 
    +
    442  std::size_t read(byte_t *, std::size_t)
    +
    443  {
    +
    444  io_error( "ostream_device: Bad io error." );
    +
    445  return 0;
    +
    446  }
    +
    447 
    +
    448  void seek( long count, int whence )
    +
    449  {
    +
    450  _out.seekp( count
    +
    451  , whence == SEEK_SET
    +
    452  ? std::ios::beg
    +
    453  : ( whence == SEEK_CUR
    +
    454  ?std::ios::cur
    +
    455  :std::ios::end )
    +
    456  );
    +
    457  }
    +
    458 
    +
    459  void write( const byte_t* data
    +
    460  , std::size_t count )
    +
    461  {
    +
    462  _out.write( reinterpret_cast<char const*>( data )
    +
    463  , static_cast<std::streamsize>( count )
    +
    464  );
    +
    465  }
    +
    466 
    +
    468  template < typename T
    +
    469  , std::size_t N
    +
    470  >
    +
    471  void write( const T (&buf)[N] )
    +
    472  {
    +
    473  write( buf, N );
    +
    474  }
    +
    475 
    +
    477  void write_uint8( uint8_t x )
    +
    478  {
    +
    479  byte_t m[1] = { x };
    +
    480  write(m);
    +
    481  }
    +
    482 
    +
    484  void write_uint16( uint16_t x )
    +
    485  {
    +
    486  byte_t m[2];
    +
    487 
    +
    488  m[0] = byte_t( x >> 0 );
    +
    489  m[1] = byte_t( x >> 8 );
    +
    490 
    +
    491  write( m );
    +
    492  }
    +
    493 
    +
    495  void write_uint32( uint32_t x )
    +
    496  {
    +
    497  byte_t m[4];
    +
    498 
    +
    499  m[0] = byte_t( x >> 0 );
    +
    500  m[1] = byte_t( x >> 8 );
    +
    501  m[2] = byte_t( x >> 16 );
    +
    502  m[3] = byte_t( x >> 24 );
    +
    503 
    +
    504  write( m );
    +
    505  }
    +
    506 
    +
    507  void flush()
    +
    508  {
    +
    509  _out << std::flush;
    +
    510  }
    +
    511 
    +
    513  void print_line( const std::string& line )
    +
    514  {
    +
    515  _out << line;
    +
    516  }
    +
    517 
    +
    518 
    +
    519 
    +
    520 private:
    +
    521 
    +
    522  std::ostream& _out;
    +
    523 };
    +
    524 
    +
    525 
    +
    530 template< typename IODevice > struct is_input_device : std::false_type{};
    +
    531 template< typename FormatTag > struct is_input_device< file_stream_device< FormatTag > > : std::true_type{};
    +
    532 template< typename FormatTag > struct is_input_device< istream_device< FormatTag > > : std::true_type{};
    +
    533 
    +
    534 template< typename FormatTag
    +
    535  , typename T
    +
    536  , typename D = void
    +
    537  >
    +
    538 struct is_adaptable_input_device : std::false_type{};
    +
    539 
    +
    540 template <typename FormatTag, typename T>
    +
    541 struct is_adaptable_input_device
    +
    542 <
    +
    543  FormatTag,
    +
    544  T,
    +
    545  typename std::enable_if
    +
    546  <
    +
    547  mp11::mp_or
    +
    548  <
    +
    549  std::is_base_of<std::istream, T>,
    +
    550  std::is_same<std::istream, T>
    +
    551  >::value
    +
    552  >::type
    +
    553 > : std::true_type
    +
    554 {
    +
    555  using device_type = istream_device<FormatTag>;
    +
    556 };
    +
    557 
    +
    558 template< typename FormatTag >
    +
    559 struct is_adaptable_input_device< FormatTag
    +
    560  , FILE*
    +
    561  , void
    +
    562  >
    +
    563  : std::true_type
    +
    564 {
    +
    565  using device_type = file_stream_device<FormatTag>;
    +
    566 };
    +
    567 
    +
    571 template< typename FormatTag
    +
    572  , typename T
    +
    573  , typename D = void
    +
    574  >
    +
    575 struct is_read_device : std::false_type
    +
    576 {};
    +
    577 
    +
    578 template <typename FormatTag, typename T>
    +
    579 struct is_read_device
    +
    580 <
    +
    581  FormatTag,
    +
    582  T,
    +
    583  typename std::enable_if
    +
    584  <
    +
    585  mp11::mp_or
    +
    586  <
    +
    587  is_input_device<FormatTag>,
    +
    588  is_adaptable_input_device<FormatTag, T>
    +
    589  >::value
    +
    590  >::type
    +
    591 > : std::true_type
    +
    592 {
    +
    593 };
    +
    594 
    +
    595 
    +
    600 template<typename IODevice> struct is_output_device : std::false_type{};
    +
    601 
    +
    602 template< typename FormatTag > struct is_output_device< file_stream_device< FormatTag > > : std::true_type{};
    +
    603 template< typename FormatTag > struct is_output_device< ostream_device < FormatTag > > : std::true_type{};
    +
    604 
    +
    605 template< typename FormatTag
    +
    606  , typename IODevice
    +
    607  , typename D = void
    +
    608  >
    +
    609 struct is_adaptable_output_device : std::false_type {};
    +
    610 
    +
    611 template <typename FormatTag, typename T>
    +
    612 struct is_adaptable_output_device
    +
    613 <
    +
    614  FormatTag,
    +
    615  T,
    +
    616  typename std::enable_if
    +
    617  <
    +
    618  mp11::mp_or
    +
    619  <
    +
    620  std::is_base_of<std::ostream, T>,
    +
    621  std::is_same<std::ostream, T>
    +
    622  >::value
    +
    623  >::type
    +
    624 > : std::true_type
    +
    625 {
    +
    626  using device_type = ostream_device<FormatTag>;
    +
    627 };
    +
    628 
    +
    629 template<typename FormatTag> struct is_adaptable_output_device<FormatTag,FILE*,void>
    +
    630  : std::true_type
    +
    631 {
    +
    632  using device_type = file_stream_device<FormatTag>;
    +
    633 };
    +
    634 
    +
    635 
    +
    639 template< typename FormatTag
    +
    640  , typename T
    +
    641  , typename D = void
    +
    642  >
    +
    643 struct is_write_device : std::false_type
    +
    644 {};
    +
    645 
    +
    646 template <typename FormatTag, typename T>
    +
    647 struct is_write_device
    +
    648 <
    +
    649  FormatTag,
    +
    650  T,
    +
    651  typename std::enable_if
    +
    652  <
    +
    653  mp11::mp_or
    +
    654  <
    +
    655  is_output_device<FormatTag>,
    +
    656  is_adaptable_output_device<FormatTag, T>
    +
    657  >::value
    +
    658  >::type
    +
    659 > : std::true_type
    +
    660 {
    +
    661 };
    +
    662 
    +
    663 } // namespace detail
    +
    664 
    +
    665 template< typename Device, typename FormatTag > class scanline_reader;
    +
    666 template< typename Device, typename FormatTag, typename ConversionPolicy > class reader;
    +
    667 
    +
    668 template< typename Device, typename FormatTag, typename Log = no_log > class writer;
    +
    669 
    +
    670 template< typename Device, typename FormatTag > class dynamic_image_reader;
    +
    671 template< typename Device, typename FormatTag, typename Log = no_log > class dynamic_image_writer;
    +
    672 
    +
    673 
    +
    674 namespace detail {
    +
    675 
    +
    676 template< typename T >
    +
    677 struct is_reader : std::false_type
    +
    678 {};
    +
    679 
    +
    680 template< typename Device
    +
    681  , typename FormatTag
    +
    682  , typename ConversionPolicy
    +
    683  >
    +
    684 struct is_reader< reader< Device
    +
    685  , FormatTag
    +
    686  , ConversionPolicy
    +
    687  >
    +
    688  > : std::true_type
    +
    689 {};
    +
    690 
    +
    691 template< typename T >
    +
    692 struct is_dynamic_image_reader : std::false_type
    +
    693 {};
    +
    694 
    +
    695 template< typename Device
    +
    696  , typename FormatTag
    +
    697  >
    +
    698 struct is_dynamic_image_reader< dynamic_image_reader< Device
    +
    699  , FormatTag
    +
    700  >
    +
    701  > : std::true_type
    +
    702 {};
    +
    703 
    +
    704 template< typename T >
    +
    705 struct is_writer : std::false_type
    +
    706 {};
    +
    707 
    +
    708 template< typename Device
    +
    709  , typename FormatTag
    +
    710  >
    +
    711 struct is_writer< writer< Device
    +
    712  , FormatTag
    +
    713  >
    +
    714  > : std::true_type
    +
    715 {};
    +
    716 
    +
    717 template< typename T >
    +
    718 struct is_dynamic_image_writer : std::false_type
    +
    719 {};
    +
    720 
    +
    721 template< typename Device
    +
    722  , typename FormatTag
    +
    723  >
    +
    724 struct is_dynamic_image_writer< dynamic_image_writer< Device
    +
    725  , FormatTag
    +
    726  >
    +
    727  > : std::true_type
    +
    728 {};
    +
    729 
    +
    730 } // namespace detail
    +
    731 
    +
    732 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    +
    733 #pragma warning(pop)
    +
    734 #endif
    +
    735 
    +
    736 } // namespace gil
    +
    737 } // namespace boost
    +
    738 
    +
    739 #endif
    +
    uint8_t read_uint8()
    Reads byte.
    Definition: device.hpp:176
    +
    Used to overload the constructor.
    Definition: device.hpp:57
    + +
    file_stream_device(const std::string &file_name, read_tag tag=read_tag())
    Definition: device.hpp:63
    +
    uint32_t read_uint32()
    Reads 32 bit little endian integer.
    Definition: device.hpp:401
    +
    Definition: device.hpp:575
    +
    uint16_t read_uint16()
    Reads 16 bit little endian integer.
    Definition: device.hpp:392
    +
    void print_line(const std::string &line)
    Prints formatted ASCII text.
    Definition: device.hpp:513
    +
    void read(T(&buf)[N])
    Reads array.
    Definition: device.hpp:168
    +
    file_stream_device(FILE *file)
    Definition: device.hpp:117
    +
    file_stream_device(const char *file_name, write_tag)
    Definition: device.hpp:99
    +
    Definition: device.hpp:530
    +
    void write_uint32(uint32_t x)
    Writes 32 bit little endian integer.
    Definition: device.hpp:495
    +
    file_stream_device(const std::string &file_name, write_tag tag)
    Definition: device.hpp:90
    +
    Definition: device.hpp:600
    +
    std::size_t read(byte_t *data, std::size_t count)
    Definition: device.hpp:143
    +
    uint8_t read_uint8()
    Reads byte.
    Definition: device.hpp:383
    +
    void write_uint16(uint16_t x)
    Writes 16 bit little endian integer.
    Definition: device.hpp:484
    +
    uint16_t read_uint16()
    Reads 16 bit little endian integer.
    Definition: device.hpp:185
    +
    void write_uint32(uint32_t x)
    Writes 32 bit little endian integer.
    Definition: device.hpp:250
    +
    void print_line(const std::string &line)
    Prints formatted ASCII text.
    Definition: device.hpp:289
    +
    Definition: device.hpp:434
    +
    Definition: device.hpp:327
    +
    std::size_t write(const T *buf, std::size_t count)
    Writes number of elements from a buffer.
    Definition: device.hpp:204
    +
    uint32_t read_uint32()
    Reads 32 bit little endian integer.
    Definition: device.hpp:194
    +
    void write_uint8(uint8_t x)
    Writes byte.
    Definition: device.hpp:477
    +
    void write_uint8(uint8_t x)
    Writes byte.
    Definition: device.hpp:232
    +
    void write(const T(&buf)[N])
    Writes array.
    Definition: device.hpp:471
    +
    void write(const T(&buf)[N])
    Writes array.
    Definition: device.hpp:223
    +
    void write_uint16(uint16_t x)
    Writes 16 bit little endian integer.
    Definition: device.hpp:239
    +
    void read(T(&buf)[N])
    Reads array.
    Definition: device.hpp:377
    +
    Definition: device.hpp:643
    +
    file_stream_device(const char *file_name, read_tag=read_tag())
    Definition: device.hpp:72
    diff --git a/develop/doc/html/reference/device__n_8hpp_source.html b/develop/doc/html/reference/device__n_8hpp_source.html index 9f3e04ee7..71a2f0bd1 100644 --- a/develop/doc/html/reference/device__n_8hpp_source.html +++ b/develop/doc/html/reference/device__n_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: device_n.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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  N == 1 || (3 <= 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>
    62 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes)
    63 {
    64  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<2>>>::view_t;
    65  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1), rowsize_in_bytes));
    66 }
    67 
    70 template <typename IC>
    71 inline
    72 auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes)
    74 {
    75  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3>>>::view_t;
    76  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2), rowsize_in_bytes));
    77 }
    78 
    81 template <typename IC>
    82 inline
    83 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)
    85 {
    86  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4>>>::view_t;
    87  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3), rowsize_in_bytes));
    88 }
    89 
    92 template <typename IC>
    93 inline
    94 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)
    96 {
    97  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5>>>::view_t;
    98  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3,c4), rowsize_in_bytes));
    99 }
    100 
    101 }} // namespace boost::gil
    102 
    103 #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:94
    -
    Definition: algorithm.hpp:30
    -
    Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
    Definition: metafunctions.hpp:301
    -
    unnamed color
    Definition: device_n.hpp:30
    -
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    -
    Unnamed color space of 1, 3, 4, or 5 channels.
    Definition: device_n.hpp:33
    -
    unnamed color layout of up to five channels
    Definition: device_n.hpp:56
    +
    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  N == 1 || (3 <= 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>
    + +
    62 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes)
    +
    63 {
    +
    64  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<2>>>::view_t;
    +
    65  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1), rowsize_in_bytes));
    +
    66 }
    +
    67 
    +
    70 template <typename IC>
    +
    71 inline
    +
    72 auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes)
    + +
    74 {
    +
    75  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3>>>::view_t;
    +
    76  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2), rowsize_in_bytes));
    +
    77 }
    +
    78 
    +
    81 template <typename IC>
    +
    82 inline
    +
    83 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)
    + +
    85 {
    +
    86  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4>>>::view_t;
    +
    87  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3), rowsize_in_bytes));
    +
    88 }
    +
    89 
    +
    92 template <typename IC>
    +
    93 inline
    +
    94 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)
    + +
    96 {
    +
    97  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5>>>::view_t;
    +
    98  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3,c4), rowsize_in_bytes));
    +
    99 }
    +
    100 
    +
    101 }} // namespace boost::gil
    +
    102 
    +
    103 #endif
    +
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    +
    Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
    Definition: metafunctions.hpp:301
    +
    Unnamed color space of 1, 3, 4, or 5 channels.
    Definition: device_n.hpp:33
    +
    unnamed color layout of up to five channels
    Definition: device_n.hpp:56
    +
    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:94
    +
    unnamed color
    Definition: device_n.hpp:30
    diff --git a/develop/doc/html/reference/diffusion_8hpp_source.html b/develop/doc/html/reference/diffusion_8hpp_source.html new file mode 100644 index 000000000..91ca384bd --- /dev/null +++ b/develop/doc/html/reference/diffusion_8hpp_source.html @@ -0,0 +1,467 @@ + + + + + + + + + Generic Image Library: diffusion.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    diffusion.hpp
    +
    +
    +
    1 //
    +
    2 // Copyright 2020 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 
    +
    10 #ifndef BOOST_GIL_IMAGE_PROCESSING_DIFFUSION_HPP
    +
    11 #define BOOST_GIL_IMAGE_PROCESSING_DIFFUSION_HPP
    +
    12 
    +
    13 #include "boost/gil/detail/math.hpp"
    +
    14 #include <boost/gil/algorithm.hpp>
    +
    15 #include <boost/gil/color_base_algorithm.hpp>
    +
    16 #include <boost/gil/image.hpp>
    +
    17 #include <boost/gil/image_view.hpp>
    +
    18 #include <boost/gil/image_view_factory.hpp>
    +
    19 #include <boost/gil/pixel.hpp>
    +
    20 #include <boost/gil/point.hpp>
    +
    21 #include <boost/gil/typedefs.hpp>
    +
    22 #include <functional>
    +
    23 #include <numeric>
    +
    24 #include <vector>
    +
    25 
    +
    26 namespace boost { namespace gil {
    +
    27 namespace conductivity {
    +
    28 struct perona_malik_conductivity
    +
    29 {
    +
    30  double kappa;
    +
    31  template <typename Pixel>
    +
    32  Pixel operator()(Pixel input)
    +
    33  {
    +
    34  using channel_type = typename channel_type<Pixel>::type;
    +
    35  // C++11 doesn't seem to capture members
    +
    36  static_transform(input, input, [this](channel_type value) {
    +
    37  value /= kappa;
    +
    38  return std::exp(-std::abs(value));
    +
    39  });
    +
    40 
    +
    41  return input;
    +
    42  }
    +
    43 };
    +
    44 
    +
    45 struct gaussian_conductivity
    +
    46 {
    +
    47  double kappa;
    +
    48  template <typename Pixel>
    +
    49  Pixel operator()(Pixel input)
    +
    50  {
    +
    51  using channel_type = typename channel_type<Pixel>::type;
    +
    52  // C++11 doesn't seem to capture members
    +
    53  static_transform(input, input, [this](channel_type value) {
    +
    54  value /= kappa;
    +
    55  return std::exp(-value * value);
    +
    56  });
    +
    57 
    +
    58  return input;
    +
    59  }
    +
    60 };
    +
    61 
    +
    62 struct wide_regions_conductivity
    +
    63 {
    +
    64  double kappa;
    +
    65  template <typename Pixel>
    +
    66  Pixel operator()(Pixel input)
    +
    67  {
    +
    68  using channel_type = typename channel_type<Pixel>::type;
    +
    69  // C++11 doesn't seem to capture members
    +
    70  static_transform(input, input, [this](channel_type value) {
    +
    71  value /= kappa;
    +
    72  return 1.0 / (1.0 + value * value);
    +
    73  });
    +
    74 
    +
    75  return input;
    +
    76  }
    +
    77 };
    +
    78 
    +
    79 struct more_wide_regions_conductivity
    +
    80 {
    +
    81  double kappa;
    +
    82  template <typename Pixel>
    +
    83  Pixel operator()(Pixel input)
    +
    84  {
    +
    85  using channel_type = typename channel_type<Pixel>::type;
    +
    86  // C++11 doesn't seem to capture members
    +
    87  static_transform(input, input, [this](channel_type value) {
    +
    88  value /= kappa;
    +
    89  return 1.0 / std::sqrt((1.0 + value * value));
    +
    90  });
    +
    91 
    +
    92  return input;
    +
    93  }
    +
    94 };
    +
    95 } // namespace diffusion
    +
    96 
    +
    100 namespace laplace_function {
    +
    101 // The functions assume clockwise enumeration of stencil points, as such
    +
    102 // NW North NE 0 1 2 (-1, -1) (0, -1) (+1, -1)
    +
    103 // West East ===> 7 3 ===> (-1, 0) (+1, 0)
    +
    104 // SW South SE 6 5 4 (-1, +1) (0, +1) (+1, +1)
    +
    105 
    +
    114 inline std::array<gil::point_t, 8> get_directed_offsets()
    +
    115 {
    +
    116  return {point_t{-1, -1}, point_t{0, -1}, point_t{+1, -1}, point_t{+1, 0},
    +
    117  point_t{+1, +1}, point_t{0, +1}, point_t{-1, +1}, point_t{-1, 0}};
    +
    118 }
    +
    119 
    +
    120 template <typename PixelType>
    +
    121 using stencil_type = std::array<PixelType, 8>;
    +
    122 
    + +
    129 {
    +
    130  double delta_t = 0.25;
    +
    131 
    +
    132  template <typename SubImageView>
    +
    133  stencil_type<typename SubImageView::value_type> compute_laplace(SubImageView view,
    +
    134  point_t origin)
    +
    135  {
    +
    136  auto current = view(origin);
    +
    137  stencil_type<typename SubImageView::value_type> stencil;
    + +
    139  std::array<gil::point_t, 8> offsets(get_directed_offsets());
    +
    140  typename SubImageView::value_type zero_pixel;
    +
    141  static_fill(zero_pixel, 0);
    +
    142  for (std::size_t index = 0; index < offsets.size(); ++index)
    +
    143  {
    +
    144  if (index % 2 != 0)
    +
    145  {
    +
    146  static_transform(view(origin.x + offsets[index].x, origin.y + offsets[index].y),
    +
    147  current, stencil[index], std::minus<channel_type>{});
    +
    148  }
    +
    149  else
    +
    150  {
    +
    151  stencil[index] = zero_pixel;
    +
    152  }
    +
    153  }
    +
    154  return stencil;
    +
    155  }
    +
    156 
    +
    157  template <typename Pixel>
    +
    158  Pixel reduce(const stencil_type<Pixel>& stencil)
    +
    159  {
    +
    160  auto first = stencil.begin();
    +
    161  auto last = stencil.end();
    +
    162  using channel_type = typename channel_type<Pixel>::type;
    +
    163  auto result = []() {
    +
    164  Pixel zero_pixel;
    +
    165  static_fill(zero_pixel, channel_type(0));
    +
    166  return zero_pixel;
    +
    167  }();
    +
    168 
    +
    169  for (std::size_t index : {1u, 3u, 5u, 7u})
    +
    170  {
    +
    171  static_transform(result, stencil[index], result, std::plus<channel_type>{});
    +
    172  }
    +
    173  Pixel delta_t_pixel;
    +
    174  static_fill(delta_t_pixel, delta_t);
    +
    175  static_transform(result, delta_t_pixel, result, std::multiplies<channel_type>{});
    +
    176 
    +
    177  return result;
    +
    178  }
    +
    179 };
    +
    180 
    + +
    188 {
    +
    189  double delta_t = 0.125;
    +
    190 
    +
    191  template <typename SubImageView>
    +
    192  stencil_type<typename SubImageView::value_type> compute_laplace(SubImageView view,
    +
    193  point_t origin)
    +
    194  {
    +
    195  stencil_type<typename SubImageView::value_type> stencil;
    +
    196  auto out = stencil.begin();
    +
    197  auto current = view(origin);
    + +
    199  std::array<gil::point_t, 8> offsets(get_directed_offsets());
    +
    200  for (auto offset : offsets)
    +
    201  {
    +
    202  static_transform(view(origin.x + offset.x, origin.y + offset.y), current, *out++,
    +
    203  std::minus<channel_type>{});
    +
    204  }
    +
    205 
    +
    206  return stencil;
    +
    207  }
    +
    208 
    +
    209  template <typename Pixel>
    +
    210  Pixel reduce(const stencil_type<Pixel>& stencil)
    +
    211  {
    +
    212  using channel_type = typename channel_type<Pixel>::type;
    +
    213  auto result = []() {
    +
    214  Pixel zero_pixel;
    +
    215  static_fill(zero_pixel, channel_type(0));
    +
    216  return zero_pixel;
    +
    217  }();
    +
    218  for (std::size_t index : {1u, 3u, 5u, 7u})
    +
    219  {
    +
    220  static_transform(result, stencil[index], result, std::plus<channel_type>{});
    +
    221  }
    +
    222 
    +
    223  for (std::size_t index : {0u, 2u, 4u, 6u})
    +
    224  {
    +
    225  Pixel half_pixel;
    +
    226  static_fill(half_pixel, channel_type(1 / 2.0));
    +
    227  static_transform(stencil[index], half_pixel, half_pixel,
    +
    228  std::multiplies<channel_type>{});
    +
    229  static_transform(result, half_pixel, result, std::plus<channel_type>{});
    +
    230  }
    +
    231 
    +
    232  Pixel delta_t_pixel;
    +
    233  static_fill(delta_t_pixel, delta_t);
    +
    234  static_transform(result, delta_t_pixel, result, std::multiplies<channel_type>{});
    +
    235 
    +
    236  return result;
    +
    237  }
    +
    238 };
    +
    239 } // namespace laplace_function
    +
    240 
    +
    241 namespace brightness_function {
    +
    242 using laplace_function::stencil_type;
    +
    243 struct identity
    +
    244 {
    +
    245  template <typename Pixel>
    +
    246  stencil_type<Pixel> operator()(const stencil_type<Pixel>& stencil)
    +
    247  {
    +
    248  return stencil;
    +
    249  }
    +
    250 };
    +
    251 
    +
    252 // TODO: Figure out how to implement color gradient brightness, as it
    +
    253 // seems to need dx and dy using sobel or scharr kernels
    +
    254 
    +
    255 struct rgb_luminance
    +
    256 {
    +
    257  using pixel_type = rgb32f_pixel_t;
    +
    258  stencil_type<pixel_type> operator()(const stencil_type<pixel_type>& stencil)
    +
    259  {
    +
    260  stencil_type<pixel_type> output;
    +
    261  std::transform(stencil.begin(), stencil.end(), output.begin(), [](const pixel_type& pixel) {
    +
    262  float32_t luminance = 0.2126f * pixel[0] + 0.7152f * pixel[1] + 0.0722f * pixel[2];
    +
    263  pixel_type result_pixel;
    +
    264  static_fill(result_pixel, luminance);
    +
    265  return result_pixel;
    +
    266  });
    +
    267  return output;
    +
    268  }
    +
    269 };
    +
    270 
    +
    271 } // namespace brightness_function
    +
    272 
    +
    273 enum class matlab_connectivity
    +
    274 {
    +
    275  minimal,
    +
    276  maximal
    +
    277 };
    +
    278 
    +
    279 enum class matlab_conduction_method
    +
    280 {
    +
    281  exponential,
    +
    282  quadratic
    +
    283 };
    +
    284 
    +
    285 template <typename InputView, typename OutputView>
    +
    286 void classic_anisotropic_diffusion(const InputView& input, const OutputView& output,
    +
    287  unsigned int num_iter, double kappa)
    +
    288 {
    +
    289  anisotropic_diffusion(input, output, num_iter, laplace_function::stencil_5points{},
    +
    290  brightness_function::identity{},
    +
    291  conductivity::perona_malik_conductivity{kappa});
    +
    292 }
    +
    293 
    +
    294 template <typename InputView, typename OutputView>
    +
    295 void matlab_anisotropic_diffusion(const InputView& input, const OutputView& output,
    +
    296  unsigned int num_iter, double kappa,
    +
    297  matlab_connectivity connectivity,
    +
    298  matlab_conduction_method conduction_method)
    +
    299 {
    +
    300  if (connectivity == matlab_connectivity::minimal)
    +
    301  {
    +
    302  if (conduction_method == matlab_conduction_method::exponential)
    +
    303  {
    +
    304  anisotropic_diffusion(input, output, num_iter, laplace_function::stencil_5points{},
    +
    305  brightness_function::identity{},
    +
    306  conductivity::gaussian_conductivity{kappa});
    +
    307  }
    +
    308  else if (conduction_method == matlab_conduction_method::quadratic)
    +
    309  {
    +
    310  anisotropic_diffusion(input, output, num_iter, laplace_function::stencil_5points{},
    +
    311  brightness_function::identity{},
    +
    312  conductivity::gaussian_conductivity{kappa});
    +
    313  }
    +
    314  else
    +
    315  {
    +
    316  throw std::logic_error("unhandled conduction method found");
    +
    317  }
    +
    318  }
    +
    319  else if (connectivity == matlab_connectivity::maximal)
    +
    320  {
    +
    321  if (conduction_method == matlab_conduction_method::exponential)
    +
    322  {
    +
    323  anisotropic_diffusion(input, output, num_iter, laplace_function::stencil_5points{},
    +
    324  brightness_function::identity{},
    +
    325  conductivity::gaussian_conductivity{kappa});
    +
    326  }
    +
    327  else if (conduction_method == matlab_conduction_method::quadratic)
    +
    328  {
    +
    329  anisotropic_diffusion(input, output, num_iter, laplace_function::stencil_5points{},
    +
    330  brightness_function::identity{},
    +
    331  conductivity::gaussian_conductivity{kappa});
    +
    332  }
    +
    333  else
    +
    334  {
    +
    335  throw std::logic_error("unhandled conduction method found");
    +
    336  }
    +
    337  }
    +
    338  else
    +
    339  {
    +
    340  throw std::logic_error("unhandled connectivity found");
    +
    341  }
    +
    342 }
    +
    343 
    +
    344 template <typename InputView, typename OutputView>
    +
    345 void default_anisotropic_diffusion(const InputView& input, const OutputView& output,
    +
    346  unsigned int num_iter, double kappa)
    +
    347 {
    +
    348  anisotropic_diffusion(input, output, num_iter, laplace_function::stencil_9points_standard{},
    +
    349  brightness_function::identity{}, conductivity::gaussian_conductivity{kappa});
    +
    350 }
    +
    351 
    +
    361 template <typename InputView, typename OutputView,
    +
    362  typename LaplaceStrategy = laplace_function::stencil_9points_standard,
    +
    363  typename BrightnessFunction = brightness_function::identity,
    +
    364  typename DiffusivityFunction = conductivity::gaussian_conductivity>
    +
    365 void anisotropic_diffusion(const InputView& input, const OutputView& output, unsigned int num_iter,
    +
    366  LaplaceStrategy laplace, BrightnessFunction brightness,
    +
    367  DiffusivityFunction diffusivity)
    +
    368 {
    +
    369  using input_pixel_type = typename InputView::value_type;
    +
    370  using pixel_type = typename OutputView::value_type;
    +
    371  using channel_type = typename channel_type<pixel_type>::type;
    +
    372  using computation_image = image<pixel_type>;
    +
    373  const auto width = input.width();
    +
    374  const auto height = input.height();
    +
    375  const point_t dims(width, height);
    +
    376  const auto zero_pixel = []() {
    +
    377  pixel_type pixel;
    +
    378  static_fill(pixel, static_cast<channel_type>(0));
    +
    379 
    +
    380  return pixel;
    +
    381  }();
    +
    382  computation_image result_image(width + 2, height + 2, zero_pixel);
    +
    383  auto result = view(result_image);
    +
    384  computation_image scratch_result_image(width + 2, height + 2, zero_pixel);
    +
    385  auto scratch_result = view(scratch_result_image);
    +
    386  transform_pixels(input, subimage_view(result, 1, 1, width, height),
    +
    387  [](const input_pixel_type& pixel) {
    +
    388  pixel_type converted;
    +
    389  for (std::size_t i = 0; i < num_channels<pixel_type>{}; ++i)
    +
    390  {
    +
    391  converted[i] = pixel[i];
    +
    392  }
    +
    393  return converted;
    +
    394  });
    +
    395 
    +
    396  for (unsigned int iteration = 0; iteration < num_iter; ++iteration)
    +
    397  {
    +
    398  for (std::ptrdiff_t relative_y = 0; relative_y < height; ++relative_y)
    +
    399  {
    +
    400  for (std::ptrdiff_t relative_x = 0; relative_x < width; ++relative_x)
    +
    401  {
    +
    402  auto x = relative_x + 1;
    +
    403  auto y = relative_y + 1;
    +
    404  auto stencil = laplace.compute_laplace(result, point_t(x, y));
    +
    405  auto brightness_stencil = brightness(stencil);
    +
    406  laplace_function::stencil_type<pixel_type> diffusivity_stencil;
    +
    407  std::transform(brightness_stencil.begin(), brightness_stencil.end(),
    +
    408  diffusivity_stencil.begin(), diffusivity);
    +
    409  laplace_function::stencil_type<pixel_type> product_stencil;
    +
    410  std::transform(stencil.begin(), stencil.end(), diffusivity_stencil.begin(),
    +
    411  product_stencil.begin(), [](pixel_type lhs, pixel_type rhs) {
    +
    412  static_transform(lhs, rhs, lhs, std::multiplies<channel_type>{});
    +
    413  return lhs;
    +
    414  });
    +
    415  static_transform(result(x, y), laplace.reduce(product_stencil),
    +
    416  scratch_result(x, y), std::plus<channel_type>{});
    +
    417  }
    +
    418  }
    +
    419  using std::swap;
    +
    420  swap(result, scratch_result);
    +
    421  }
    +
    422 
    +
    423  copy_pixels(subimage_view(result, 1, 1, width, height), output);
    +
    424 }
    +
    425 
    +
    426 }} // namespace boost::gil
    +
    427 
    +
    428 #endif
    +
    +
    9 point stencil approximation of Laplacian
    Definition: diffusion.hpp:187
    +
    5 point stencil approximation of Laplacian
    Definition: diffusion.hpp:128
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    BOOST_FORCEINLINE F transform_pixels(const View1 &src, const View2 &dst, F fun)
    std::transform for image views
    Definition: algorithm.hpp:1116
    +
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    + +
    std::array< gil::point_t, 8 > get_directed_offsets()
    This function makes sure all Laplace functions enumerate values in the same order and direction.
    Definition: diffusion.hpp:114
    +
    Definition: color_convert.hpp:31
    +
    View subimage_view(View const &src, typename View::point_t const &topleft, typename View::point_t const &dimensions)
    Definition: image_view_factory.hpp:254
    + + + + + + diff --git a/develop/doc/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html b/develop/doc/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html index 68a7eee25..bd1d64a94 100644 --- a/develop/doc/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html +++ b/develop/doc/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html @@ -4,7 +4,7 @@ - + Generic Image Library: extension Directory Reference @@ -27,21 +27,16 @@

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

    -Files

    diff --git a/develop/doc/html/reference/dir_58c726a731707876b257bd847dce0d3c.html b/develop/doc/html/reference/dir_58c726a731707876b257bd847dce0d3c.html index 7a33d885a..1200e03e6 100644 --- a/develop/doc/html/reference/dir_58c726a731707876b257bd847dce0d3c.html +++ b/develop/doc/html/reference/dir_58c726a731707876b257bd847dce0d3c.html @@ -4,7 +4,7 @@ - + Generic Image Library: io Directory Reference @@ -27,21 +27,16 @@

    - - - + + + + +
    - - -

    -Files

    diff --git a/develop/doc/html/reference/dir_65525b100b86579f1f0652bf33388089.html b/develop/doc/html/reference/dir_65525b100b86579f1f0652bf33388089.html index 19c2e541d..1596329ef 100644 --- a/develop/doc/html/reference/dir_65525b100b86579f1f0652bf33388089.html +++ b/develop/doc/html/reference/dir_65525b100b86579f1f0652bf33388089.html @@ -4,7 +4,7 @@ - + Generic Image Library: concepts Directory Reference @@ -27,21 +27,16 @@

    - - - + + + + +
    - - -

    -Files

    diff --git a/develop/doc/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html b/develop/doc/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html index 485cc8a28..7de01af0a 100644 --- a/develop/doc/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html +++ b/develop/doc/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html @@ -4,7 +4,7 @@ - + Generic Image Library: io Directory Reference @@ -27,21 +27,16 @@

    - - - + + + + +
    - - -

    -Files

    diff --git a/develop/doc/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html b/develop/doc/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html index 813c1ad74..2f850c707 100644 --- a/develop/doc/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/develop/doc/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html @@ -4,7 +4,7 @@ - + Generic Image Library: include Directory Reference @@ -27,21 +27,16 @@

    - - - + + + + +
    - - -

    -Directories

    diff --git a/develop/doc/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html b/develop/doc/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html index 30c9c91f4..17b7acc2d 100644 --- a/develop/doc/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html +++ b/develop/doc/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html @@ -4,7 +4,7 @@ - + Generic Image Library: gil Directory Reference @@ -27,21 +27,16 @@

    - - - + + + + + @@ -65,7 +59,7 @@ Files diff --git a/develop/doc/html/reference/doxygen.css b/develop/doc/html/reference/doxygen.css index 1425ec530..73ecbb2cb 100644 --- a/develop/doc/html/reference/doxygen.css +++ b/develop/doc/html/reference/doxygen.css @@ -1,9 +1,13 @@ -/* The standard CSS for doxygen 1.8.11 */ +/* The standard CSS for doxygen 1.8.17 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; } +p.reference, p.definition { + font: 400 14px/22px Roboto,sans-serif; +} + /* @group Heading Levels */ h1.groupheader { @@ -49,17 +53,24 @@ dt { font-weight: bold; } -div.multicol { +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; } +th p.starttd, p.intertd, p.endtd { + font-size: 100%; + font-weight: 700; +} + p.starttd { margin-top: 0px; } @@ -76,6 +87,15 @@ p.endtd { margin-bottom: 2px; } +p.interli { +} + +p.interdd { +} + +p.intertd { +} + /* @end */ caption { @@ -130,12 +150,12 @@ a.qindex { a.qindexHL { font-weight: bold; background-color: #9CAFD4; - color: #ffffff; + color: #FFFFFF; border: 1px double #869DCA; } .contents a.qindexHL:visited { - color: #ffffff; + color: #FFFFFF; } a.el { @@ -159,6 +179,25 @@ dl.el { margin-left: -1cm; } +ul { + overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + pre.fragment { border: 1px solid #C4CFE5; background-color: #FBFCFD; @@ -173,8 +212,8 @@ pre.fragment { } div.fragment { - padding: 4px 6px; - margin: 4px 8px 4px 2px; + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; background-color: #FBFCFD; border: 1px solid #C4CFE5; } @@ -232,10 +271,19 @@ span.lineno a:hover { background-color: #C8C8C8; } +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + div.ah, span.ah { background-color: black; font-weight: bold; - color: #ffffff; + color: #FFFFFF; margin-bottom: 3px; margin-top: 3px; padding: 0.2em; @@ -311,7 +359,7 @@ img.formulaDsp { } -img.formulaInl { +img.formulaInl, img.inline { vertical-align: middle; } @@ -389,6 +437,13 @@ blockquote { 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 */ /* @@ -485,7 +540,7 @@ table.memberdecls { white-space: nowrap; } -.memItemRight { +.memItemRight, .memTemplItemRight { width: 100%; } @@ -501,6 +556,29 @@ table.memberdecls { /* Styles for detailed member documentation */ +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + .memtemplate { font-size: 80%; color: #4665A2; @@ -539,7 +617,7 @@ table.memberdecls { } .memname { - font-weight: bold; + font-weight: 400; margin-left: 6px; } @@ -555,24 +633,24 @@ table.memberdecls { color: #253555; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; + background-color: #DFE5F1; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; - border-top-left-radius: 4px; /* firefox specific markup */ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 4px; - -moz-border-radius-topleft: 4px; /* webkit specific markup */ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 4px; - -webkit-border-top-left-radius: 4px; } +.overload { + font-family: "courier new",courier,monospace; + font-size: 65%; +} + .memdoc, dl.reflist dd { border-bottom: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; @@ -630,17 +708,17 @@ dl.reflist dd { padding-left: 0px; } -.params .paramname, .retval .paramname { +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { font-weight: bold; vertical-align: top; } -.params .paramtype { +.params .paramtype, .tparams .paramtype { font-style: italic; vertical-align: top; } -.params .paramdir { +.params .paramdir, .tparams .paramdir { font-family: "courier new",courier,monospace; vertical-align: top; } @@ -914,6 +992,7 @@ table.fieldtable { 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; @@ -1044,72 +1123,143 @@ div.headertitle padding: 5px 5px 5px 10px; } -dl -{ - padding: 0 0 0 10px; +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; } -/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ -dl.section -{ +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { margin-left: 0px; padding-left: 0px; } -dl.note -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #D0C000; +dl.section.DocNodeRTL { + margin-right: 0px; + padding-right: 0px; } -dl.warning, dl.attention -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #FF0000; +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; } -dl.pre, dl.post, dl.invariant -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00D000; +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.deprecated -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #505050; +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; } -dl.todo -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00C0E0; +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.test -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #3030E0; +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; } -dl.bug -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #C08050; +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; + border-left: 4px solid; + 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; + border-left: 4px solid; + 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; + border-left: 4px solid; + 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; + border-left: 4px solid; + 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 { @@ -1178,6 +1328,11 @@ dl.section dd { text-align: center; } +.plantumlgraph +{ + text-align: center; +} + .diagraph { text-align: center; @@ -1221,6 +1376,11 @@ 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; @@ -1229,6 +1389,12 @@ div.toc li { 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; @@ -1258,6 +1424,26 @@ div.toc li.level4 { margin-left: 45px; } +.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; +} + .inherit_header { font-weight: bold; color: gray; @@ -1371,7 +1557,7 @@ tr.heading h2 { } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { - border-top-color: #ffffff; + border-top-color: #FFFFFF; border-width: 10px; margin: 0px -10px; } @@ -1399,7 +1585,7 @@ tr.heading h2 { } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { - border-bottom-color: #ffffff; + border-bottom-color: #FFFFFF; border-width: 10px; margin: 0px -10px; } @@ -1426,7 +1612,7 @@ tr.heading h2 { left: 100%; } #powerTip.e:after { - border-left-color: #ffffff; + border-left-color: #FFFFFF; border-width: 10px; top: 50%; margin-top: -10px; @@ -1442,7 +1628,7 @@ tr.heading h2 { right: 100%; } #powerTip.w:after { - border-right-color: #ffffff; + border-right-color: #FFFFFF; border-width: 10px; top: 50%; margin-top: -10px; @@ -1473,3 +1659,113 @@ tr.heading h2 { } } +/* @group Markdown */ + +/* +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTableHead tr { +} + +table.markdownTableBodyLeft td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft { + text-align: left +} + +th.markdownTableHeadRight { + text-align: right +} + +th.markdownTableHeadCenter { + text-align: center +} +*/ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +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 */ + +u { + text-decoration: underline; +} + diff --git a/develop/doc/html/reference/dynamic__at__c_8hpp_source.html b/develop/doc/html/reference/dynamic__at__c_8hpp_source.html index 361fb350f..39fe1db62 100644 --- a/develop/doc/html/reference/dynamic__at__c_8hpp_source.html +++ b/develop/doc/html/reference/dynamic__at__c_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_at_c.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    Definition: algorithm.hpp:133
    -
    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:597
    +
    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
    diff --git a/develop/doc/html/reference/dynamic__image__all_8hpp_source.html b/develop/doc/html/reference/dynamic__image__all_8hpp_source.html index 02b10b01b..b5e64cfab 100644 --- a/develop/doc/html/reference/dynamic__image__all_8hpp_source.html +++ b/develop/doc/html/reference/dynamic__image__all_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_image_all.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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.
    +
    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.
    diff --git a/develop/doc/html/reference/dynamic__io__new_8hpp_source.html b/develop/doc/html/reference/dynamic__io__new_8hpp_source.html index cafd7b4cf..06c591d0b 100644 --- a/develop/doc/html/reference/dynamic__io__new_8hpp_source.html +++ b/develop/doc/html/reference/dynamic__io__new_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_io_new.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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_IO_DYNAMIC_IO_NEW_HPP
    9 #define BOOST_GIL_IO_DYNAMIC_IO_NEW_HPP
    10 
    11 #include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
    12 
    13 #include <boost/gil/detail/mp11.hpp>
    14 #include <boost/gil/io/error.hpp>
    15 
    16 #include <type_traits>
    17 
    18 namespace boost { namespace gil {
    19 
    20 namespace detail {
    21 
    22 template <long N>
    23 struct construct_matched_t
    24 {
    25  template <typename ...Images,typename Pred>
    26  static bool apply(any_image<Images...>& img, Pred pred)
    27  {
    28  if (pred.template apply<mp11::mp_at_c<any_image<Images...>, N-1>>())
    29  {
    30  using image_t = mp11::mp_at_c<any_image<Images...>, N-1>;
    31  image_t x;
    32  img = std::move(x);
    33  return true;
    34  }
    35  else
    36  return construct_matched_t<N-1>::apply(img, pred);
    37  }
    38 };
    39 template <>
    40 struct construct_matched_t<0>
    41 {
    42  template <typename ...Images,typename Pred>
    43  static bool apply(any_image<Images...>&,Pred) { return false; }
    44 };
    45 
    46 // A function object that can be passed to apply_operation.
    47 // Given a predicate IsSupported taking a view type and returning an boolean integral coonstant,
    48 // calls the apply method of OpClass with the view if the given view IsSupported, or throws an exception otherwise
    49 template <typename IsSupported, typename OpClass>
    50 class dynamic_io_fnobj
    51 {
    52 private:
    53  OpClass* _op;
    54 
    55  template <typename View>
    56  void apply(View const& view, std::true_type) { _op->apply(view); }
    57 
    58  template <typename View, typename Info>
    59  void apply(View const& view, Info const & info, const std::true_type) { _op->apply(view, info); }
    60 
    61  template <typename View>
    62  void apply(View const& /* view */, std::false_type)
    63  {
    64  io_error("dynamic_io: unsupported view type for the given file format");
    65  }
    66 
    67  template <typename View, typename Info >
    68  void apply(View const& /* view */, Info const& /* info */, const std::false_type)
    69  {
    70  io_error("dynamic_io: unsupported view type for the given file format");
    71  }
    72 
    73 public:
    74  dynamic_io_fnobj(OpClass* op) : _op(op) {}
    75 
    76  using result_type = void;
    77 
    78  template <typename View>
    79  void operator()(View const& view)
    80  {
    81  apply(view, typename IsSupported::template apply<View>::type());
    82  }
    83 
    84  template< typename View, typename Info >
    85  void operator()(View const& view, Info const& info)
    86  {
    87  apply(view, info, typename IsSupported::template apply<View>::type());
    88  }
    89 };
    90 
    91 } // namespace detail
    92 
    95 template <typename ...Images,typename Pred>
    96 inline bool construct_matched(any_image<Images...>& img, Pred pred)
    97 {
    98  constexpr auto size = mp11::mp_size<any_image<Images...>>::value;
    99  return detail::construct_matched_t<size>::apply(img, pred);
    100 }
    101 
    102 } } // namespace boost::gil
    103 
    104 #endif
    Definition: algorithm.hpp:30
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    +
    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_IO_DYNAMIC_IO_NEW_HPP
    +
    9 #define BOOST_GIL_IO_DYNAMIC_IO_NEW_HPP
    +
    10 
    +
    11 #include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
    +
    12 
    +
    13 #include <boost/gil/detail/mp11.hpp>
    +
    14 #include <boost/gil/io/error.hpp>
    +
    15 
    +
    16 #include <type_traits>
    +
    17 
    +
    18 namespace boost { namespace gil {
    +
    19 
    +
    20 namespace detail {
    +
    21 
    +
    22 template <long N>
    +
    23 struct construct_matched_t
    +
    24 {
    +
    25  template <typename ...Images,typename Pred>
    +
    26  static bool apply(any_image<Images...>& img, Pred pred)
    +
    27  {
    +
    28  if (pred.template apply<mp11::mp_at_c<any_image<Images...>, N-1>>())
    +
    29  {
    +
    30  using image_t = mp11::mp_at_c<any_image<Images...>, N-1>;
    +
    31  image_t x;
    +
    32  img = std::move(x);
    +
    33  return true;
    +
    34  }
    +
    35  else
    +
    36  return construct_matched_t<N-1>::apply(img, pred);
    +
    37  }
    +
    38 };
    +
    39 template <>
    +
    40 struct construct_matched_t<0>
    +
    41 {
    +
    42  template <typename ...Images,typename Pred>
    +
    43  static bool apply(any_image<Images...>&,Pred) { return false; }
    +
    44 };
    +
    45 
    +
    46 // A function object that can be passed to apply_operation.
    +
    47 // Given a predicate IsSupported taking a view type and returning an boolean integral coonstant,
    +
    48 // calls the apply method of OpClass with the view if the given view IsSupported, or throws an exception otherwise
    +
    49 template <typename IsSupported, typename OpClass>
    +
    50 class dynamic_io_fnobj
    +
    51 {
    +
    52 private:
    +
    53  OpClass* _op;
    +
    54 
    +
    55  template <typename View>
    +
    56  void apply(View const& view, std::true_type) { _op->apply(view); }
    +
    57 
    +
    58  template <typename View, typename Info>
    +
    59  void apply(View const& view, Info const & info, const std::true_type) { _op->apply(view, info); }
    +
    60 
    +
    61  template <typename View>
    +
    62  void apply(View const& /* view */, std::false_type)
    +
    63  {
    +
    64  io_error("dynamic_io: unsupported view type for the given file format");
    +
    65  }
    +
    66 
    +
    67  template <typename View, typename Info >
    +
    68  void apply(View const& /* view */, Info const& /* info */, const std::false_type)
    +
    69  {
    +
    70  io_error("dynamic_io: unsupported view type for the given file format");
    +
    71  }
    +
    72 
    +
    73 public:
    +
    74  dynamic_io_fnobj(OpClass* op) : _op(op) {}
    +
    75 
    +
    76  using result_type = void;
    +
    77 
    +
    78  template <typename View>
    +
    79  void operator()(View const& view)
    +
    80  {
    +
    81  apply(view, typename IsSupported::template apply<View>::type());
    +
    82  }
    +
    83 
    +
    84  template< typename View, typename Info >
    +
    85  void operator()(View const& view, Info const& info)
    +
    86  {
    +
    87  apply(view, info, typename IsSupported::template apply<View>::type());
    +
    88  }
    +
    89 };
    +
    90 
    +
    91 } // namespace detail
    +
    92 
    +
    95 template <typename ...Images,typename Pred>
    +
    96 inline bool construct_matched(any_image<Images...>& img, Pred pred)
    +
    97 {
    +
    98  constexpr auto size = mp11::mp_size<any_image<Images...>>::value;
    +
    99  return detail::construct_matched_t<size>::apply(img, pred);
    +
    100 }
    +
    101 
    +
    102 } } // namespace boost::gil
    +
    103 
    +
    104 #endif
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    diff --git a/develop/doc/html/reference/dynamic__step_8hpp_source.html b/develop/doc/html/reference/dynamic__step_8hpp_source.html index 9a0a6ef27..b336a8931 100644 --- a/develop/doc/html/reference/dynamic__step_8hpp_source.html +++ b/develop/doc/html/reference/dynamic__step_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_step.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    Returns the type of a view that has a dynamic step along both X and Y.
    Definition: dynamic_step.hpp:27
    -
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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
    +
    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: dynamic_step.hpp:27
    +
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    diff --git a/develop/doc/html/reference/dynsections.js b/develop/doc/html/reference/dynsections.js new file mode 100644 index 000000000..ea0a7b39a --- /dev/null +++ b/develop/doc/html/reference/dynsections.js @@ -0,0 +1,120 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l - + Generic Image Library: error.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    +
    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
    diff --git a/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp.html b/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp.html index 4b7d10860..b225b8d5a 100644 --- a/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp.html +++ b/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp.html @@ -4,7 +4,7 @@ - + Generic Image Library: algorithm.hpp File Reference @@ -27,21 +27,16 @@

    - - - + + + + + @@ -118,7 +113,7 @@ Functions diff --git a/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html b/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html index 22b36718f..7c98b385a 100644 --- a/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html +++ b/develop/doc/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: algorithm.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -Go to the documentation of this file.
    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_ALGORITHM_HPP
    9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP
    10 
    11 #include <boost/gil/extension/dynamic_image/any_image.hpp>
    12 
    13 #include <boost/gil/algorithm.hpp>
    14 
    15 #include <functional>
    16 
    25 
    26 namespace boost { namespace gil {
    27 
    28 namespace detail {
    29 
    30 struct equal_pixels_fn : binary_operation_obj<equal_pixels_fn, bool>
    31 {
    32  template <typename V1, typename V2>
    33  BOOST_FORCEINLINE
    34  bool apply_compatible(V1 const& v1, V2 const& v2) const
    35  {
    36  return equal_pixels(v1, v2);
    37  }
    38 };
    39 
    40 } // namespace detail
    41 
    45 template <typename ...Types, typename View>
    46 bool equal_pixels(any_image_view<Types...> const& src, View const& dst)
    47 {
    48  return apply_operation(
    49  src,
    50  std::bind(detail::equal_pixels_fn(), std::placeholders::_1, dst));
    51 }
    52 
    56 template <typename View, typename ...Types>
    57 bool equal_pixels(View const& src, any_image_view<Types...> const& dst)
    58 {
    59  return apply_operation(
    60  dst,
    61  std::bind(detail::equal_pixels_fn(), src, std::placeholders::_1));
    62 }
    63 
    67 template <typename ...Types1, typename ...Types2>
    69 {
    70  return apply_operation(src, dst, detail::equal_pixels_fn());
    71 }
    72 
    73 namespace detail {
    74 
    75 struct copy_pixels_fn : public binary_operation_obj<copy_pixels_fn>
    76 {
    77  template <typename View1, typename View2>
    78  BOOST_FORCEINLINE
    79  void apply_compatible(View1 const& src, View2 const& dst) const
    80  {
    81  copy_pixels(src,dst);
    82  }
    83 };
    84 
    85 } // namespace detail
    86 
    90 template <typename ...Types, typename View>
    91 void copy_pixels(any_image_view<Types...> const& src, View const& dst)
    92 {
    93  apply_operation(src, std::bind(detail::copy_pixels_fn(), std::placeholders::_1, dst));
    94 }
    95 
    99 template <typename ...Types, typename View>
    100 void copy_pixels(View const& src, any_image_view<Types...> const& dst)
    101 {
    102  apply_operation(dst, std::bind(detail::copy_pixels_fn(), src, std::placeholders::_1));
    103 }
    104 
    108 template <typename ...Types1, typename ...Types2>
    110 {
    111  apply_operation(src, dst, detail::copy_pixels_fn());
    112 }
    113 
    114 //forward declaration for default_color_converter (see full definition in color_convert.hpp)
    116 
    121 template <typename ...Types, typename View, typename CC>
    122 void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst, CC cc)
    123 {
    124  using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
    125  apply_operation(src, std::bind(cc_fn{cc}, std::placeholders::_1, dst));
    126 }
    127 
    131 template <typename ...Types, typename View>
    132 void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst)
    133 {
    134  using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
    135  apply_operation(src, std::bind(cc_fn{}, std::placeholders::_1, dst));
    136 }
    137 
    142 template <typename View, typename ...Types, typename CC>
    143 void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst, CC cc)
    144 {
    145  using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
    146  apply_operation(dst, std::bind(cc_fn{cc}, src, std::placeholders::_1));
    147 }
    148 
    152 template <typename View, typename ...Types>
    153 void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst)
    154 {
    155  using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
    156  apply_operation(dst, std::bind(cc_fn{}, src, std::placeholders::_1));
    157 }
    158 
    163 template <typename ...Types1, typename ...Types2, typename CC>
    165  any_image_view<Types1...> const& src,
    166  any_image_view<Types2...> const& dst, CC cc)
    167 {
    168  apply_operation(src, dst, detail::copy_and_convert_pixels_fn<CC>(cc));
    169 }
    170 
    174 template <typename ...Types1, typename ...Types2>
    176  any_image_view<Types1...> const& src,
    177  any_image_view<Types2...> const& dst)
    178 {
    179  apply_operation(src, dst,
    180  detail::copy_and_convert_pixels_fn<default_color_converter>());
    181 }
    182 
    183 namespace detail {
    184 
    185 template <bool IsCompatible>
    186 struct fill_pixels_fn1
    187 {
    188  template <typename V, typename Value>
    189  static void apply(V const &src, Value const &val) { fill_pixels(src, val); }
    190 };
    191 
    192 // copy_pixels invoked on incompatible images
    193 template <>
    194 struct fill_pixels_fn1<false>
    195 {
    196  template <typename V, typename Value>
    197  static void apply(V const &, Value const &) { throw std::bad_cast();}
    198 };
    199 
    200 template <typename Value>
    201 struct fill_pixels_fn
    202 {
    203  fill_pixels_fn(Value const& val) : val_(val) {}
    204 
    205  using result_type = void;
    206  template <typename V>
    207  result_type operator()(V const& view) const
    208  {
    209  fill_pixels_fn1
    210  <
    212  <
    213  typename V::value_type,
    214  Value
    215  >::value
    216  >::apply(view, val_);
    217  }
    218 
    219  Value val_;
    220 };
    221 
    222 } // namespace detail
    223 
    227 template <typename ...Types, typename Value>
    228 void fill_pixels(any_image_view<Types...> const& view, Value const& val)
    229 {
    230  apply_operation(view, detail::fill_pixels_fn<Value>(val));
    231 }
    232 
    233 }} // namespace boost::gil
    234 
    235 #endif
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    -
    Definition: algorithm.hpp:30
    -
    void copy_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:109
    -
    A generic binary operation on viewsUse this class as a convenience superclass when defining an operat...
    Definition: algorithm.hpp:81
    -
    void copy_and_convert_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:175
    -
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    -
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    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:228
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    -
    bool equal_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:68
    +Go to the documentation of this file.
    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_ALGORITHM_HPP
    +
    9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP
    +
    10 
    +
    11 #include <boost/gil/extension/dynamic_image/any_image.hpp>
    +
    12 
    +
    13 #include <boost/gil/algorithm.hpp>
    +
    14 
    +
    15 #include <functional>
    +
    16 
    +
    25 
    +
    26 namespace boost { namespace gil {
    +
    27 
    +
    28 namespace detail {
    +
    29 
    +
    30 struct equal_pixels_fn : binary_operation_obj<equal_pixels_fn, bool>
    +
    31 {
    +
    32  template <typename V1, typename V2>
    +
    33  BOOST_FORCEINLINE
    +
    34  bool apply_compatible(V1 const& v1, V2 const& v2) const
    +
    35  {
    +
    36  return equal_pixels(v1, v2);
    +
    37  }
    +
    38 };
    +
    39 
    +
    40 } // namespace detail
    +
    41 
    +
    45 template <typename ...Types, typename View>
    +
    46 bool equal_pixels(any_image_view<Types...> const& src, View const& dst)
    +
    47 {
    +
    48  return apply_operation(
    +
    49  src,
    +
    50  std::bind(detail::equal_pixels_fn(), std::placeholders::_1, dst));
    +
    51 }
    +
    52 
    +
    56 template <typename View, typename ...Types>
    +
    57 bool equal_pixels(View const& src, any_image_view<Types...> const& dst)
    +
    58 {
    +
    59  return apply_operation(
    +
    60  dst,
    +
    61  std::bind(detail::equal_pixels_fn(), src, std::placeholders::_1));
    +
    62 }
    +
    63 
    +
    67 template <typename ...Types1, typename ...Types2>
    + +
    69 {
    +
    70  return apply_operation(src, dst, detail::equal_pixels_fn());
    +
    71 }
    +
    72 
    +
    73 namespace detail {
    +
    74 
    +
    75 struct copy_pixels_fn : public binary_operation_obj<copy_pixels_fn>
    +
    76 {
    +
    77  template <typename View1, typename View2>
    +
    78  BOOST_FORCEINLINE
    +
    79  void apply_compatible(View1 const& src, View2 const& dst) const
    +
    80  {
    +
    81  copy_pixels(src,dst);
    +
    82  }
    +
    83 };
    +
    84 
    +
    85 } // namespace detail
    +
    86 
    +
    90 template <typename ...Types, typename View>
    +
    91 void copy_pixels(any_image_view<Types...> const& src, View const& dst)
    +
    92 {
    +
    93  apply_operation(src, std::bind(detail::copy_pixels_fn(), std::placeholders::_1, dst));
    +
    94 }
    +
    95 
    +
    99 template <typename ...Types, typename View>
    +
    100 void copy_pixels(View const& src, any_image_view<Types...> const& dst)
    +
    101 {
    +
    102  apply_operation(dst, std::bind(detail::copy_pixels_fn(), src, std::placeholders::_1));
    +
    103 }
    +
    104 
    +
    108 template <typename ...Types1, typename ...Types2>
    + +
    110 {
    +
    111  apply_operation(src, dst, detail::copy_pixels_fn());
    +
    112 }
    +
    113 
    +
    114 //forward declaration for default_color_converter (see full definition in color_convert.hpp)
    +
    115 struct default_color_converter;
    +
    116 
    +
    121 template <typename ...Types, typename View, typename CC>
    +
    122 void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst, CC cc)
    +
    123 {
    +
    124  using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
    +
    125  apply_operation(src, std::bind(cc_fn{cc}, std::placeholders::_1, dst));
    +
    126 }
    +
    127 
    +
    131 template <typename ...Types, typename View>
    +
    132 void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst)
    +
    133 {
    +
    134  using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
    +
    135  apply_operation(src, std::bind(cc_fn{}, std::placeholders::_1, dst));
    +
    136 }
    +
    137 
    +
    142 template <typename View, typename ...Types, typename CC>
    +
    143 void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst, CC cc)
    +
    144 {
    +
    145  using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
    +
    146  apply_operation(dst, std::bind(cc_fn{cc}, src, std::placeholders::_1));
    +
    147 }
    +
    148 
    +
    152 template <typename View, typename ...Types>
    +
    153 void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst)
    +
    154 {
    +
    155  using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
    +
    156  apply_operation(dst, std::bind(cc_fn{}, src, std::placeholders::_1));
    +
    157 }
    +
    158 
    +
    163 template <typename ...Types1, typename ...Types2, typename CC>
    + +
    165  any_image_view<Types1...> const& src,
    +
    166  any_image_view<Types2...> const& dst, CC cc)
    +
    167 {
    +
    168  apply_operation(src, dst, detail::copy_and_convert_pixels_fn<CC>(cc));
    +
    169 }
    +
    170 
    +
    174 template <typename ...Types1, typename ...Types2>
    + +
    176  any_image_view<Types1...> const& src,
    +
    177  any_image_view<Types2...> const& dst)
    +
    178 {
    +
    179  apply_operation(src, dst,
    +
    180  detail::copy_and_convert_pixels_fn<default_color_converter>());
    +
    181 }
    +
    182 
    +
    183 namespace detail {
    +
    184 
    +
    185 template <bool IsCompatible>
    +
    186 struct fill_pixels_fn1
    +
    187 {
    +
    188  template <typename V, typename Value>
    +
    189  static void apply(V const &src, Value const &val) { fill_pixels(src, val); }
    +
    190 };
    +
    191 
    +
    192 // copy_pixels invoked on incompatible images
    +
    193 template <>
    +
    194 struct fill_pixels_fn1<false>
    +
    195 {
    +
    196  template <typename V, typename Value>
    +
    197  static void apply(V const &, Value const &) { throw std::bad_cast();}
    +
    198 };
    +
    199 
    +
    200 template <typename Value>
    +
    201 struct fill_pixels_fn
    +
    202 {
    +
    203  fill_pixels_fn(Value const& val) : val_(val) {}
    +
    204 
    +
    205  using result_type = void;
    +
    206  template <typename V>
    +
    207  result_type operator()(V const& view) const
    +
    208  {
    +
    209  fill_pixels_fn1
    +
    210  <
    +
    211  pixels_are_compatible
    +
    212  <
    +
    213  typename V::value_type,
    +
    214  Value
    +
    215  >::value
    +
    216  >::apply(view, val_);
    +
    217  }
    +
    218 
    +
    219  Value val_;
    +
    220 };
    +
    221 
    +
    222 } // namespace detail
    +
    223 
    +
    227 template <typename ...Types, typename Value>
    +
    228 void fill_pixels(any_image_view<Types...> const& view, Value const& val)
    +
    229 {
    +
    230  apply_operation(view, detail::fill_pixels_fn<Value>(val));
    +
    231 }
    +
    232 
    +
    233 }} // namespace boost::gil
    +
    234 
    +
    235 #endif
    +
    void copy_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:109
    +
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    +
    bool equal_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:68
    +
    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:228
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    +
    void copy_and_convert_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:175
    +
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    diff --git a/develop/doc/html/reference/extension_2dynamic__image_2image__view__factory_8hpp_source.html b/develop/doc/html/reference/extension_2dynamic__image_2image__view__factory_8hpp_source.html index ab9a45c0c..06b123147 100644 --- a/develop/doc/html/reference/extension_2dynamic__image_2image__view__factory_8hpp_source.html +++ b/develop/doc/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,21 +27,16 @@

    - - - + + + + +
    -
    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 apply_operation(src, detail::flipped_up_down_view_fn<result_view_t>());
    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 apply_operation(src, detail::flipped_left_right_view_fn<result_view_t>());
    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 apply_operation(src, detail::tranposed_view_fn<result_view_t>());
    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 apply_operation(src,detail::rotated90cw_view_fn<result_view_t>());
    211 }
    212 
    215 template <typename ...Views>
    216 inline
    218  -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
    219 {
    220  return apply_operation(src,detail::rotated90ccw_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type>());
    221 }
    222 
    225 template <typename ...Views>
    226 inline
    228  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
    229 {
    230  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
    231  return apply_operation(src, detail::rotated180_view_fn<step_type>());
    232 }
    233 
    236 template <typename ...Views>
    237 inline
    239  any_image_view<Views...> const& src,
    240  point_t const& topleft,
    241  point_t const& dimensions)
    242  -> any_image_view<Views...>
    243 {
    244  using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
    245  return apply_operation(src, subimage_view_fn(topleft, dimensions));
    246 }
    247 
    250 template <typename ...Views>
    251 inline
    253  any_image_view<Views...> const& src,
    254  std::ptrdiff_t x_min, std::ptrdiff_t y_min, std::ptrdiff_t width, std::ptrdiff_t height)
    255  -> any_image_view<Views...>
    256 {
    257  using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
    258  return apply_operation(src, subimage_view_fn(point_t(x_min, y_min),point_t(width, height)));
    259 }
    260 
    263 template <typename ...Views>
    264 inline
    265 auto subsampled_view(any_image_view<Views...> const& src, point_t const& step)
    266  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
    267 {
    268  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
    269  using subsampled_view = detail::subsampled_view_fn<step_type>;
    270  return apply_operation(src, subsampled_view(step));
    271 }
    272 
    275 template <typename ...Views>
    276 inline
    277 auto subsampled_view(any_image_view<Views...> const& src, std::ptrdiff_t x_step, std::ptrdiff_t y_step)
    278  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
    279 {
    280  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
    281  using subsampled_view_fn = detail::subsampled_view_fn<step_type>;
    282  return apply_operation(src, subsampled_view_fn(point_t(x_step, y_step)));
    283 }
    284 
    285 namespace detail {
    286 
    287 template <typename View>
    288 struct get_nthchannel_type { using type = typename nth_channel_view_type<View>::type; };
    289 
    290 template <typename Views>
    291 struct views_get_nthchannel_type : mp11::mp_transform<get_nthchannel_type, Views> {};
    292 
    293 } // namespace detail
    294 
    297 template <typename ...Views>
    299 {
    300  using type = typename detail::views_get_nthchannel_type<any_image_view<Views...>>;
    301 };
    302 
    305 template <typename ...Views>
    306 inline
    308  -> typename nth_channel_view_type<any_image_view<Views...>>::type
    309 {
    310  using result_view_t = typename nth_channel_view_type<any_image_view<Views...>>::type;
    311  return apply_operation(src,detail::nth_channel_view_fn<result_view_t>(n));
    312 }
    313 
    314 namespace detail {
    315 
    316 template <typename View, typename DstP, typename CC>
    317 struct get_ccv_type : color_converted_view_type<View, DstP, CC> {};
    318 
    319 template <typename Views, typename DstP, typename CC>
    320 struct views_get_ccv_type
    321 {
    322 private:
    323  // FIXME: Remove class name injection with detail:: qualification
    324  // Required as workaround for MP11 issue that treats unqualified metafunction
    325  // in the class definition of the same name as the specialization (Peter Dimov):
    326  // invalid template argument for template parameter 'F', expected a class template
    327  template <typename T>
    328  using ccvt = detail::get_ccv_type<T, DstP, CC>;
    329 
    330 public:
    331  using type = mp11::mp_transform<ccvt, Views>;
    332 };
    333 
    334 } // namespace detail
    335 
    338 template <typename ...Views, typename DstP, typename CC>
    339 struct color_converted_view_type<any_image_view<Views...>,DstP,CC>
    340 {
    341  //using type = any_image_view<typename detail::views_get_ccv_type<Views, DstP, CC>::type>;
    342  using type = detail::views_get_ccv_type<any_image_view<Views...>, DstP, CC>;
    343 };
    344 
    348 template <typename DstP, typename ...Views, typename CC>
    349 inline
    351  -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
    352 {
    353  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type;
    354  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    355 }
    356 
    359 template <typename ...Views, typename DstP>
    361 {
    362  using type = detail::views_get_ccv_type<any_image_view<Views...>, DstP, default_color_converter>;
    363 };
    364 
    368 template <typename DstP, typename ...Views>
    369 inline
    371  -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
    372 {
    373  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP>::type;
    374  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    375 }
    376 
    381 template <typename DstP, typename ...Views, typename CC>
    382 inline
    384  -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
    385 {
    386  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type;
    387  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    388 }
    389 
    394 template <typename DstP, typename ...Views>
    395 inline
    397  -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
    398 {
    399  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP>::type;
    400  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    401 }
    402 
    404 
    405 }} // namespace boost::gil
    406 
    407 #endif
    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:396
    -
    Returns the type of a transposed view that has a dynamic step along both X and Y. ...
    Definition: image_view_factory.hpp:51
    -
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    -
    Definition: algorithm.hpp:30
    -
    Returns the type of a view that has a dynamic step along both X and Y.
    Definition: dynamic_step.hpp:27
    -
    Given a source image view type View, returns the type of an image view over a single channel of ViewI...
    Definition: image_view_factory.hpp:406
    -
    Returns the type of a view that does color conversion upon dereferencing its pixels.
    Definition: image_view_factory.hpp:159
    -
    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:277
    -
    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 rotated90cw_view(const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:206
    -
    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:252
    -
    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:370
    -
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    auto nth_channel_view(const any_image_view< Views... > &src, int n) -> typename nth_channel_view_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:307
    -
    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 rotated90ccw_view(const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:217
    -
    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:227
    -
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    -
    auto transposed_view(const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:195
    - -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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 apply_operation(src, detail::flipped_up_down_view_fn<result_view_t>());
    +
    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 apply_operation(src, detail::flipped_left_right_view_fn<result_view_t>());
    +
    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 apply_operation(src, detail::tranposed_view_fn<result_view_t>());
    +
    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 apply_operation(src,detail::rotated90cw_view_fn<result_view_t>());
    +
    211 }
    +
    212 
    +
    215 template <typename ...Views>
    +
    216 inline
    + +
    218  -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
    +
    219 {
    +
    220  return apply_operation(src,detail::rotated90ccw_view_fn<typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type>());
    +
    221 }
    +
    222 
    +
    225 template <typename ...Views>
    +
    226 inline
    + +
    228  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
    +
    229 {
    +
    230  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
    +
    231  return apply_operation(src, detail::rotated180_view_fn<step_type>());
    +
    232 }
    +
    233 
    +
    236 template <typename ...Views>
    +
    237 inline
    + +
    239  any_image_view<Views...> const& src,
    +
    240  point_t const& topleft,
    +
    241  point_t const& dimensions)
    +
    242  -> any_image_view<Views...>
    +
    243 {
    +
    244  using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
    +
    245  return apply_operation(src, subimage_view_fn(topleft, dimensions));
    +
    246 }
    +
    247 
    +
    250 template <typename ...Views>
    +
    251 inline
    + +
    253  any_image_view<Views...> const& src,
    +
    254  std::ptrdiff_t x_min, std::ptrdiff_t y_min, std::ptrdiff_t width, std::ptrdiff_t height)
    +
    255  -> any_image_view<Views...>
    +
    256 {
    +
    257  using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
    +
    258  return apply_operation(src, subimage_view_fn(point_t(x_min, y_min),point_t(width, height)));
    +
    259 }
    +
    260 
    +
    263 template <typename ...Views>
    +
    264 inline
    +
    265 auto subsampled_view(any_image_view<Views...> const& src, point_t const& step)
    +
    266  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
    +
    267 {
    +
    268  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
    +
    269  using subsampled_view = detail::subsampled_view_fn<step_type>;
    +
    270  return apply_operation(src, subsampled_view(step));
    +
    271 }
    +
    272 
    +
    275 template <typename ...Views>
    +
    276 inline
    +
    277 auto subsampled_view(any_image_view<Views...> const& src, std::ptrdiff_t x_step, std::ptrdiff_t y_step)
    +
    278  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
    +
    279 {
    +
    280  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
    +
    281  using subsampled_view_fn = detail::subsampled_view_fn<step_type>;
    +
    282  return apply_operation(src, subsampled_view_fn(point_t(x_step, y_step)));
    +
    283 }
    +
    284 
    +
    285 namespace detail {
    +
    286 
    +
    287 template <typename View>
    +
    288 struct get_nthchannel_type { using type = typename nth_channel_view_type<View>::type; };
    +
    289 
    +
    290 template <typename Views>
    +
    291 struct views_get_nthchannel_type : mp11::mp_transform<get_nthchannel_type, Views> {};
    +
    292 
    +
    293 } // namespace detail
    +
    294 
    +
    297 template <typename ...Views>
    + +
    299 {
    +
    300  using type = typename detail::views_get_nthchannel_type<any_image_view<Views...>>;
    +
    301 };
    +
    302 
    +
    305 template <typename ...Views>
    +
    306 inline
    + +
    308  -> typename nth_channel_view_type<any_image_view<Views...>>::type
    +
    309 {
    +
    310  using result_view_t = typename nth_channel_view_type<any_image_view<Views...>>::type;
    +
    311  return apply_operation(src,detail::nth_channel_view_fn<result_view_t>(n));
    +
    312 }
    +
    313 
    +
    314 namespace detail {
    +
    315 
    +
    316 template <typename View, typename DstP, typename CC>
    +
    317 struct get_ccv_type : color_converted_view_type<View, DstP, CC> {};
    +
    318 
    +
    319 template <typename Views, typename DstP, typename CC>
    +
    320 struct views_get_ccv_type
    +
    321 {
    +
    322 private:
    +
    323  // FIXME: Remove class name injection with detail:: qualification
    +
    324  // Required as workaround for MP11 issue that treats unqualified metafunction
    +
    325  // in the class definition of the same name as the specialization (Peter Dimov):
    +
    326  // invalid template argument for template parameter 'F', expected a class template
    +
    327  template <typename T>
    +
    328  using ccvt = detail::get_ccv_type<T, DstP, CC>;
    +
    329 
    +
    330 public:
    +
    331  using type = mp11::mp_transform<ccvt, Views>;
    +
    332 };
    +
    333 
    +
    334 } // namespace detail
    +
    335 
    +
    338 template <typename ...Views, typename DstP, typename CC>
    +
    339 struct color_converted_view_type<any_image_view<Views...>,DstP,CC>
    +
    340 {
    +
    341  //using type = any_image_view<typename detail::views_get_ccv_type<Views, DstP, CC>::type>;
    +
    342  using type = detail::views_get_ccv_type<any_image_view<Views...>, DstP, CC>;
    +
    343 };
    +
    344 
    +
    348 template <typename DstP, typename ...Views, typename CC>
    +
    349 inline
    + +
    351  -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
    +
    352 {
    +
    353  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type;
    +
    354  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    +
    355 }
    +
    356 
    +
    359 template <typename ...Views, typename DstP>
    + +
    361 {
    +
    362  using type = detail::views_get_ccv_type<any_image_view<Views...>, DstP, default_color_converter>;
    +
    363 };
    +
    364 
    +
    368 template <typename DstP, typename ...Views>
    +
    369 inline
    + +
    371  -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
    +
    372 {
    +
    373  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP>::type;
    +
    374  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    +
    375 }
    +
    376 
    +
    381 template <typename DstP, typename ...Views, typename CC>
    +
    382 inline
    + +
    384  -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
    +
    385 {
    +
    386  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type;
    +
    387  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    +
    388 }
    +
    389 
    +
    394 template <typename DstP, typename ...Views>
    +
    395 inline
    + +
    397  -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
    +
    398 {
    +
    399  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP>::type;
    +
    400  return apply_operation(src, detail::color_converted_view_fn<DstP, cc_view_t>());
    +
    401 }
    +
    402 
    +
    404 
    +
    405 }} // namespace boost::gil
    +
    406 
    +
    407 #endif
    +
    BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
    Applies the visitor op to the variants.
    Definition: apply_operation.hpp:19
    +
    auto rotated90ccw_view(const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:217
    +
    Returns the type of a view that does color conversion upon dereferencing its pixels.
    Definition: image_view_factory.hpp:159
    +
    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:396
    +
    auto rotated90cw_view(const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:206
    +
    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
    +
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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
    +
    Returns the type of a transposed view that has a dynamic step along both X and Y.
    Definition: image_view_factory.hpp:51
    +
    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:227
    +
    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:277
    +
    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:370
    +
    auto nth_channel_view(const any_image_view< Views... > &src, int n) -> typename nth_channel_view_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:307
    +
    Returns the type of a view that has a dynamic step along both X and Y.
    Definition: dynamic_step.hpp:27
    + +
    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:406
    +
    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:252
    +
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    +
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    +
    auto transposed_view(const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    Definition: extension/dynamic_image/image_view_factory.hpp:195
    +
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    diff --git a/develop/doc/html/reference/files.html b/develop/doc/html/reference/files.html index 8d9345590..b09ceaac2 100644 --- a/develop/doc/html/reference/files.html +++ b/develop/doc/html/reference/files.html @@ -4,7 +4,7 @@ - + Generic Image Library: File List @@ -27,21 +27,16 @@

    - - - + + + + +
    @@ -50,105 +45,113 @@
    Here is a list of all documented files with brief descriptions:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     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
     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
     deprecated.hpp
     device.hpp
     device_n.hpp
     dynamic_at_c.hpp
     dynamic_image_all.hpp
     dynamic_io_new.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
     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
     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
     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
     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
     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
     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
     deprecated.hpp
     device.hpp
     device_n.hpp
     diffusion.hpp
     dynamic_at_c.hpp
     dynamic_image_all.hpp
     dynamic_io_new.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
     hough_parameter.hpp
     hough_transform.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
     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
     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
    @@ -157,7 +160,7 @@ diff --git a/develop/doc/html/reference/filter_8hpp_source.html b/develop/doc/html/reference/filter_8hpp_source.html index 44b4d8f80..f0095fa80 100644 --- a/develop/doc/html/reference/filter_8hpp_source.html +++ b/develop/doc/html/reference/filter_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: filter.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    1 //
    2 // Copyright 2019 Miral Shah <miralshah2211@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_FILTER_HPP
    10 #define BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    11 
    12 #include <boost/gil/extension/numeric/algorithm.hpp>
    13 #include <boost/gil/extension/numeric/kernel.hpp>
    14 #include <boost/gil/extension/numeric/convolve.hpp>
    15 
    16 #include <boost/gil/image.hpp>
    17 #include <boost/gil/image_view.hpp>
    18 
    19 #include <cstddef>
    20 #include <vector>
    21 
    22 
    23 
    24 
    25 namespace boost { namespace gil {
    26 
    27 template <typename SrcView, typename DstView>
    28 void box_filter(
    29  SrcView const& src_view,
    30  DstView const& dst_view,
    31  std::size_t kernel_size,
    32  long int anchor = -1,
    33  bool normalize=true,
    34  boundary_option option = boundary_option::extend_zero
    35 )
    36 {
    37  gil_function_requires<ImageViewConcept<SrcView>>();
    38  gil_function_requires<MutableImageViewConcept<DstView>>();
    39  static_assert(color_spaces_are_compatible
    40  <
    41  typename color_space_type<SrcView>::type,
    42  typename color_space_type<DstView>::type
    43  >::value, "Source and destination views must have pixels with the same color space");
    44 
    45  std::vector<float> kernel_values;
    46  if (normalize) { kernel_values.resize(kernel_size, 1.0f / float(kernel_size)); }
    47  else { kernel_values.resize(kernel_size, 1.0f); }
    48 
    49  if (anchor == -1) anchor = static_cast<int>(kernel_size / 2);
    50  kernel_1d<float> kernel(kernel_values.begin(), kernel_size, anchor);
    51 
    52  detail::convolve_1d
    53  <
    54  pixel<float, typename SrcView::value_type::layout_t>
    55  >(src_view, kernel, dst_view, option);
    56 }
    57 
    58 template <typename SrcView, typename DstView>
    59 void blur(
    60  SrcView const& src_view,
    61  DstView const& dst_view,
    62  std::size_t kernel_size,
    63  long int anchor = -1,
    64  boundary_option option = boundary_option::extend_zero
    65 )
    66 {
    67  box_filter(src_view, dst_view, kernel_size, anchor, true, option);
    68 }
    69 
    70 
    71 namespace detail
    72 {
    73 template <typename SrcView, typename DstView>
    74 void filter_median_impl(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    75 {
    76  std::size_t half_kernel_size = kernel_size / 2;
    77 
    78  // deciding output channel type and creating functor
    79  using src_channel_t = typename channel_type<SrcView>::type;
    80 
    81  std::vector<src_channel_t> values;
    82  values.reserve(kernel_size * kernel_size);
    83 
    84  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
    85  {
    86  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
    87 
    88  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
    89  {
    90  auto sub_view = subimage_view(
    91  src_view,
    92  x - half_kernel_size, y - half_kernel_size,
    93  kernel_size,
    94  kernel_size
    95  );
    96  values.assign(sub_view.begin(), sub_view.end());
    97 
    98  std::nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
    99  dst_it[x] = values[values.size() / 2];
    100  }
    101  }
    102 }
    103 } // namespace detail
    104 
    105 template <typename SrcView, typename DstView>
    106 void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    107 {
    108  static_assert(color_spaces_are_compatible
    109  <
    110  typename color_space_type<SrcView>::type,
    111  typename color_space_type<DstView>::type
    112  >::value, "Source and destination views must have pixels with the same color space");
    113 
    114  std::size_t half_kernel_size = kernel_size / 2;
    115  auto extended_img = extend_boundary(
    116  src_view,
    117  half_kernel_size,
    118  boundary_option::extend_constant
    119  );
    120  auto extended_view = subimage_view(
    121  view(extended_img),
    122  half_kernel_size,
    123  half_kernel_size,
    124  src_view.width(),
    125  src_view.height()
    126  );
    127 
    128  for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++)
    129  {
    130  detail::filter_median_impl(
    131  nth_channel_view(extended_view, channel),
    132  nth_channel_view(dst_view, channel),
    133  kernel_size
    134  );
    135  }
    136 }
    137 
    138 }} //namespace boost::gil
    139 
    140 #endif // !BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    Definition: algorithm.hpp:30
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    +
    1 //
    +
    2 // Copyright 2019 Miral Shah <miralshah2211@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_FILTER_HPP
    +
    10 #define BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    +
    11 
    +
    12 #include <boost/gil/extension/numeric/algorithm.hpp>
    +
    13 #include <boost/gil/extension/numeric/kernel.hpp>
    +
    14 #include <boost/gil/extension/numeric/convolve.hpp>
    +
    15 
    +
    16 #include <boost/gil/image.hpp>
    +
    17 #include <boost/gil/image_view.hpp>
    +
    18 
    +
    19 #include <cstddef>
    +
    20 #include <vector>
    +
    21 
    +
    22 
    +
    23 
    +
    24 
    +
    25 namespace boost { namespace gil {
    +
    26 
    +
    27 template <typename SrcView, typename DstView>
    +
    28 void box_filter(
    +
    29  SrcView const& src_view,
    +
    30  DstView const& dst_view,
    +
    31  std::size_t kernel_size,
    +
    32  long int anchor = -1,
    +
    33  bool normalize=true,
    +
    34  boundary_option option = boundary_option::extend_zero
    +
    35 )
    +
    36 {
    +
    37  gil_function_requires<ImageViewConcept<SrcView>>();
    +
    38  gil_function_requires<MutableImageViewConcept<DstView>>();
    +
    39  static_assert(color_spaces_are_compatible
    +
    40  <
    +
    41  typename color_space_type<SrcView>::type,
    +
    42  typename color_space_type<DstView>::type
    +
    43  >::value, "Source and destination views must have pixels with the same color space");
    +
    44 
    +
    45  std::vector<float> kernel_values;
    +
    46  if (normalize) { kernel_values.resize(kernel_size, 1.0f / float(kernel_size)); }
    +
    47  else { kernel_values.resize(kernel_size, 1.0f); }
    +
    48 
    +
    49  if (anchor == -1) anchor = static_cast<int>(kernel_size / 2);
    +
    50  kernel_1d<float> kernel(kernel_values.begin(), kernel_size, anchor);
    +
    51 
    +
    52  detail::convolve_1d
    +
    53  <
    +
    54  pixel<float, typename SrcView::value_type::layout_t>
    +
    55  >(src_view, kernel, dst_view, option);
    +
    56 }
    +
    57 
    +
    58 template <typename SrcView, typename DstView>
    +
    59 void blur(
    +
    60  SrcView const& src_view,
    +
    61  DstView const& dst_view,
    +
    62  std::size_t kernel_size,
    +
    63  long int anchor = -1,
    +
    64  boundary_option option = boundary_option::extend_zero
    +
    65 )
    +
    66 {
    +
    67  box_filter(src_view, dst_view, kernel_size, anchor, true, option);
    +
    68 }
    +
    69 
    +
    70 
    +
    71 namespace detail
    +
    72 {
    +
    73 template <typename SrcView, typename DstView>
    +
    74 void filter_median_impl(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    +
    75 {
    +
    76  std::size_t half_kernel_size = kernel_size / 2;
    +
    77 
    +
    78  // deciding output channel type and creating functor
    +
    79  using src_channel_t = typename channel_type<SrcView>::type;
    +
    80 
    +
    81  std::vector<src_channel_t> values;
    +
    82  values.reserve(kernel_size * kernel_size);
    +
    83 
    +
    84  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
    +
    85  {
    +
    86  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
    +
    87 
    +
    88  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
    +
    89  {
    +
    90  auto sub_view = subimage_view(
    +
    91  src_view,
    +
    92  x - half_kernel_size, y - half_kernel_size,
    +
    93  kernel_size,
    +
    94  kernel_size
    +
    95  );
    +
    96  values.assign(sub_view.begin(), sub_view.end());
    +
    97 
    +
    98  std::nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
    +
    99  dst_it[x] = values[values.size() / 2];
    +
    100  }
    +
    101  }
    +
    102 }
    +
    103 } // namespace detail
    +
    104 
    +
    105 template <typename SrcView, typename DstView>
    +
    106 void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    +
    107 {
    +
    108  static_assert(color_spaces_are_compatible
    +
    109  <
    +
    110  typename color_space_type<SrcView>::type,
    +
    111  typename color_space_type<DstView>::type
    +
    112  >::value, "Source and destination views must have pixels with the same color space");
    +
    113 
    +
    114  std::size_t half_kernel_size = kernel_size / 2;
    +
    115  auto extended_img = extend_boundary(
    +
    116  src_view,
    +
    117  half_kernel_size,
    +
    118  boundary_option::extend_constant
    +
    119  );
    +
    120  auto extended_view = subimage_view(
    +
    121  view(extended_img),
    +
    122  half_kernel_size,
    +
    123  half_kernel_size,
    +
    124  src_view.width(),
    +
    125  src_view.height()
    +
    126  );
    +
    127 
    +
    128  for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++)
    +
    129  {
    +
    130  detail::filter_median_impl(
    +
    131  nth_channel_view(extended_view, channel),
    +
    132  nth_channel_view(dst_view, channel),
    +
    133  kernel_size
    +
    134  );
    +
    135  }
    +
    136 }
    +
    137 
    +
    138 }} //namespace boost::gil
    +
    139 
    +
    140 #endif // !BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    +
    nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
    Definition: image_view_factory.hpp:418
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    +
    View subimage_view(View const &src, typename View::point_t const &topleft, typename View::point_t const &dimensions)
    Definition: image_view_factory.hpp:254
    diff --git a/develop/doc/html/reference/functions.html b/develop/doc/html/reference/functions.html index 23b0e7f65..73924bb74 100644 --- a/develop/doc/html/reference/functions.html +++ b/develop/doc/html/reference/functions.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class Members @@ -27,95 +27,125 @@

    - - - - - + + + + +
    Here is a list of all documented class members with links to the class documentation for each member:
    -

    - b -


    - - - - - + + + + +
      -

    - b -


    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    +
    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
    diff --git a/develop/doc/html/reference/get__read__device_8hpp_source.html b/develop/doc/html/reference/get__read__device_8hpp_source.html index 850ded661..d7ac4a769 100644 --- a/develop/doc/html/reference/get__read__device_8hpp_source.html +++ b/develop/doc/html/reference/get__read__device_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_read_device.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    Definition: algorithm.hpp:133
    +
    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
    diff --git a/develop/doc/html/reference/get__reader_8hpp_source.html b/develop/doc/html/reference/get__reader_8hpp_source.html index fab2ff7ff..77446c5d2 100644 --- a/develop/doc/html/reference/get__reader_8hpp_source.html +++ b/develop/doc/html/reference/get__reader_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_reader.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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>
    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
    Helper metafunction to generate dynamic image reader type.
    Definition: get_reader.hpp:70
    -
    Helper metafunction to generate image backend type.
    Definition: get_reader.hpp:114
    -
    Definition: algorithm.hpp:30
    -
    Helper metafunction to generate image reader type.
    Definition: get_reader.hpp:26
    -
    Helper metafunction to generate image scanline_reader type.
    Definition: get_reader.hpp:158
    +
    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
    +
    Helper metafunction to generate image backend type.
    Definition: get_reader.hpp:114
    +
    Helper metafunction to generate image reader type.
    Definition: get_reader.hpp:26
    +
    Helper metafunction to generate image scanline_reader type.
    Definition: get_reader.hpp:158
    +
    Helper metafunction to generate dynamic image reader type.
    Definition: get_reader.hpp:70
    diff --git a/develop/doc/html/reference/get__write__device_8hpp_source.html b/develop/doc/html/reference/get__write__device_8hpp_source.html index a13040f38..db0476f8a 100644 --- a/develop/doc/html/reference/get__write__device_8hpp_source.html +++ b/develop/doc/html/reference/get__write__device_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_write_device.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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
    Definition: algorithm.hpp:30
    -
    Definition: algorithm.hpp:133
    +
    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
    diff --git a/develop/doc/html/reference/get__writer_8hpp_source.html b/develop/doc/html/reference/get__writer_8hpp_source.html index 6a07609f3..1977b5283 100644 --- a/develop/doc/html/reference/get__writer_8hpp_source.html +++ b/develop/doc/html/reference/get__writer_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_writer.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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>
    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
    Definition: algorithm.hpp:30
    -
    Helper metafunction to generate writer type.
    Definition: get_writer.hpp:20
    -
    Helper metafunction to generate dynamic image writer type.
    Definition: get_writer.hpp:63
    +
    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
    +
    Helper metafunction to generate writer type.
    Definition: get_writer.hpp:20
    +
    Helper metafunction to generate dynamic image writer type.
    Definition: get_writer.hpp:63
    diff --git a/develop/doc/html/reference/gray_8hpp_source.html b/develop/doc/html/reference/gray_8hpp_source.html index 8f7478c44..fda5cb2ac 100644 --- a/develop/doc/html/reference/gray_8hpp_source.html +++ b/develop/doc/html/reference/gray_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: gray.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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 
    Definition: algorithm.hpp:30
    -
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    -
    Gray.
    Definition: gray.hpp:18
    +
    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 
    +
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    +
    Gray.
    Definition: gray.hpp:18
    +
    mp11::mp_list< gray_color_t > gray_t
    Definition: gray.hpp:21
    diff --git a/develop/doc/html/reference/group___a_h_e-helpers.html b/develop/doc/html/reference/group___a_h_e-helpers.html new file mode 100644 index 000000000..4f7505640 --- /dev/null +++ b/develop/doc/html/reference/group___a_h_e-helpers.html @@ -0,0 +1,60 @@ + + + + + + + + + Generic Image Library: AHE-helpers + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + +
    +
    +
    +
    AHE-helpers
    +
    +
    + +

    AHE helper functions. +More...

    +

    AHE helper functions.

    +
    + + + + + + diff --git a/develop/doc/html/reference/group___a_h_e.html b/develop/doc/html/reference/group___a_h_e.html new file mode 100644 index 000000000..b091ee4a4 --- /dev/null +++ b/develop/doc/html/reference/group___a_h_e.html @@ -0,0 +1,61 @@ + + + + + + + + + Generic Image Library: AHE + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + +
    +
    +
    +
    AHE
    +
    +
    + +

    Adaptive Histogram Equalization(AHE) +More...

    +

    Adaptive Histogram Equalization(AHE)

    +

    Contains implementation and description of the algorithm used to compute adaptive histogram equalization of input images. Naming for the AHE functions are done in the following way <feature-1>_<feature-2>_.._<feature-n>ahe For example, for AHE done using local (non-overlapping) tiles/blocks and final output interpolated among tiles , it is called non_overlapping_interpolated_clahe

    +
    + + + + + + diff --git a/develop/doc/html/reference/group___basic_concepts.html b/develop/doc/html/reference/group___basic_concepts.html index 9b9c54d79..9fea1656f 100644 --- a/develop/doc/html/reference/group___basic_concepts.html +++ b/develop/doc/html/reference/group___basic_concepts.html @@ -4,7 +4,7 @@ - + Generic Image Library: Basic Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -84,7 +84,7 @@ Classes diff --git a/develop/doc/html/reference/group___channel.html b/develop/doc/html/reference/group___channel.html index 0a4697531..281d05917 100644 --- a/develop/doc/html/reference/group___channel.html +++ b/develop/doc/html/reference/group___channel.html @@ -4,7 +4,7 @@ - + Generic Image Library: Channel @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -69,7 +69,7 @@ Modules diff --git a/develop/doc/html/reference/group___channel_algorithm.html b/develop/doc/html/reference/group___channel_algorithm.html index 7ef15c68a..d810fd8d7 100644 --- a/develop/doc/html/reference/group___channel_algorithm.html +++ b/develop/doc/html/reference/group___channel_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -53,7 +53,7 @@

    Modules

     channel_convert - Converting from one channel type to anotherConversion 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!
    + Converting from one channel type to another.
       channel_multiply  Multiplying unsigned channel values of the same type. Performs scaled multiplication result = a * b / max_value.
    @@ -76,7 +76,7 @@ Classes diff --git a/develop/doc/html/reference/group___channel_concept.html b/develop/doc/html/reference/group___channel_concept.html index e487aa4cf..1c1eecb7f 100644 --- a/develop/doc/html/reference/group___channel_concept.html +++ b/develop/doc/html/reference/group___channel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -75,7 +75,7 @@ Classes diff --git a/develop/doc/html/reference/group___channel_convert_algorithm.html b/develop/doc/html/reference/group___channel_convert_algorithm.html index f24692594..8b24f3db0 100644 --- a/develop/doc/html/reference/group___channel_convert_algorithm.html +++ b/develop/doc/html/reference/group___channel_convert_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_convert @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -48,7 +48,7 @@
    -

    Converting from one channel type to anotherConversion 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! +

    Converting from one channel type to another. More...

    - +

    @@ -63,28 +63,36 @@ Classes

     A unary function object converting between channel types. More...
     
    struct  default_channel_converter
     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...
     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 >
    channel_traits< DstChannel >::value_type channel_convert (const SrcChannel &src)
     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!

    +

    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();
    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
    +

    Example:

    // float32_t is a floating point channel with range [0.0f ... 1.0f]
    +
    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:124
    diff --git a/develop/doc/html/reference/group___channel_convert_unsigned_algorithm.html b/develop/doc/html/reference/group___channel_convert_unsigned_algorithm.html index 0c594cee8..7bf47d720 100644 --- a/develop/doc/html/reference/group___channel_convert_unsigned_algorithm.html +++ b/develop/doc/html/reference/group___channel_convert_unsigned_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_converter_unsigned @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -72,7 +72,7 @@ Classes diff --git a/develop/doc/html/reference/group___channel_invert_algorithm.html b/develop/doc/html/reference/group___channel_invert_algorithm.html index e86e0b75a..efb3fcfc5 100644 --- a/develop/doc/html/reference/group___channel_invert_algorithm.html +++ b/develop/doc/html/reference/group___channel_invert_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_invert @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,21 +51,54 @@ - + - +

    Functions

    -template<typename Channel >
    template<typename Channel >
    channel_traits< Channel >::value_type channel_invert (Channel x)
     Default implementation. Provide overloads for performance.
     Default implementation. Provide overloads for performance. More...
     

    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);
    assert(inv == 0);
    +

    Example:

    // uint8_t == uint8_t == unsigned char
    +
    uint8_t x=255;
    +
    uint8_t inv = channel_invert(x);
    +
    assert(inv == 0);
    +

    Function Documentation

    + +

    ◆ channel_invert()

    + +
    +
    + + + + + +
    + + + + + + + + +
    channel_traits<Channel>::value_type boost::gil::channel_invert (Channel x)
    +
    +inline
    +
    + +

    Default implementation. Provide overloads for performance.

    + +
    +
    +
    +
    channel_traits< Channel >::value_type channel_invert(Channel x)
    Default implementation. Provide overloads for performance.
    Definition: channel_algorithm.hpp:559
    diff --git a/develop/doc/html/reference/group___channel_model.html b/develop/doc/html/reference/group___channel_model.html index 6e745b0f7..811458022 100644 --- a/develop/doc/html/reference/group___channel_model.html +++ b/develop/doc/html/reference/group___channel_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -60,14 +60,14 @@ Modules - - - - - - + + + + + +

    Typedefs

    -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 >>
     64-bit floating point channel type with range [0.0f ... 1.0f]. Models ChannelValueConcept
     
    +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 > >
     64-bit floating point channel type with range [0.0f ... 1.0f]. Models ChannelValueConcept
     

    Detailed Description

    Channel models. Although not required by the ChannelConcept, all GIL-provided channels support arithmetic operations.

    @@ -77,7 +77,7 @@ using  diff --git a/develop/doc/html/reference/group___channel_multiply_algorithm.html b/develop/doc/html/reference/group___channel_multiply_algorithm.html index 6e233e9f8..83b332758 100644 --- a/develop/doc/html/reference/group___channel_multiply_algorithm.html +++ b/develop/doc/html/reference/group___channel_multiply_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_multiply @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -70,7 +70,7 @@ Classes - @@ -78,13 +78,18 @@ template<typename Channel >

    Functions

    +
    template<typename Channel >
    channel_traits< Channel >::value_type channel_multiply (Channel a, Channel b)
     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);
    assert(mul == 64); // 64 = 128 * 128 / 255
    +

    Example:

    uint8_t x=128;
    +
    uint8_t y=128;
    +
    uint8_t mul = channel_multiply(x,y);
    +
    assert(mul == 64); // 64 = 128 * 128 / 255
    +
    +
    channel_traits< Channel >::value_type channel_multiply(Channel a, Channel b)
    A function multiplying two channels. result = a * b / max_value.
    Definition: channel_algorithm.hpp:539
    diff --git a/develop/doc/html/reference/group___color_base.html b/develop/doc/html/reference/group___color_base.html index 294861ef3..d5628dfe5 100644 --- a/develop/doc/html/reference/group___color_base.html +++ b/develop/doc/html/reference/group___color_base.html @@ -4,7 +4,7 @@ - + Generic Image Library: ColorBase @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -70,7 +70,7 @@ Modules diff --git a/develop/doc/html/reference/group___color_base_algorithm.html b/develop/doc/html/reference/group___color_base_algorithm.html index 5cbf9df04..1a198eb2f 100644 --- a/develop/doc/html/reference/group___color_base_algorithm.html +++ b/develop/doc/html/reference/group___color_base_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -93,7 +93,7 @@ Modules diff --git a/develop/doc/html/reference/group___color_base_algorithm_color.html b/develop/doc/html/reference/group___color_base_algorithm_color.html index 9c8d7641b..93945ec8a 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_color.html +++ b/develop/doc/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,16 +27,16 @@

    - - + + + + +
    @@ -67,28 +67,96 @@ Classes - - - + + + - - - + + +

    Functions

    -template<typename ColorBase , typename Color >
    color_element_reference_type< ColorBase, Color >::type get_color (ColorBase &cb, Color=Color())
     Mutable accessor to the element associated with a given color name.
    template<typename ColorBase , typename Color >
    color_element_reference_type< ColorBase, Color >::type get_color (ColorBase &cb, Color=Color())
     Mutable accessor to the element associated with a given color name. More...
     
    -template<typename ColorBase , typename Color >
    color_element_const_reference_type< ColorBase, Color >::type get_color (const ColorBase &cb, Color=Color())
     Constant accessor to the element associated with a given color name.
    template<typename ColorBase , typename Color >
    color_element_const_reference_type< ColorBase, Color >::type get_color (const ColorBase &cb, Color=Color())
     Constant accessor to the element associated with a given color name. More...
     

    Detailed Description

    get_color: Named channel accessors

    Support for accessing the elements of a color base by color name

    Example: A function that takes a generic pixel containing a red channel and sets it to 100%:

    -
    template <typename Pixel>
    void set_red_to_max(Pixel& pixel) {
    boost::function_requires<MutablePixelConcept<Pixel> >();
    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();
    }
    +
    template <typename Pixel>
    +
    void set_red_to_max(Pixel& pixel) {
    +
    boost::function_requires<MutablePixelConcept<Pixel> >();
    +
    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();
    +
    }
    +

    Function Documentation

    + +

    ◆ get_color() [1/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    color_element_reference_type<ColorBase,Color>::type boost::gil::get_color (ColorBase & cb,
    Color  = Color() 
    )
    +
    + +

    Mutable accessor to the element associated with a given color name.

    + +
    +
    + +

    ◆ get_color() [2/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    color_element_const_reference_type<ColorBase,Color>::type boost::gil::get_color (const ColorBase & cb,
    Color  = Color() 
    )
    +
    + +

    Constant accessor to the element associated with a given color name.

    + +
    +
    +
    +
    color_element_reference_type< ColorBase, Color >::type get_color(ColorBase &cb, Color=Color())
    Mutable accessor to the element associated with a given color name.
    Definition: color_base_algorithm.hpp:190
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_copy.html b/develop/doc/html/reference/group___color_base_algorithm_copy.html index 504901348..6fb4f4a21 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_copy.html +++ b/develop/doc/html/reference/group___color_base_algorithm_copy.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_copy @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,20 +51,26 @@ -

    Functions

    +
    template<typename Src , typename Dst >
    BOOST_FORCEINLINE void static_copy (const Src &src, Dst &dst)
     

    Detailed Description

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

    -

    Example:

    rgb8_pixel_t rgb_red(255,0,0);
    bgr8_pixel_t bgr_red;
    static_copy(rgb_red, bgr_red); // same as bgr_red = rgb_red
    assert(rgb_red[0] == 255 && bgr_red[0] == 0);
    assert(rgb_red == bgr_red);
    +

    Example:

    rgb8_pixel_t rgb_red(255,0,0);
    +
    bgr8_pixel_t bgr_red;
    +
    static_copy(rgb_red, bgr_red); // same as bgr_red = rgb_red
    +
    +
    assert(rgb_red[0] == 255 && bgr_red[0] == 0);
    +
    assert(rgb_red == bgr_red);
    +
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_equal.html b/develop/doc/html/reference/group___color_base_algorithm_equal.html index 33320c648..c159ed684 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_equal.html +++ b/develop/doc/html/reference/group___color_base_algorithm_equal.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_equal @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,20 +51,26 @@ -

    Functions

    +
    template<typename P1 , typename P2 >
    BOOST_FORCEINLINE bool static_equal (const P1 &p1, const P2 &p2)
     

    Detailed Description

    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);
    assert(static_equal(rgb_red,bgr_red));
    assert(rgb_red==bgr_red); // operator== invokes static_equal
    +

    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);
    +
    +
    assert(static_equal(rgb_red,bgr_red));
    +
    assert(rgb_red==bgr_red); // operator== invokes static_equal
    +
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_fill.html b/develop/doc/html/reference/group___color_base_algorithm_fill.html index e52860a1c..42910ef30 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_fill.html +++ b/develop/doc/html/reference/group___color_base_algorithm_fill.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_fill @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,20 +51,23 @@ -

    Functions

    +
    template<typename P , typename V >
    BOOST_FORCEINLINE void static_fill (P &p, const V &v)
     

    Detailed Description

    Equivalent to std::fill.

    -

    Example:

    rgb8_pixel_t p;
    static_fill(p, 10);
    assert(p == rgb8_pixel_t(10,10,10));
    +

    Example:

    rgb8_pixel_t p;
    +
    static_fill(p, 10);
    +
    assert(p == rgb8_pixel_t(10,10,10));
    +
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_for_each.html b/develop/doc/html/reference/group___color_base_algorithm_for_each.html index 0cb570188..41c7e0ba7 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_for_each.html +++ b/develop/doc/html/reference/group___color_base_algorithm_for_each.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_for_each @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,72 +51,88 @@ - - - - - - - - - - - - - -

    Functions

    +
    template<typename P1 , typename 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)
     
    +
    template<typename P1 , typename P2 , typename 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)
     
    +
    template<typename P1 , typename P2 , typename 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)
     
    +
    template<typename P1 , typename P2 , typename P3 , typename 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)
     
    +
    template<typename P1 , typename P2 , typename P3 , typename 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)
     
    +
    template<typename P1 , typename P2 , typename P3 , typename 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)
     
    +
    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)
     
    +
    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)
     

    Detailed Description

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

    -

    Example: Use static_for_each to increment a planar pixel iterator

    struct increment {
    template <typename Incrementable>
    void operator()(Incrementable& x) const { ++x; }
    };
    template <typename ColorBase>
    void increment_elements(ColorBase& cb) {
    static_for_each(cb, increment());
    }
    uint8_t red[2], green[2], blue[2];
    rgb8c_planar_ptr_t p1(red,green,blue);
    rgb8c_planar_ptr_t p2=p1;
    increment_elements(p1);
    ++p2;
    assert(p1 == p2);
    +

    Example: Use static_for_each to increment a planar pixel iterator

    struct increment {
    +
    template <typename Incrementable>
    +
    void operator()(Incrementable& x) const { ++x; }
    +
    };
    +
    +
    template <typename ColorBase>
    +
    void increment_elements(ColorBase& cb) {
    +
    static_for_each(cb, increment());
    +
    }
    +
    +
    uint8_t red[2], green[2], blue[2];
    +
    rgb8c_planar_ptr_t p1(red,green,blue);
    +
    rgb8c_planar_ptr_t p2=p1;
    +
    increment_elements(p1);
    +
    ++p2;
    +
    assert(p1 == p2);
    +
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_generate.html b/develop/doc/html/reference/group___color_base_algorithm_generate.html index 4ff39cc9f..2ac17ec2f 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_generate.html +++ b/develop/doc/html/reference/group___color_base_algorithm_generate.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_generate @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,20 +51,29 @@ -

    Functions

    +
    template<typename P1 , typename Op >
    BOOST_FORCEINLINE void static_generate (P1 &dst, Op op)
     

    Detailed Description

    Equivalent to std::generate.

    -

    Example: Set each channel of a pixel to its semantic index. The channels must be assignable from an integer.

    struct consecutive_fn {
    int& _current;
    consecutive_fn(int& start) : _current(start) {}
    int operator()() { return _current++; }
    };
    rgb8_pixel_t p;
    int start=0;
    static_generate(p, consecutive_fn(start));
    assert(p == rgb8_pixel_t(0,1,2));
    +

    Example: Set each channel of a pixel to its semantic index. The channels must be assignable from an integer.

    struct consecutive_fn {
    +
    int& _current;
    +
    consecutive_fn(int& start) : _current(start) {}
    +
    int operator()() { return _current++; }
    +
    };
    +
    rgb8_pixel_t p;
    +
    int start=0;
    +
    static_generate(p, consecutive_fn(start));
    +
    assert(p == rgb8_pixel_t(0,1,2));
    +
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_homogeneous.html b/develop/doc/html/reference/group___color_base_algorithm_homogeneous.html index bf7a084af..3ac5bb4c8 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_homogeneous.html +++ b/develop/doc/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,16 +27,16 @@

    - - + + + + +
    @@ -63,14 +63,16 @@ 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, "");
    +

    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, "");
    +
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_min_max.html b/develop/doc/html/reference/group___color_base_algorithm_min_max.html index 162c0fb2f..e153ebd44 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_min_max.html +++ b/develop/doc/html/reference/group___color_base_algorithm_min_max.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_min, static_max @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,32 +51,36 @@ - - + - - + - - + - - +

    Functions

    +
    template<typename P >
    BOOST_FORCEINLINE element_const_reference_type< P >::type static_max (const P &p)
    BOOST_FORCEINLINE element_const_reference_type< P >::type static_max (const P &p)
     
    +
    template<typename P >
    BOOST_FORCEINLINE element_reference_type< P >::type static_max (P &p)
    BOOST_FORCEINLINE element_reference_type< P >::type static_max (P &p)
     
    +
    template<typename P >
    BOOST_FORCEINLINE element_const_reference_type< P >::type static_min (const P &p)
    BOOST_FORCEINLINE element_const_reference_type< P >::type static_min (const P &p)
     
    +
    template<typename P >
    BOOST_FORCEINLINE element_reference_type< P >::type static_min (P &p)
    BOOST_FORCEINLINE element_reference_type< P >::type static_min (P &p)
     

    Detailed Description

    Equivalents to std::min_element and std::max_element for homogeneous color bases.

    -

    Example:

    rgb8_pixel_t pixel(10,20,30);
    assert(pixel[2] == 30);
    static_max(pixel) = static_min(pixel);
    assert(pixel[2] == 10);
    +

    Example:

    rgb8_pixel_t pixel(10,20,30);
    +
    assert(pixel[2] == 30);
    +
    static_max(pixel) = static_min(pixel);
    +
    assert(pixel[2] == 10);
    +
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_semantic_at_c.html b/develop/doc/html/reference/group___color_base_algorithm_semantic_at_c.html index b163530c4..29fd54345 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_semantic_at_c.html +++ b/develop/doc/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,16 +27,16 @@

    - - + + + + +
    @@ -64,28 +64,96 @@ Classes - - - - - - - + + + + + + +

    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
     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
     A constant accessor to the K-th semantic element of a color base.
    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
     A mutable accessor to the K-th semantic element of a color base. More...
     
    template<int K, typename ColorBase >
    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. More...
     

    Detailed Description

    semantic_at_c: Semantic channel accessors

    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;
    // 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;
    // Initialize the pixel to black
    bgr432_pixel_t red_pixel(0,0,0);
    // Set the red channel to 100%
    red_channel_reference_t red_channel = semantic_at_c<0>(red_pixel);
    red_channel = channel_traits<red_channel_reference_t>::max_value();
    +

    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;
    +
    +
    // 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;
    +
    +
    // Initialize the pixel to black
    +
    bgr432_pixel_t red_pixel(0,0,0);
    +
    +
    // Set the red channel to 100%
    +
    red_channel_reference_t red_channel = semantic_at_c<0>(red_pixel);
    +
    red_channel = channel_traits<red_channel_reference_t>::max_value();
    +

    Function Documentation

    + +

    ◆ semantic_at_c() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    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
    +
    +inline
    +
    + +

    A mutable accessor to the K-th semantic element of a color base.

    + +
    +
    + +

    ◆ semantic_at_c() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    auto semantic_at_c (ColorBase const & p) -> typename kth_semantic_element_const_reference_type< ColorBase, K >::type
    +
    +inline
    +
    + +

    A constant accessor to the K-th semantic element of a color base.

    + +
    +
    +
    +
    layout< rgb_t, mp11::mp_list_c< int, 2, 1, 0 > > bgr_layout_t
    Definition: rgb.hpp:40
    diff --git a/develop/doc/html/reference/group___color_base_algorithm_size.html b/develop/doc/html/reference/group___color_base_algorithm_size.html index f05ad8b52..992a48f01 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_size.html +++ b/develop/doc/html/reference/group___color_base_algorithm_size.html @@ -4,7 +4,7 @@ - + Generic Image Library: size @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -58,13 +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/develop/doc/html/reference/group___color_base_algorithm_transform.html b/develop/doc/html/reference/group___color_base_algorithm_transform.html index 627960879..06bf72772 100644 --- a/develop/doc/html/reference/group___color_base_algorithm_transform.html +++ b/develop/doc/html/reference/group___color_base_algorithm_transform.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_transform @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,40 +51,57 @@ - - - - - -

    Functions

    +
    template<typename Src , typename Dst , typename 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)
     
    +
    template<typename P2 , typename P3 , typename Dst , typename 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)
     
    +
    template<typename P2 , typename P3 , typename Dst , typename 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)
     

    Detailed Description

    Equivalent to std::transform. Pairs the elements semantically.

    -

    Example: Write a generic function that adds two pixels into a homogeneous result pixel.

    template <typename Result>
    struct my_plus {
    template <typename T1, typename T2>
    Result operator()(T1 f1, T2 f2) const { return f1+f2; }
    };
    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;
    static_transform(p1,p2,result,my_plus<result_channel_t>());
    }
    rgb8_pixel_t p1(1,2,3);
    bgr8_pixel_t p2(3,2,1);
    rgb8_pixel_t result;
    sum_channels(p1,p2,result);
    assert(result == rgb8_pixel_t(2,4,6));
    +

    Example: Write a generic function that adds two pixels into a homogeneous result pixel.

    template <typename Result>
    +
    struct my_plus {
    +
    template <typename T1, typename T2>
    +
    Result operator()(T1 f1, T2 f2) const { return f1+f2; }
    +
    };
    +
    +
    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;
    +
    static_transform(p1,p2,result,my_plus<result_channel_t>());
    +
    }
    +
    +
    rgb8_pixel_t p1(1,2,3);
    +
    bgr8_pixel_t p2(3,2,1);
    +
    rgb8_pixel_t result;
    +
    sum_channels(p1,p2,result);
    +
    assert(result == rgb8_pixel_t(2,4,6));
    +
    diff --git a/develop/doc/html/reference/group___color_base_concept.html b/develop/doc/html/reference/group___color_base_concept.html index 19fd940a9..2c391a5bd 100644 --- a/develop/doc/html/reference/group___color_base_concept.html +++ b/develop/doc/html/reference/group___color_base_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -58,7 +58,7 @@ Classes  Color base which allows for modifying its elements. More...
      struct  ColorBaseValueConcept< ColorBase > - Color base that also has a default-constructor. Refines Regular. More...
    + Color base that also has a default-constructor. Refines Regular. More...
      struct  HomogeneousColorBaseConcept< ColorBase >  Color base whose elements all have the same type. More...
    @@ -67,7 +67,7 @@ Classes  Homogeneous color base that allows for modifying its elements. More...
      struct  HomogeneousColorBaseValueConcept< ColorBase > - Homogeneous color base that also has a default constructor. Refines Regular. More...
    + Homogeneous color base that also has a default constructor. Refines Regular. More...
      struct  ColorBasesCompatibleConcept< ColorBase1, ColorBase2 >  Two color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise. More...
    @@ -81,7 +81,7 @@ Classes diff --git a/develop/doc/html/reference/group___color_base_model.html b/develop/doc/html/reference/group___color_base_model.html index 32f600265..65d20b1fd 100644 --- a/develop/doc/html/reference/group___color_base_model.html +++ b/develop/doc/html/reference/group___color_base_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -55,19 +55,19 @@ Modules  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 - A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept.
    + A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept.
       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.
    + 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 - A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept.
    + A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept.
       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.
    + 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 - 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.
    + 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.
     

    Detailed Description

    @@ -78,7 +78,7 @@ Modules diff --git a/develop/doc/html/reference/group___color_base_model_homogeneous.html b/develop/doc/html/reference/group___color_base_model_homogeneous.html index 319b446ed..0b77ef62e 100644 --- a/develop/doc/html/reference/group___color_base_model_homogeneous.html +++ b/develop/doc/html/reference/group___color_base_model_homogeneous.html @@ -4,7 +4,7 @@ - + Generic Image Library: detail::homogeneous_color_base @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -47,49 +47,104 @@
    -

    A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept. +

    A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept. More...

    - + - + - + - + - +

    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 one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
     
    struct  homogeneous_color_base< Element, Layout, 2 >
     A homogeneous color base holding two color elements Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
     A homogeneous color base holding two color elements Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
     
    struct  homogeneous_color_base< Element, Layout, 3 >
     A homogeneous color base holding three color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
     A homogeneous color base holding three color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
     
    struct  homogeneous_color_base< Element, Layout, 4 >
     A homogeneous color base holding four color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
     A homogeneous color base holding four color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
     
    struct  homogeneous_color_base< Element, Layout, 5 >
     A homogeneous color base holding five color elements. 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>
    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
     Provides mutable access to the K-th element, in physical order.
     Provides mutable access to the K-th element, in physical order. More...
     
    -template<int K, typename E , typename L , int N>
    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
     Provides constant access to the K-th element, in physical order.
     Provides constant access to the K-th element, in physical order. More...
     

    Detailed Description

    -

    A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept.

    +

    A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept.

    +

    Function Documentation

    + +

    ◆ at_c() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    auto at_c (const detail::homogeneous_color_base< E, L, N > & p) -> typename std::add_lvalue_reference< typename std::add_const< E >::type >::type
    +
    +inline
    +
    + +

    Provides constant access to the K-th element, in physical order.

    + +
    +
    + +

    ◆ at_c() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    auto at_c (detail::homogeneous_color_base< E, L, N > & p) -> typename std::add_lvalue_reference< E >::type
    +
    +inline
    +
    + +

    Provides mutable access to the K-th element, in physical order.

    + +
    +
    diff --git a/develop/doc/html/reference/group___color_base_model_non_aligned_pixel.html b/develop/doc/html/reference/group___color_base_model_non_aligned_pixel.html index 2ea29f371..31d7ddf5d 100644 --- a/develop/doc/html/reference/group___color_base_model_non_aligned_pixel.html +++ b/develop/doc/html/reference/group___color_base_model_non_aligned_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_reference @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,7 +52,7 @@

    Modules

     bit_aligned_pixel_reference - A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
    + A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
     

    Detailed Description

    @@ -63,7 +63,7 @@ Modules diff --git a/develop/doc/html/reference/group___color_base_model_packed_pixel.html b/develop/doc/html/reference/group___color_base_model_packed_pixel.html index bcbd8ece7..900088cd3 100644 --- a/develop/doc/html/reference/group___color_base_model_packed_pixel.html +++ b/develop/doc/html/reference/group___color_base_model_packed_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_pixel @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,17 +46,17 @@
    -

    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. +

    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...

    - +

    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...
     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 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.

    +

    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.

    A model of a heterogeneous pixel whose channels are bit ranges. For example 16-bit RGB in '565' format.

    @@ -64,7 +64,7 @@ Classes diff --git a/develop/doc/html/reference/group___color_base_model_pixel.html b/develop/doc/html/reference/group___color_base_model_pixel.html index be60cb2f2..6d4e03fe0 100644 --- a/develop/doc/html/reference/group___color_base_model_pixel.html +++ b/develop/doc/html/reference/group___color_base_model_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,24 +46,24 @@
    -

    A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept. +

    A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept. More...

    - +

    Classes

    struct  pixel< ChannelValue, Layout >
     Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
     Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
     

    Detailed Description

    -

    A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept.

    +

    A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept.

    diff --git a/develop/doc/html/reference/group___color_base_model_planar_ptr.html b/develop/doc/html/reference/group___color_base_model_planar_ptr.html index 36e56296d..ba00e5b81 100644 --- a/develop/doc/html/reference/group___color_base_model_planar_ptr.html +++ b/develop/doc/html/reference/group___color_base_model_planar_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_iterator @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,24 +46,24 @@
    -

    A homogeneous color base whose element is a channel iterator. Models HomogeneousColorBaseValueConcept This class is used as an iterator to a planar pixel. +

    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  planar_pixel_iterator< ChannelPtr, ColorSpace >
     An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     

    Detailed Description

    -

    A homogeneous color base whose element is a channel iterator. Models HomogeneousColorBaseValueConcept This class is used as an iterator to a planar pixel.

    +

    A homogeneous color base whose element is a channel iterator. Models HomogeneousColorBaseValueConcept This class is used as an iterator to a planar pixel.

    diff --git a/develop/doc/html/reference/group___color_base_model_planar_ref.html b/develop/doc/html/reference/group___color_base_model_planar_ref.html index badfe8785..73dc8daa5 100644 --- a/develop/doc/html/reference/group___color_base_model_planar_ref.html +++ b/develop/doc/html/reference/group___color_base_model_planar_ref.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_reference @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,7 +46,7 @@
    -

    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. +

    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...

    @@ -56,14 +56,14 @@ Classes

     

    Detailed Description

    -

    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.

    +

    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.

    diff --git a/develop/doc/html/reference/group___color_convert.html b/develop/doc/html/reference/group___color_convert.html index 3c0ca10eb..d7d9c8ff8 100644 --- a/develop/doc/html/reference/group___color_convert.html +++ b/develop/doc/html/reference/group___color_convert.html @@ -4,7 +4,7 @@ - + Generic Image Library: Color Space Converion @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -96,7 +96,7 @@ Classes diff --git a/develop/doc/html/reference/group___color_name_model.html b/develop/doc/html/reference/group___color_name_model.html index 4106ea890..2f3d1d4c7 100644 --- a/develop/doc/html/reference/group___color_name_model.html +++ b/develop/doc/html/reference/group___color_name_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Color Names @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -86,7 +86,7 @@ Classes diff --git a/develop/doc/html/reference/group___color_space_and_layout.html b/develop/doc/html/reference/group___color_space_and_layout.html index f063538ba..c43430502 100644 --- a/develop/doc/html/reference/group___color_space_and_layout.html +++ b/develop/doc/html/reference/group___color_space_and_layout.html @@ -4,7 +4,7 @@ - + Generic Image Library: Color, Color Space, and Layout @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -64,7 +64,7 @@ Modules diff --git a/develop/doc/html/reference/group___color_space_and_layout_concept.html b/develop/doc/html/reference/group___color_space_and_layout_concept.html index fa371fc37..cff1ca119 100644 --- a/develop/doc/html/reference/group___color_space_and_layout_concept.html +++ b/develop/doc/html/reference/group___color_space_and_layout_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -65,7 +65,7 @@ Classes diff --git a/develop/doc/html/reference/group___color_space_and_layout_model.html b/develop/doc/html/reference/group___color_space_and_layout_model.html index 309e0d00b..30c14d539 100644 --- a/develop/doc/html/reference/group___color_space_and_layout_model.html +++ b/develop/doc/html/reference/group___color_space_and_layout_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -69,7 +69,7 @@ Classes diff --git a/develop/doc/html/reference/group___color_space_model.html b/develop/doc/html/reference/group___color_space_model.html index 4bac6b2d4..30cd2ff27 100644 --- a/develop/doc/html/reference/group___color_space_model.html +++ b/develop/doc/html/reference/group___color_space_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Color Spaces @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -55,27 +55,80 @@ Classes - + - + - + - +

    Typedefs

    -using cmyk_t = mp11::mp_list< cyan_t, magenta_t, yellow_t, black_t >
    using cmyk_t = mp11::mp_list< cyan_t, magenta_t, yellow_t, black_t >
     
    -using gray_t = mp11::mp_list< gray_color_t >
    using gray_t = mp11::mp_list< gray_color_t >
     
    -using rgb_t = mp11::mp_list< red_t, green_t, blue_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 >
    using rgba_t = mp11::mp_list< red_t, green_t, blue_t, alpha_t >
     

    Detailed Description

    +

    Typedef Documentation

    + +

    ◆ cmyk_t

    + +
    +
    + + + + +
    using cmyk_t = mp11::mp_list<cyan_t, magenta_t, yellow_t, black_t>
    +
    + +
    +
    + +

    ◆ gray_t

    + +
    +
    + + + + +
    typedef mp11::mp_list< gray_color_t > gray_t
    +
    + +
    +
    + +

    ◆ rgb_t

    + +
    +
    + + + + +
    using rgb_t = mp11::mp_list<red_t, green_t, blue_t>
    +
    + +
    +
    + +

    ◆ rgba_t

    + +
    +
    + + + + +
    using rgba_t = mp11::mp_list<red_t, green_t, blue_t, alpha_t>
    +
    + +
    +
    diff --git a/develop/doc/html/reference/group___corner_detection_algorithms.html b/develop/doc/html/reference/group___corner_detection_algorithms.html index 32e5e3093..0ae0450f7 100644 --- a/develop/doc/html/reference/group___corner_detection_algorithms.html +++ b/develop/doc/html/reference/group___corner_detection_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: CornerDetectionAlgorithms @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,22 +51,77 @@ - + - +

    Functions

    -template<typename T , typename Allocator >
    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 responsesThis algorithm computes Harris responses for structure tensor represented by m11, m12_21, m22 views. Note that m12_21 represents both entries (1, 2) and (2, 1). Window length represents size of a window which is slided around to compute sum of corresponding entries. k is a discrimination constant against edges (usually in range 0.04 to 0.06). harris_response is an out parameter that will contain the Harris responses.
     function to record Harris responses More...
     

    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()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::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

    +

    This algorithm computes Harris responses for structure tensor represented by m11, m12_21, m22 views. Note that m12_21 represents both entries (1, 2) and (2, 1). Window length represents size of a window which is slided around to compute sum of corresponding entries. k is a discrimination constant against edges (usually in range 0.04 to 0.06). harris_response is an out parameter that will contain the Harris responses.

    + +
    +
    diff --git a/develop/doc/html/reference/group___down_scaling_algorithms.html b/develop/doc/html/reference/group___down_scaling_algorithms.html index 0ff20a589..88a3faec8 100644 --- a/develop/doc/html/reference/group___down_scaling_algorithms.html +++ b/develop/doc/html/reference/group___down_scaling_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: DownScalingAlgorithms @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,10 +51,9 @@ - + - +

    Functions

    -template<typename ImageView >
    template<typename ImageView >
    void scale_lanczos (ImageView input_view, ImageView output_view, std::ptrdiff_t a)
     Complete Lanczos algorithmThis algorithm does full pass over resulting image and convolves pixels from original image. Do note that it might be a good idea to have a look at test output as there might be ringing artifacts. Based on wikipedia article: https://en.wikipedia.org/wiki/Lanczos_resampling with standardinzed cardinal sin (sinc)
     Complete Lanczos algorithm. More...
     

    Detailed Description

    @@ -62,13 +61,51 @@ template<typename ImageView >

    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()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::scale_lanczos (ImageView input_view,
    ImageView output_view,
    std::ptrdiff_t a 
    )
    +
    + +

    Complete Lanczos algorithm.

    +

    This algorithm does full pass over resulting image and convolves pixels from original image. Do note that it might be a good idea to have a look at test output as there might be ringing artifacts. Based on wikipedia article: https://en.wikipedia.org/wiki/Lanczos_resampling with standardinzed cardinal sin (sinc)

    + +
    +
    diff --git a/develop/doc/html/reference/group___g_i_l_is_basic.html b/develop/doc/html/reference/group___g_i_l_is_basic.html index 3a325fb19..1946885df 100644 --- a/develop/doc/html/reference/group___g_i_l_is_basic.html +++ b/develop/doc/html/reference/group___g_i_l_is_basic.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_is_basic @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,10 +52,10 @@

    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...
    + 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...
      struct  iterator_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. More...
    + 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. More...
      struct  locator_is_basic< Loc >  Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator. More...
    @@ -76,7 +76,7 @@ Classes diff --git a/develop/doc/html/reference/group___g_i_l_is_mutable.html b/develop/doc/html/reference/group___g_i_l_is_mutable.html index 95899a7d3..1ef0a4aa6 100644 --- a/develop/doc/html/reference/group___g_i_l_is_mutable.html +++ b/develop/doc/html/reference/group___g_i_l_is_mutable.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_is_mutable @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -61,7 +61,7 @@ Classes  Determines if the given view is mutable (i.e. its pixels can be changed) More...
      struct  iterator_is_mutable< It >Metafunction predicate returning whether the given iterator allows for changing its values. More...
    Metafunction predicate returning whether the given iterator allows for changing its values. More...
     

    Detailed Description

    @@ -72,7 +72,7 @@ Classes diff --git a/develop/doc/html/reference/group___g_i_l_is_step.html b/develop/doc/html/reference/group___g_i_l_is_step.html index f56341558..b1fa3fb5d 100644 --- a/develop/doc/html/reference/group___g_i_l_is_step.html +++ b/develop/doc/html/reference/group___g_i_l_is_step.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_is_step @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -75,7 +75,7 @@ Classes diff --git a/develop/doc/html/reference/group___h_e.html b/develop/doc/html/reference/group___h_e.html new file mode 100644 index 000000000..55e8e9bbb --- /dev/null +++ b/develop/doc/html/reference/group___h_e.html @@ -0,0 +1,62 @@ + + + + + + + + + Generic Image Library: HE + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + +
    +
    +
    +
    HE
    +
    +
    + +

    Histogram Equalization(HE) +More...

    +

    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].

    +
    + + + + + + diff --git a/develop/doc/html/reference/group___h_m.html b/develop/doc/html/reference/group___h_m.html new file mode 100644 index 000000000..109b05e05 --- /dev/null +++ b/develop/doc/html/reference/group___h_m.html @@ -0,0 +1,62 @@ + + + + + + + + + Generic Image Library: HM + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + +
    +
    +
    +
    HM
    +
    +
    + +

    Histogram Matching(HM) +More...

    +

    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))

    +
    + + + + + + diff --git a/develop/doc/html/reference/group___histogram-_helpers.html b/develop/doc/html/reference/group___histogram-_helpers.html new file mode 100644 index 000000000..df3cc4e25 --- /dev/null +++ b/develop/doc/html/reference/group___histogram-_helpers.html @@ -0,0 +1,163 @@ + + + + + + + + + Generic Image Library: Histogram-Helpers + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + +
    +
    + +
    +
    Histogram-Helpers
    +
    +
    + +

    Helper implementations supporting the histogram class. +More...

    + + + + + + + + + + + + + + +

    +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...
     
    struct  tuple_limit< Tuple >
     Provides equivalent of std::numeric_limits for type std::tuple tuple_limit gets called with only tuples having integral elements. More...
     
    struct  filler< 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. More...
     
    struct  filler< 1 >
     Specialisation for 1D histogram. More...
     
    + + + + + + + + + + + + + + + + + +

    +Functions

    +template<std::size_t Index, typename... T>
    std::enable_if< Index==sizeof...(T), void >::type hash_tuple_impl (std::size_t &, std::tuple< T... > const &)
     
    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... >)
     
    +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.
     
    +

    Detailed Description

    +

    Helper implementations supporting the histogram class.

    +

    Function Documentation

    + +

    ◆ pixel_to_tuple()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    auto boost::gil::detail::pixel_to_tuple (Pixel const & p,
    boost::mp11::index_sequence< I... >  
    ) -> decltype(std::make_tuple(p[I]...)) +
    +
    +
    Todo:
    With C++14 and using auto we don't need the decltype anymore
    + +
    +
    + +

    ◆ tuple_to_tuple()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    auto boost::gil::detail::tuple_to_tuple (Tuple const & t,
    boost::mp11::index_sequence< I... >  
    ) -> decltype(std::make_tuple(std::get<I>(t)...)) +
    +
    +
    Todo:
    With C++14 and using auto we don't need the decltype anymore
    + +
    +
    +
    + + + + + + diff --git a/develop/doc/html/reference/group___histogram.html b/develop/doc/html/reference/group___histogram.html new file mode 100644 index 000000000..a959c5fe3 --- /dev/null +++ b/develop/doc/html/reference/group___histogram.html @@ -0,0 +1,71 @@ + + + + + + + + + Generic Image Library: Histogram + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + +
    +
    + +
    +
    Histogram
    +
    +
    + +

    Histogram. +More...

    + + + + + +

    +Classes

    class  histogram< T >
     Default histogram class provided by boost::gil. More...
     
    +

    Detailed Description

    +

    Histogram.

    +

    Contains description of the boost.gil.histogram class, extensions provided in place of the default class, algorithms over the histogram class (both extensions and the default class)

    +
    + + + + + + diff --git a/develop/doc/html/reference/group___hough_transform.html b/develop/doc/html/reference/group___hough_transform.html new file mode 100644 index 000000000..1b55f79a6 --- /dev/null +++ b/develop/doc/html/reference/group___hough_transform.html @@ -0,0 +1,358 @@ + + + + + + + + + Generic Image Library: HoughTransform + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + +
    +
    + +
    +
    HoughTransform
    +
    +
    + +

    A family of shape detectors that are specified by equation. +More...

    + + + + + +

    +Classes

    struct  hough_parameter< T >
     A type to encapsulate Hough transform parameter range. More...
     
    + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    static hough_parameter< T > from_step_count (T start_point, T neighborhood, std::size_t half_step_count)
     Create Hough parameter from value neighborhood and step count. More...
     
    static hough_parameter< T > from_step_size (T start_point, T neighborhood, T step_size)
     Create Hough parameter from value neighborhood and step size. More...
     
    double minimum_angle_step (point_t dimensions)
     Calculate minimum angle which would be observable if walked on a circle. More...
     
    hough_parameter< double > make_theta_parameter (double approx_angle, double neighborhood, point_t dimensions)
     Create a Hough transform parameter with optimal angle step. More...
     
    template<typename InputView , typename OutputView >
    void hough_line_transform (const InputView &input_view, const OutputView &accumulator_array, const hough_parameter< double > &theta, const hough_parameter< std::ptrdiff_t > &radius)
     Vote for best fit of a line in parameter space. More...
     
    template<typename ImageView , typename ForwardIterator , typename Rasterizer >
    void hough_circle_transform_brute (const ImageView &input, const hough_parameter< std::ptrdiff_t > radius_parameter, const hough_parameter< std::ptrdiff_t > x_parameter, const hough_parameter< std::ptrdiff_t > &y_parameter, ForwardIterator d_first, Rasterizer rasterizer)
     Vote for best fit of a circle in parameter space according to rasterizer. More...
     
    +

    Detailed Description

    +

    A family of shape detectors that are specified by equation.

    +

    Hough transform is a method of mapping (voting) an object which can be described by equation to single point in accumulator array (also called parameter space). Each set pixel in edge map votes for every shape it can be part of. Circle and ellipse transforms are very costly to brute force, while non-brute-forcing algorithms tend to gamble on probabilities.

    +

    Function Documentation

    + +

    ◆ from_step_count()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static hough_parameter<T> from_step_count (start_point,
    neighborhood,
    std::size_t half_step_count 
    )
    +
    +inlinestatic
    +
    + +

    Create Hough parameter from value neighborhood and step count.

    +

    This function will take start_point as middle point, and in both directions will try to walk half_step_count times until distance of neighborhood is reached

    + +
    +
    + +

    ◆ from_step_size()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static hough_parameter<T> from_step_size (start_point,
    neighborhood,
    step_size 
    )
    +
    +inlinestatic
    +
    + +

    Create Hough parameter from value neighborhood and step size.

    +

    This function will take start_point as middle point, and in both directions will try to walk step_size at a time until distance of neighborhood is reached

    + +
    +
    + +

    ◆ hough_circle_transform_brute()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::hough_circle_transform_brute (const ImageView & input,
    const hough_parameter< std::ptrdiff_t > radius_parameter,
    const hough_parameter< std::ptrdiff_t > x_parameter,
    const hough_parameter< std::ptrdiff_t > & y_parameter,
    ForwardIterator d_first,
    Rasterizer rasterizer 
    )
    +
    + +

    Vote for best fit of a circle in parameter space according to rasterizer.

    +

    The input must be an edge map with grayscale pixels. Be aware of overflow inside accumulator array. Rasterizer is used to rasterize a circle for voting. The circle then is translated for every origin (x, y) in x y parameter space. For available circle rasterizers, please look at rasterization/circle.hpp

    + +
    +
    + +

    ◆ hough_line_transform()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::hough_line_transform (const InputView & input_view,
    const OutputView & accumulator_array,
    const hough_parameter< double > & theta,
    const hough_parameter< std::ptrdiff_t > & radius 
    )
    +
    + +

    Vote for best fit of a line in parameter space.

    +

    The input must be an edge map with grayscale pixels. Be aware of overflow inside accumulator array. The theta parameter is best computed through factory function provided in hough_parameter.hpp

    + +
    +
    + +

    ◆ make_theta_parameter()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    hough_parameter<double> boost::gil::make_theta_parameter (double approx_angle,
    double neighborhood,
    point_t dimensions 
    )
    +
    +inline
    +
    + +

    Create a Hough transform parameter with optimal angle step.

    +

    Due to computational intensity and noise sensitivity of Hough transform, having any candidates missed or computed again is problematic. This function will properly encapsulate optimal value range around approx_angle with amplitude of neighborhood in each direction. WARNING: do keep in mind IEEE 754 quirks, e.g. no-associativity, no-commutativity and precision. Do not expect expressions that are mathematically the same to produce the same values

    + +
    +
    + +

    ◆ minimum_angle_step()

    + +
    +
    + + + + + +
    + + + + + + + + +
    double boost::gil::minimum_angle_step (point_t dimensions)
    +
    +inline
    +
    + +

    Calculate minimum angle which would be observable if walked on a circle.

    +

    When drawing a circle or moving around a point in circular motion, it is important to not do too many steps, but also to not have disconnected trajectory. This function will calculate the minimum angle that is observable when walking on a circle or tilting a line. WARNING: do keep in mind IEEE 754 quirks, e.g. no-associativity, no-commutativity and precision. Do not expect expressions that are mathematically the same to produce the same values

    + +
    +
    +
    + + + + + + diff --git a/develop/doc/html/reference/group___i_o.html b/develop/doc/html/reference/group___i_o.html index 0b5693c4c..83a3293a5 100644 --- a/develop/doc/html/reference/group___i_o.html +++ b/develop/doc/html/reference/group___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: I/O @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -73,46 +73,42 @@ Functions  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) +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 +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) +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 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) +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)   - -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) +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)   - -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) +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)   - -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) +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)   - -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) +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)   - -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) +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)  

    Detailed Description

    Support for reading and writing images to file.

    Function Documentation

    - + +

    ◆ read_and_convert_image()

    +
    @@ -169,7 +165,9 @@ template<typename Device , typename... Views, typename FormatTag , typename L - + +

    ◆ read_and_convert_view()

    +
    @@ -226,7 +224,9 @@ template<typename Device , typename... Views, typename FormatTag , typename L - + +

    ◆ read_image()

    +
    @@ -281,7 +281,9 @@ template<typename Device , typename... Views, typename FormatTag , typename L - + +

    ◆ read_image_info()

    +
    @@ -338,7 +340,9 @@ template<typename Device , typename... Views, typename FormatTag , typename L - + +

    ◆ read_view()

    +
    @@ -392,6 +396,288 @@ template<typename Device , typename... Views, typename FormatTag , typename L + + + +

    ◆ write_view() [1/6]

    + +
    +
    +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::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 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ write_view() [2/6]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::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 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ write_view() [3/6]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::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 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ write_view() [4/6]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::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 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ write_view() [5/6]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::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 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ write_view() [6/6]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::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 
    )
    +
    +inline
    +
    +
    @@ -400,7 +686,7 @@ template<typename Device , typename... Views, typename FormatTag , typename L diff --git a/develop/doc/html/reference/group___image.html b/develop/doc/html/reference/group___image.html index 649dce51b..7ab192403 100644 --- a/develop/doc/html/reference/group___image.html +++ b/develop/doc/html/reference/group___image.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -70,7 +70,7 @@ Modules diff --git a/develop/doc/html/reference/group___image_concept.html b/develop/doc/html/reference/group___image_concept.html index 4e19b337d..14e158d89 100644 --- a/develop/doc/html/reference/group___image_concept.html +++ b/develop/doc/html/reference/group___image_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -58,7 +58,7 @@ Classes  2-dimensional container of values More...
      struct  ImageConcept< Image > - 2-dimensional image whose value type models PixelValueConcept More...
    + 2-dimensional image whose value type models PixelValueConcept More...
     

    Detailed Description

    @@ -69,7 +69,7 @@ Classes diff --git a/develop/doc/html/reference/group___image_model.html b/develop/doc/html/reference/group___image_model.html index 464fcb46d..2cbc24322 100644 --- a/develop/doc/html/reference/group___image_model.html +++ b/develop/doc/html/reference/group___image_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,39 +52,41 @@

    Classes

    class  image< Pixel, IsPlanar, Alloc > - container interface over image view. Models ImageConcept, PixelBasedConcept More...
    + container interface over image view. Models ImageConcept, PixelBasedConcept More...
      class  any_image< Images > - Represents a run-time specified image. Note it does NOT model ImageConcept. More...
    + Represents a run-time specified image. Note it does NOT model ImageConcept. More...
      - - + - - + + - - + + - - +

    view, const_view

    Get an image view from a run-time instantiated image

    +
    template<typename Pixel , bool IsPlanar, typename Alloc >
    const image< Pixel, IsPlanar, Alloc >::view_t & view (image< Pixel, IsPlanar, Alloc > &img)
    const image< Pixel, IsPlanar, Alloc >::view_t & view (image< Pixel, IsPlanar, Alloc > &img)
     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
    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
    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...
     
    +
    template<typename Pixel , bool IsPlanar, typename Alloc >
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view (const image< Pixel, IsPlanar, Alloc > &img)
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view (const image< Pixel, IsPlanar, Alloc > &img)
     Returns the constant-pixel view of an image.
     

    Detailed Description

    Image models.

    Function Documentation

    - + +

    ◆ const_view()

    +
    @@ -109,7 +111,9 @@ template<typename Pixel , bool IsPlanar, typename Alloc > - + +

    ◆ view()

    +
    @@ -140,7 +144,7 @@ template<typename Pixel , bool IsPlanar, typename Alloc > diff --git a/develop/doc/html/reference/group___image_processing.html b/develop/doc/html/reference/group___image_processing.html index 9108aa0fa..775b805b8 100644 --- a/develop/doc/html/reference/group___image_processing.html +++ b/develop/doc/html/reference/group___image_processing.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image Processing @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -57,46 +57,62 @@ Enumerations }
    - + } + - + } + -
     
    enum  threshold_optimal_value { otsu - }
     Method of optimal threshold value calculation. More...
     Method of optimal threshold value calculation. More...
     
    enum  threshold_truncate_mode { threshold, zero - }
     TODO. More...
     TODO. More...
     
    enum  threshold_adaptive_method { mean, +
    enum  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)
    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 >
    void threshold_binary (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, threshold_direction direction=threshold_direction::regular)
    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)
    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.
     
    +
    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

    @@ -104,7 +120,9 @@ template<typename SrcView , typename DstView >

    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

    +
    @@ -112,7 +130,7 @@ template<typename SrcView , typename DstView > @@ -122,17 +140,17 @@ template<typename SrcView , typename DstView >
    - +
    enum threshold_directionenum 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

    +
    @@ -140,7 +158,7 @@ template<typename SrcView , typename DstView > @@ -152,14 +170,15 @@ template<typename SrcView , typename DstView >

    Method of optimal threshold value calculation.

    - +
    enum threshold_optimal_valueenum threshold_optimal_value
    -
    Enumerator
    otsu  -
    Todo:
    TODO
    +
    Enumerator
    otsu 
    Todo:
    TODO
    - + +

    ◆ threshold_truncate_mode

    +
    @@ -167,7 +186,7 @@ template<typename SrcView , typename DstView > @@ -179,18 +198,238 @@ template<typename SrcView , typename DstView >

    TODO.

    - +
    enum threshold_truncate_modeenum threshold_truncate_mode
    - -
    Enumerator
    threshold  -
    Todo:
    TODO
    +
    Enumerator
    threshold 
    Todo:
    TODO
    zero  -
    Todo:
    TODO
    +
    zero 
    Todo:
    TODO

    Function Documentation

    - + +

    ◆ difference()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::detail::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.

    +
    Parameters
    + + + + +
    src_view1- First parameter for subtraction of views.
    src_view2- Second parameter for subtraction of views.
    diff_view- View containing result of the subtraction of second view from the first view.
    +
    +
    +
    Template Parameters
    + + + +
    SrcViewtype of source/Input images used for subtraction.
    DiffViewtype of image view containing the result of subtraction.
    +
    +
    + +
    +
    + +

    ◆ difference_impl()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::detail::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.

    +
    Parameters
    + + + + +
    src_view1- First parameter for subtraction of views.
    src_view2- Second parameter for subtraction of views.
    diff_view- View containing result of the subtraction of second view from the first view.
    +
    +
    +
    Template Parameters
    + + + +
    SrcViewtype of source/Input images used for subtraction.
    DiffViewtype of image view containing the result of subtraction.
    +
    +
    + +
    +
    + +

    ◆ morph()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::detail::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.

    +
    Parameters
    + + + + + +
    src_view- Source/Input image view.
    dst_view- View which stores the final result of operations performed by this function.
    kernel- Kernel matrix/structuring element containing 0's and 1's which will be used for applying the required morphological operation.
    identifier- Indicates the type of morphological operation to be applied.
    +
    +
    +
    Template Parameters
    + + + + +
    SrcViewtype of source image.
    DstViewtype of output image.
    Kerneltype of structuring element.
    +
    +
    + +
    +
    + +

    ◆ morph_impl()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::detail::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.

    +
    Parameters
    + + + + + +
    src_view- Source/Input image view.
    dst_view- View which stores the final result of operations performed by this function.
    kernel- Kernel matrix/structuring element containing 0's and 1's which will be used for applying the required morphological operation.
    identifier- Indicates the type of morphological operation to be applied.
    +
    +
    +
    Template Parameters
    + + + + +
    SrcViewtype of source image.
    DstViewtype of output image.
    Kerneltype of structuring element.
    +
    +
    + +
    +
    + +

    ◆ threshold_binary()

    +
    @@ -252,7 +491,7 @@ template<typename SrcView , typename DstView > diff --git a/develop/doc/html/reference/group___image_processing_math.html b/develop/doc/html/reference/group___image_processing_math.html index 45ba150ac..2bb4e7639 100644 --- a/develop/doc/html/reference/group___image_processing_math.html +++ b/develop/doc/html/reference/group___image_processing_math.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageProcessingMath @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,48 +51,40 @@
    - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +

    Functions

    -double lanczos (double x, std::ptrdiff_t a)
     Lanczos response at point xLanczos response is defined as: x == 0: 1 -a < x && x < a: 0 otherwise: normalized_sinc(x) / normalized_sinc(x / a)
    double lanczos (double x, std::ptrdiff_t a)
     Lanczos response at point x. More...
     
    template<typename T = float, typename Allocator = std::allocator<T>>
    detail::kernel_2d< T, Allocator > generate_normalized_mean (std::size_t side_length)
     Generate mean kernelFills supplied view with normalized mean in which all entries will be equal to. More...
     Generate mean kernel. More...
     
    -template<typename T = float, typename Allocator = std::allocator<T>>
    template<typename T = float, typename Allocator = std::allocator<T>>
    detail::kernel_2d< T, Allocator > generate_unnormalized_mean (std::size_t side_length)
     Generate kernel with all 1sFills supplied view with 1s (ones)
     Generate kernel with all 1s. More...
     
    -template<typename T = float, typename Allocator = std::allocator<T>>
    template<typename T = float, typename Allocator = std::allocator<T>>
    detail::kernel_2d< T, Allocator > generate_gaussian_kernel (std::size_t side_length, double sigma)
     Generate Gaussian kernelFills supplied view with values taken from Gaussian distribution. See https://en.wikipedia.org/wiki/Gaussian_blur.
     Generate Gaussian kernel. More...
     
    -template<typename T = float, typename Allocator = std::allocator<T>>
    template<typename T = float, typename Allocator = std::allocator<T>>
    detail::kernel_2d< T, Allocator > generate_dx_sobel (unsigned int degree=1)
     Generates Sobel operator in horizontal directionGenerates a kernel which will represent Sobel operator in horizontal direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/publication/239398674_An_Isotropic_3_3_Image_Gradient_Operator.
     Generates Sobel operator in horizontal direction. More...
     
    -template<typename T = float, typename Allocator = std::allocator<T>>
    template<typename T = float, typename Allocator = std::allocator<T>>
    detail::kernel_2d< T, Allocator > generate_dx_scharr (unsigned int degree=1)
     Generate Scharr operator in horizontal directionGenerates a kernel which will represent Scharr operator in horizontal direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/profile/Hanno_Scharr/publication/220955743_Optimal_Filters_for_Extended_Optical_Flow/links/004635151972eda98f000000/Optimal-Filters-for-Extended-Optical-Flow.pdf.
     Generate Scharr operator in horizontal direction. More...
     
    -template<typename T = float, typename Allocator = std::allocator<T>>
    template<typename T = float, typename Allocator = std::allocator<T>>
    detail::kernel_2d< T, Allocator > generate_dy_sobel (unsigned int degree=1)
     Generates Sobel operator in vertical directionGenerates a kernel which will represent Sobel operator in vertical direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/publication/239398674_An_Isotropic_3_3_Image_Gradient_Operator.
     Generates Sobel operator in vertical direction. More...
     
    -template<typename T = float, typename Allocator = std::allocator<T>>
    template<typename T = float, typename Allocator = std::allocator<T>>
    detail::kernel_2d< T, Allocator > generate_dy_scharr (unsigned int degree=1)
     Generate Scharr operator in vertical directionGenerates a kernel which will represent Scharr operator in vertical direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/profile/Hanno_Scharr/publication/220955743_Optimal_Filters_for_Extended_Optical_Flow/links/004635151972eda98f000000/Optimal-Filters-for-Extended-Optical-Flow.pdf.
     Generate Scharr operator in vertical direction. More...
     
    -template<typename GradientView , typename OutputView >
    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 gradientsHessian matrix is defined as a matrix of partial derivates for 2d case, it is [[ddxx, dxdy], [dxdy, ddyy]. d stands for derivative, and x or y stand for direction. For example, dx stands for derivative (gradient) in horizontal direction, and ddxx means second order derivative in horizon direction https://en.wikipedia.org/wiki/Hessian_matrix.
     Compute xy gradient, and second order x and y gradients. More...
     

    Detailed Description

    @@ -101,7 +93,221 @@ template<typename GradientView , typename OutputView >

    Normalized cardinal sine

    normalized_sinc(x) = sin(pi * x) / (pi * x)

    Function Documentation

    - + +

    ◆ compute_hessian_entries()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::compute_hessian_entries (GradientView dx,
    GradientView dy,
    OutputView ddxx,
    OutputView dxdy,
    OutputView ddyy 
    )
    +
    +inline
    +
    + +

    Compute xy gradient, and second order x and y gradients.

    +

    Hessian matrix is defined as a matrix of partial derivates for 2d case, it is [[ddxx, dxdy], [dxdy, ddyy]. d stands for derivative, and x or y stand for direction. For example, dx stands for derivative (gradient) in horizontal direction, and ddxx means second order derivative in horizon direction https://en.wikipedia.org/wiki/Hessian_matrix

    + +
    +
    + +

    ◆ generate_dx_scharr()

    + +
    +
    + + + + + +
    + + + + + + + + +
    detail::kernel_2d<T, Allocator> boost::gil::generate_dx_scharr (unsigned int degree = 1)
    +
    +inline
    +
    + +

    Generate Scharr operator in horizontal direction.

    +

    Generates a kernel which will represent Scharr operator in horizontal direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/profile/Hanno_Scharr/publication/220955743_Optimal_Filters_for_Extended_Optical_Flow/links/004635151972eda98f000000/Optimal-Filters-for-Extended-Optical-Flow.pdf

    + +
    +
    + +

    ◆ generate_dx_sobel()

    + +
    +
    + + + + + +
    + + + + + + + + +
    detail::kernel_2d<T, Allocator> boost::gil::generate_dx_sobel (unsigned int degree = 1)
    +
    +inline
    +
    + +

    Generates Sobel operator in horizontal direction.

    +

    Generates a kernel which will represent Sobel operator in horizontal direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/publication/239398674_An_Isotropic_3_3_Image_Gradient_Operator

    + +
    +
    + +

    ◆ generate_dy_scharr()

    + +
    +
    + + + + + +
    + + + + + + + + +
    detail::kernel_2d<T, Allocator> boost::gil::generate_dy_scharr (unsigned int degree = 1)
    +
    +inline
    +
    + +

    Generate Scharr operator in vertical direction.

    +

    Generates a kernel which will represent Scharr operator in vertical direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/profile/Hanno_Scharr/publication/220955743_Optimal_Filters_for_Extended_Optical_Flow/links/004635151972eda98f000000/Optimal-Filters-for-Extended-Optical-Flow.pdf

    + +
    +
    + +

    ◆ generate_dy_sobel()

    + +
    +
    + + + + + +
    + + + + + + + + +
    detail::kernel_2d<T, Allocator> boost::gil::generate_dy_sobel (unsigned int degree = 1)
    +
    +inline
    +
    + +

    Generates Sobel operator in vertical direction.

    +

    Generates a kernel which will represent Sobel operator in vertical direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/publication/239398674_An_Isotropic_3_3_Image_Gradient_Operator

    + +
    +
    + +

    ◆ generate_gaussian_kernel()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    detail::kernel_2d<T, Allocator> boost::gil::generate_gaussian_kernel (std::size_t side_length,
    double sigma 
    )
    +
    +inline
    +
    + +

    Generate Gaussian kernel.

    +

    Fills supplied view with values taken from Gaussian distribution. See https://en.wikipedia.org/wiki/Gaussian_blur

    + +
    +
    + +

    ◆ generate_normalized_mean()

    +
    @@ -123,8 +329,77 @@ template<typename GradientView , typename OutputView >
    -

    Generate mean kernelFills supplied view with normalized mean in which all entries will be equal to.

    -
    1 / (dst.size())
    +

    Generate mean kernel.

    +

    Fills supplied view with normalized mean in which all entries will be equal to

    1 / (dst.size())
    +
    +
    +
    + +

    ◆ generate_unnormalized_mean()

    + +
    +
    + + + + + +
    + + + + + + + + +
    detail::kernel_2d<T, Allocator> boost::gil::generate_unnormalized_mean (std::size_t side_length)
    +
    +inline
    +
    + +

    Generate kernel with all 1s.

    +

    Fills supplied view with 1s (ones)

    + +
    +
    + +

    ◆ lanczos()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    double boost::gil::lanczos (double x,
    std::ptrdiff_t a 
    )
    +
    +inline
    +
    + +

    Lanczos response at point x.

    +

    Lanczos response is defined as: x == 0: 1 -a < x && x < a: 0 otherwise: normalized_sinc(x) / normalized_sinc(x / a)

    +
    @@ -133,7 +408,7 @@ template<typename GradientView , typename OutputView > diff --git a/develop/doc/html/reference/group___image_view.html b/develop/doc/html/reference/group___image_view.html index b3d2d9503..00c156293 100644 --- a/develop/doc/html/reference/group___image_view.html +++ b/develop/doc/html/reference/group___image_view.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image View @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -69,7 +69,7 @@ Modules diff --git a/develop/doc/html/reference/group___image_view2_d_concept.html b/develop/doc/html/reference/group___image_view2_d_concept.html index fccfd1ba3..28fcc9a9d 100644 --- a/develop/doc/html/reference/group___image_view2_d_concept.html +++ b/develop/doc/html/reference/group___image_view2_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageView2DLocatorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___image_view_algorithm.html b/develop/doc/html/reference/group___image_view_algorithm.html index 3d8327276..0d3992f0f 100644 --- a/develop/doc/html/reference/group___image_view_algorithm.html +++ b/develop/doc/html/reference/group___image_view_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -72,7 +72,7 @@ Modules diff --git a/develop/doc/html/reference/group___image_view_concept.html b/develop/doc/html/reference/group___image_view_concept.html index fac10a180..f916dc6d0 100644 --- a/develop/doc/html/reference/group___image_view_concept.html +++ b/develop/doc/html/reference/group___image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -76,7 +76,7 @@ Classes diff --git a/develop/doc/html/reference/group___image_view_constructors.html b/develop/doc/html/reference/group___image_view_constructors.html index fc5c54db8..578dfc564 100644 --- a/develop/doc/html/reference/group___image_view_constructors.html +++ b/develop/doc/html/reference/group___image_view_constructors.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image View From Raw Data @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,59 +51,59 @@ - - + - - + - - + - - + - - + - - + - - + - - - - + - - +

    Functions

    +
    template<typename IC >
    type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t > >::view_t 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)
    type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t > >::view_t 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)
     from raw CMYK planar data
     
    +
    template<typename IC >
    type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 2 > > >::view_t planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes)
    type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 2 > > >::view_t planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes)
     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
    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
    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
    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 >
    type_from_x_iterator< Iterator >::view_t interleaved_view (std::size_t width, std::size_t height, Iterator pixels, std::ptrdiff_t rowsize_in_bytes)
    type_from_x_iterator< Iterator >::view_t interleaved_view (std::size_t width, std::size_t height, Iterator pixels, std::ptrdiff_t rowsize_in_bytes)
     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
    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 >
    detail::channel_pointer_type< HomogeneousView >::type interleaved_view_get_raw_data (const HomogeneousView &view)
     Returns C pointer to the the channels of an interleaved homogeneous view.
     
    +
    template<typename HomogeneousView >
    detail::channel_pointer_type< HomogeneousView >::type planar_view_get_raw_data (const HomogeneousView &view, int plane_index)
     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
    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
    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
     
    @@ -116,7 +116,7 @@ template<typename ChannelPtr > diff --git a/develop/doc/html/reference/group___image_view_model.html b/develop/doc/html/reference/group___image_view_model.html index bce91567a..234911bd9 100644 --- a/develop/doc/html/reference/group___image_view_model.html +++ b/develop/doc/html/reference/group___image_view_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,10 +52,10 @@

    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...
    + Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, Note that this class does NOT model ImageViewConcept. More...
      class  image_view< Loc > - A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...
    + A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...
     

    Detailed Description

    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___image_view_n_d_concept.html b/develop/doc/html/reference/group___image_view_n_d_concept.html index a2c45b030..ac8701ba7 100644 --- a/develop/doc/html/reference/group___image_view_n_d_concept.html +++ b/develop/doc/html/reference/group___image_view_n_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageViewNDLocatorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms.html index 9d4955638..76648364f 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: STL-like Algorithms @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -95,7 +95,7 @@ Modules

    Classes

    struct  binary_operation_obj< Derived, Result > - A generic binary operation on viewsUse 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. More...
    + A generic binary operation on views. More...
     

    Detailed Description

    @@ -111,7 +111,7 @@ Classes diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_copy_and_convert_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_copy_and_convert_pixels.html index f1f8abc79..9213ed080 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_copy_and_convert_pixels.html +++ b/develop/doc/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,16 +27,16 @@

    - - + + + + +
    @@ -51,38 +51,73 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +

    Functions

    -template<typename V1 , typename V2 , typename CC >
    BOOST_FORCEINLINE void copy_and_convert_pixels (const V1 &src, const V2 &dst, CC cc)
    template<typename V1 , typename V2 , typename 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 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 , 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 ... 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, 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 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, 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 ... 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/8]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void boost::gil::copy_and_convert_pixels (any_image_view< Types... > const & src,
    View const & dst 
    )
    +
    +
    Template Parameters
    + + + +
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    +
    +
    + +
    +
    + +

    ◆ copy_and_convert_pixels() [2/8]

    +
    @@ -113,8 +148,8 @@ template<typename View1 , typename View2 >
    Template Parameters
    - - + +
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    CCModel ColorConverterConcept
    @@ -122,20 +157,22 @@ template<typename View1 , typename View2 >
    - + +

    ◆ copy_and_convert_pixels() [3/8]

    +
    - + - + @@ -147,88 +184,17 @@ template<typename View1 , typename View2 >
    Template Parameters
    void boost::gil::copy_and_convert_pixels (any_image_view< Types... > const & any_image_view< Types1... > const &  src,
    View const & any_image_view< Types2... > const &  dst 
    - - + +
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void boost::gil::copy_and_convert_pixels (View const & src,
    any_image_view< Types... > const & dst,
    CC cc 
    )
    -
    -
    Template Parameters
    - - - - -
    ViewModel ImageViewConcept
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    CCModel ColorConverterConcept
    -
    -
    + +

    ◆ copy_and_convert_pixels() [4/8]

    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void boost::gil::copy_and_convert_pixels (View const & src,
    any_image_view< Types... > const & dst 
    )
    -
    -
    Template Parameters
    - - - -
    ViewModel ImageViewConcept
    TypeModel Boost.MP11-compatible list of models of MutableImageViewConcept
    -
    -
    - -
    -
    -
    @@ -259,8 +225,8 @@ template<typename View1 , typename View2 >
    Template Parameters
    - - + +
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    CCModel ColorConverterConcept
    @@ -268,20 +234,84 @@ template<typename View1 , typename View2 >
    - + +

    ◆ copy_and_convert_pixels() [5/8]

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE void boost::gil::copy_and_convert_pixels (const V1 & src,
    const V2 & dst,
    CC cc 
    )
    +
    + +
    +
    + +

    ◆ copy_and_convert_pixels() [6/8]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE void boost::gil::copy_and_convert_pixels (const View1 & src,
    const View2 & dst 
    )
    +
    + +
    +
    + +

    ◆ copy_and_convert_pixels() [7/8]

    +
    - + - + @@ -293,8 +323,50 @@ template<typename View1 , typename View2 >
    Template Parameters
    void boost::gil::copy_and_convert_pixels (any_image_view< Types1... > const & View const &  src,
    any_image_view< Types2... > const & any_image_view< Types... > const &  dst 
    - - + + +
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    ViewModel ImageViewConcept
    TypeModel Boost.MP11-compatible list of models of MutableImageViewConcept
    + + + +
    +
    + +

    ◆ copy_and_convert_pixels() [8/8]

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void boost::gil::copy_and_convert_pixels (View const & src,
    any_image_view< Types... > const & dst,
    CC cc 
    )
    +
    +
    Template Parameters
    + + + +
    ViewModel ImageViewConcept
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    CCModel ColorConverterConcept
    @@ -307,7 +379,7 @@ template<typename View1 , typename View2 > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html index 44e44c845..9488cb1a6 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: copy_pixels @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,25 +51,27 @@ - - - + + - - + + - - + +

    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 (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 ... 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 ... 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]

    +
    @@ -94,48 +96,17 @@ template<typename View1 , typename View2 >
    Template Parameters
    - - + +
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void boost::gil::copy_pixels (View const & src,
    any_image_view< Types... > const & dst 
    )
    -
    -
    Template Parameters
    - - - -
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    ViewModel ImageViewConcept
    -
    -
    + +

    ◆ copy_pixels() [2/3]

    -
    -
    -
    @@ -160,8 +131,43 @@ template<typename View1 , typename View2 >
    Template Parameters
    - - + + +
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    + + + +
    +
    + +

    ◆ copy_pixels() [3/3]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void boost::gil::copy_pixels (View const & src,
    any_image_view< Types... > const & dst 
    )
    +
    +
    Template Parameters
    + + +
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    ViewModel ImageViewConcept
    @@ -174,7 +180,7 @@ template<typename View1 , typename View2 > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html index 8c4e7d0b3..ba37bdb77 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: default_construct_pixels @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,7 +51,7 @@ - @@ -65,7 +65,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html index 69d5fc111..cf4280bdf 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: destruct_pixels @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,7 +51,7 @@

    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.
    - @@ -65,7 +65,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html index 1a724157b..b0ed19ae0 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: equal_pixels @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,25 +51,27 @@

    Functions

    +
    template<typename View >
    BOOST_FORCEINLINE void destruct_pixels (View const &view)
     Invokes the in-place destructor on every pixel of the 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 >
    bool equal_pixels (any_image_view< Types... > const &src, View const &dst)
    template<typename ... Types, typename View >
    bool equal_pixels (any_image_view< Types... > const &src, View const &dst)
     
    template<typename View , typename... Types>
    bool equal_pixels (View const &src, any_image_view< Types... > const &dst)
    template<typename View , typename ... Types>
    bool equal_pixels (View const &src, any_image_view< Types... > const &dst)
     
    template<typename... Types1, typename... Types2>
    bool equal_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
    template<typename ... Types1, typename ... Types2>
    bool equal_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
     

    Detailed Description

    std::equal for image views

    Function Documentation

    - + +

    ◆ equal_pixels() [1/3]

    +
    @@ -94,48 +96,17 @@ template<typename View1 , typename View2 >
    Template Parameters
    - - + +
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    TypesModel Boost.MP11-compatible list of models of ImageViewConcept
    ViewModel MutableImageViewConcept
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    bool boost::gil::equal_pixels (View const & src,
    any_image_view< Types... > const & dst 
    )
    -
    -
    Template Parameters
    - - - -
    ViewModel ImageViewConcept
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    -
    -
    + +

    ◆ equal_pixels() [2/3]

    -
    -
    -
    @@ -160,8 +131,43 @@ template<typename View1 , typename View2 >
    Template Parameters
    - - + + +
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    Types1Model Boost.MP11-compatible list of models of ImageViewConcept
    Types2Model Boost.MP11-compatible list of models of MutableImageViewConcept
    + + + +
    +
    + +

    ◆ equal_pixels() [3/3]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    bool boost::gil::equal_pixels (View const & src,
    any_image_view< Types... > const & dst 
    )
    +
    +
    Template Parameters
    + + +
    ViewModel ImageViewConcept
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    @@ -174,7 +180,7 @@ template<typename View1 , typename View2 > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html index fbd3413b7..0c5202dcd 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: fill_pixels @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,20 +51,22 @@ - - - + +

    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)
    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...
     

    Detailed Description

    std::fill for image views

    Function Documentation

    - + +

    ◆ fill_pixels()

    +
    @@ -91,7 +93,7 @@ template<typename View , typename Value >

    fill_pixels for any image view. The pixel to fill with must be compatible with the current view

    Template Parameters
    - +
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    TypesModel Boost.MP11-compatible list of models of MutableImageViewConcept
    @@ -104,7 +106,7 @@ template<typename View , typename Value > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html index fb2813d12..635d91cc3 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: for_each_pixel @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,21 +51,49 @@ - - + +

    Functions

    -template<typename View , typename F >
    for_each_pixel (View const &view, F fun)
    template<typename View , typename F >
    for_each_pixel (View const &view, F fun)
     

    Detailed Description

    std::for_each for image views

    For contiguous images (i.e. images that have no alignment gap at the end of each row) it is more efficient to use the underlying pixel iterator that does not check for the end of rows. For non-contiguous images for_each_pixel resolves to for_each of each row using the underlying pixel iterator, which is still faster

    +

    Function Documentation

    + +

    ◆ for_each_pixel()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    F boost::gil::for_each_pixel (View const & view,
    fun 
    )
    +
    + +
    +
    diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel_position.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel_position.html index 57971b077..23c2aed08 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel_position.html +++ b/develop/doc/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,16 +27,16 @@

    - - + + + + +
    @@ -51,20 +51,48 @@ - - + +

    Functions

    -template<typename View , typename F >
    for_each_pixel_position (View const &view, F fun)
    template<typename View , typename F >
    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)

    +

    Function Documentation

    + +

    ◆ for_each_pixel_position()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    F boost::gil::for_each_pixel_position (View const & view,
    fun 
    )
    +
    + +
    +
    diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html index a11ecdc02..8ddb47245 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: generate_pixels @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,7 +51,7 @@ - @@ -65,7 +65,7 @@ template<typename View , typename F > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html index 94fa07807..4451ab263 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html @@ -4,7 +4,7 @@ - + Generic Image Library: transform_pixel_positions @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,12 +51,12 @@

    Functions

    +
    template<typename View , typename F >
    void generate_pixels (View const &view, F fun)
     std::generate for image views
    - - @@ -70,7 +70,7 @@ template<typename View1 , typename View2 , typename View3 , typename F > < diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html index 203992d7f..2ff5f4da7 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: transform_pixels @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,12 +51,12 @@

    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.
     
    +
    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
    - - @@ -71,7 +71,7 @@ template<typename View1 , typename View2 , typename View3 , typename F > < diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html index 8bb99de41..d964efeab 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: uninitialized_copy_pixels @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,7 +51,7 @@

    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
     
    +
    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
    - @@ -65,7 +65,7 @@ template<typename View1 , typename View2 > diff --git a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html index 50f6363d6..d856feb67 100644 --- a/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html +++ b/develop/doc/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: uninitialized_fill_pixels @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,7 +51,7 @@

    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
    - @@ -65,7 +65,7 @@ template<typename View , typename Value > diff --git a/develop/doc/html/reference/group___image_view_transformations.html b/develop/doc/html/reference/group___image_view_transformations.html index 2c1f00920..632be707f 100644 --- a/develop/doc/html/reference/group___image_view_transformations.html +++ b/develop/doc/html/reference/group___image_view_transformations.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image View Transformations @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -74,16 +74,16 @@ Modules
    - + - + - + - +

    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
     view of a view rotated 180 degrees
     
     subimage_view
     view of an axis-aligned rectangular area within an image_view
     view of an axis-aligned rectangular area within an image_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
     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
     single-channel (grayscale) view of the N-th channel of a given image_view
     single-channel (grayscale) view of the N-th channel of a given image_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
     single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter
     
    diff --git a/develop/doc/html/reference/group___image_view_transformations180.html b/develop/doc/html/reference/group___image_view_transformations180.html index d9f0bdb00..f54efbb70 100644 --- a/develop/doc/html/reference/group___image_view_transformations180.html +++ b/develop/doc/html/reference/group___image_view_transformations180.html @@ -4,7 +4,7 @@ - + Generic Image Library: rotated180_view @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,18 +51,19 @@

    @@ -103,7 +103,7 @@ Classes

    - - + + - - + +

    Functions

    -template<typename View >
    dynamic_xy_step_type< View >::type rotated180_view (const View &src)
    template<typename View >
    dynamic_xy_step_type< View >::type rotated180_view (const View &src)
     
    template<typename... Views>
    auto rotated180_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_type< any_image_view< Views... >>::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() [1/2]

    +
    @@ -86,11 +87,37 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ rotated180_view() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dynamic_xy_step_type<View>::type boost::gil::rotated180_view (const View & src)
    +
    +inline
    +
    +
    @@ -99,7 +126,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations90_c_c_w.html b/develop/doc/html/reference/group___image_view_transformations90_c_c_w.html index abd6e7cd3..e5b63c4d5 100644 --- a/develop/doc/html/reference/group___image_view_transformations90_c_c_w.html +++ b/develop/doc/html/reference/group___image_view_transformations90_c_c_w.html @@ -4,7 +4,7 @@ - + Generic Image Library: rotated90ccw_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,18 +51,19 @@ - - + + - - + +

    Functions

    -template<typename View >
    dynamic_xy_step_transposed_type< View >::type rotated90ccw_view (const View &src)
    template<typename View >
    dynamic_xy_step_transposed_type< View >::type rotated90ccw_view (const View &src)
     
    template<typename... Views>
    auto rotated90ccw_view (const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    template<typename ... Views>
    auto rotated90ccw_view (const any_image_view< Views... > &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() [1/2]

    +
    @@ -86,11 +87,37 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ rotated90ccw_view() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dynamic_xy_step_transposed_type<View>::type boost::gil::rotated90ccw_view (const View & src)
    +
    +inline
    +
    +
    @@ -99,7 +126,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations90_c_w.html b/develop/doc/html/reference/group___image_view_transformations90_c_w.html index 4228fec30..3e8130106 100644 --- a/develop/doc/html/reference/group___image_view_transformations90_c_w.html +++ b/develop/doc/html/reference/group___image_view_transformations90_c_w.html @@ -4,7 +4,7 @@ - + Generic Image Library: rotated90cw_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,18 +51,19 @@ - - + + - - + +

    Functions

    -template<typename View >
    dynamic_xy_step_transposed_type< View >::type rotated90cw_view (const View &src)
    template<typename View >
    dynamic_xy_step_transposed_type< View >::type rotated90cw_view (const View &src)
     
    template<typename... Views>
    auto rotated90cw_view (const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    template<typename ... Views>
    auto rotated90cw_view (const any_image_view< Views... > &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() [1/2]

    +
    @@ -86,11 +87,37 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ rotated90cw_view() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dynamic_xy_step_transposed_type<View>::type boost::gil::rotated90cw_view (const View & src)
    +
    +inline
    +
    +
    @@ -99,7 +126,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations_color_convert.html b/develop/doc/html/reference/group___image_view_transformations_color_convert.html index fa44fb92c..215773f4c 100644 --- a/develop/doc/html/reference/group___image_view_transformations_color_convert.html +++ b/develop/doc/html/reference/group___image_view_transformations_color_convert.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_converted_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -53,7 +53,7 @@

    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...
    + Function object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept. More...
      struct  color_converted_view_type< SrcView, DstP, CC >  Returns the type of a view that does color conversion upon dereferencing its pixels. More...
    @@ -67,37 +67,74 @@ Classes - - + - - + - - + + - - + + - - + + - - + +

    Functions

    +
    template<typename DstP , typename View , typename CC >
    color_converted_view_type< View, DstP, CC >::type color_converted_view (const View &src, CC cc)
    color_converted_view_type< View, DstP, CC >::type color_converted_view (const View &src, CC cc)
     view of a different color space with a user defined color-converter
     
    +
    template<typename DstP , typename View >
    color_converted_view_type< View, DstP >::type color_converted_view (const View &src)
    color_converted_view_type< View, DstP >::type color_converted_view (const View &src)
     overload of generic color_converted_view with the default color-converter
     
    template<typename DstP , typename... Views, typename CC >
    auto color_converted_view (const any_image_view< Views... > &src, CC) -> typename color_converted_view_type< any_image_view< Views... >, DstP, CC >::type
    template<typename DstP , typename ... Views, typename CC >
    auto color_converted_view (const any_image_view< Views... > &src, 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
    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) -> typename color_converted_view_type< any_image_view< Views... >, DstP, CC >::type
    template<typename DstP , typename ... Views, typename CC >
    auto any_color_converted_view (const any_image_view< Views... > &src, 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
    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...
     

    Detailed Description

    Color converted view of another view.

    Function Documentation

    - + +

    ◆ any_color_converted_view() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    auto boost::gil::any_color_converted_view (const any_image_view< Views... > & src) -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type +
    +
    +inline
    +
    + +

    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)

    +
    Template Parameters
    + + +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +
    +
    + +

    ◆ any_color_converted_view() [2/2]

    +
    @@ -133,14 +170,16 @@ template<typename DstP , typename View >

    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 Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    - + +

    ◆ color_converted_view() [1/2]

    +
    @@ -148,9 +187,9 @@ template<typename DstP , typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations_flip_l_r.html b/develop/doc/html/reference/group___image_view_transformations_flip_l_r.html index eef1b53de..1b399e14c 100644 --- a/develop/doc/html/reference/group___image_view_transformations_flip_l_r.html +++ b/develop/doc/html/reference/group___image_view_transformations_flip_l_r.html @@ -4,7 +4,7 @@ - + Generic Image Library: flipped_left_right_view @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -51,18 +51,19 @@
    - + - + @@ -163,17 +202,19 @@ template<typename DstP , typename View >
    auto boost::gil::any_color_converted_view auto boost::gil::color_converted_view (const any_image_view< Views... > & 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 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)

    +

    overload of generic color_converted_view with the default color-converter

    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    - + +

    ◆ color_converted_view() [2/2]

    +
    @@ -209,40 +250,7 @@ template<typename DstP , typename View >

    overload of generic color_converted_view with user defined color-converter

    Template Parameters
    - -
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    - - - -
    -
    - -
    -
    - - - - - -
    - - - - - - - - -
    auto boost::gil::color_converted_view (any_image_view< Views... > const & src) -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type -
    -
    -inline
    -
    - -

    overload of generic color_converted_view with the default color-converter

    -
    Template Parameters
    - - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    @@ -255,7 +263,7 @@ template<typename DstP , typename View >
    - - + + - - + +

    Functions

    -template<typename View >
    dynamic_x_step_type< View >::type flipped_left_right_view (const View &src)
    template<typename View >
    dynamic_x_step_type< View >::type flipped_left_right_view (const View &src)
     
    template<typename... Views>
    auto flipped_left_right_view (any_image_view< Views... > const &src) -> typename dynamic_x_step_type< any_image_view< Views... >>::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() [1/2]

    +
    @@ -86,11 +87,37 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ flipped_left_right_view() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dynamic_x_step_type<View>::type boost::gil::flipped_left_right_view (const View & src)
    +
    +inline
    +
    +
    @@ -99,7 +126,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations_flip_u_d.html b/develop/doc/html/reference/group___image_view_transformations_flip_u_d.html index 117fa010d..1a27595de 100644 --- a/develop/doc/html/reference/group___image_view_transformations_flip_u_d.html +++ b/develop/doc/html/reference/group___image_view_transformations_flip_u_d.html @@ -4,7 +4,7 @@ - + Generic Image Library: flipped_up_down_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,18 +51,19 @@ - - + + - - + +

    Functions

    -template<typename View >
    dynamic_y_step_type< View >::type flipped_up_down_view (const View &src)
    template<typename View >
    dynamic_y_step_type< View >::type flipped_up_down_view (const View &src)
     
    template<typename... Views>
    auto flipped_up_down_view (any_image_view< Views... > const &src) -> typename dynamic_y_step_type< any_image_view< Views... >>::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() [1/2]

    +
    @@ -86,11 +87,37 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ flipped_up_down_view() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dynamic_y_step_type<View>::type boost::gil::flipped_up_down_view (const View & src)
    +
    +inline
    +
    +
    @@ -99,7 +126,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations_kth_channel.html b/develop/doc/html/reference/group___image_view_transformations_kth_channel.html index 1f2a6dc16..3543e7eff 100644 --- a/develop/doc/html/reference/group___image_view_transformations_kth_channel.html +++ b/develop/doc/html/reference/group___image_view_transformations_kth_channel.html @@ -4,7 +4,7 @@ - + Generic Image Library: kth_channel_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -47,31 +47,49 @@
    -

    single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter +

    single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter More...

    - +

    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.If the channels in the source view are adjacent in memory (such as planar non-step view or single-channel view) then the return view is a single-channel non-step view. If the channels are non-adjacent (interleaved and/or step view) then the return view is a single-channel step view. More...
     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 >
    kth_channel_view_type< K, View >::type kth_channel_view (const View &src)
    template<int K, typename View >
    kth_channel_view_type< K, View >::type kth_channel_view (const View &src)
     

    Detailed Description

    -

    single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter

    +

    single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter

    +

    Function Documentation

    + +

    ◆ kth_channel_view()

    + +
    +
    + + + + + + + + +
    kth_channel_view_type<K,View>::type boost::gil::kth_channel_view (const View & src)
    +
    + +
    +
    diff --git a/develop/doc/html/reference/group___image_view_transformations_nth_channel.html b/develop/doc/html/reference/group___image_view_transformations_nth_channel.html index 95e6adb85..3a440e74b 100644 --- a/develop/doc/html/reference/group___image_view_transformations_nth_channel.html +++ b/develop/doc/html/reference/group___image_view_transformations_nth_channel.html @@ -4,7 +4,7 @@ - + Generic Image Library: nth_channel_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -47,13 +47,13 @@
    -

    single-channel (grayscale) view of the N-th channel of a given image_view +

    single-channel (grayscale) view of the N-th channel of a given image_view More...

    - + @@ -61,18 +61,19 @@ 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 ViewIf the channels in the source view are adjacent in memory (such as planar non-step view or single-channel view) then the return view is a single-channel non-step view. If the channels are non-adjacent (interleaved and/or step view) then the return view is a single-channel step view. More...
     Given a source image view type View, returns the type of an image view over a single channel of View. More...
     
    struct  nth_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. More...
    - - + + - - + +

    Functions

    -template<typename View >
    nth_channel_view_type< View >::type nth_channel_view (const View &src, int n)
    template<typename View >
    nth_channel_view_type< View >::type nth_channel_view (const View &src, int n)
     
    template<typename... Views>
    auto nth_channel_view (const any_image_view< Views... > &src, int n) -> typename nth_channel_view_type< any_image_view< Views... >>::type
    template<typename ... Views>
    auto nth_channel_view (const any_image_view< Views... > &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

    +

    single-channel (grayscale) view of the N-th channel of a given image_view

    Function Documentation

    - + +

    ◆ nth_channel_view() [1/2]

    +
    @@ -106,11 +107,39 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ nth_channel_view() [2/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    nth_channel_view_type<View>::type boost::gil::nth_channel_view (const View & src,
    int n 
    )
    +
    +
    @@ -119,7 +148,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations_subimage.html b/develop/doc/html/reference/group___image_view_transformations_subimage.html index 05cce1153..3d9d856ed 100644 --- a/develop/doc/html/reference/group___image_view_transformations_subimage.html +++ b/develop/doc/html/reference/group___image_view_transformations_subimage.html @@ -4,7 +4,7 @@ - + Generic Image Library: subimage_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,30 +46,30 @@
    -

    view of an axis-aligned rectangular area within an image_view +

    view of an axis-aligned rectangular area within an image_view More...

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

    Functions

    -template<typename View >
    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::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 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, 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... >
    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

    +

    view of an axis-aligned rectangular area within an image_view

    Function Documentation

    - + +

    ◆ subimage_view() [1/4]

    +
    @@ -109,14 +109,16 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    - + +

    ◆ subimage_view() [2/4]

    +
    @@ -168,11 +170,107 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ subimage_view() [3/4]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    View boost::gil::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 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ subimage_view() [4/4]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    View boost::gil::subimage_view (View const & src,
    typename View::point_t const & topleft,
    typename View::point_t const & dimensions 
    )
    +
    +inline
    +
    +
    @@ -181,7 +279,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations_subsampled.html b/develop/doc/html/reference/group___image_view_transformations_subsampled.html index 5cad8316f..746be4395 100644 --- a/develop/doc/html/reference/group___image_view_transformations_subsampled.html +++ b/develop/doc/html/reference/group___image_view_transformations_subsampled.html @@ -4,7 +4,7 @@ - + Generic Image Library: subsampled_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,30 +46,30 @@
    -

    view of a subsampled version of an image_view, stepping over a number of channels in X and number of rows in Y +

    view of a subsampled version of an image_view, stepping over a number of channels in X and number of rows in Y More...

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

    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
    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
     
    -template<typename View >
    auto subsampled_view (View const &src, typename View::point_t const &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, 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
    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

    +

    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/4]

    +
    @@ -103,14 +103,16 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    - + +

    ◆ subsampled_view() [2/4]

    +
    @@ -150,11 +152,91 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ subsampled_view() [3/4]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    auto boost::gil::subsampled_view (View const & src,
    typename View::coord_t x_step,
    typename View::coord_t y_step 
    ) -> typename dynamic_xy_step_type<View>::type +
    +
    +inline
    +
    + +
    +
    + +

    ◆ subsampled_view() [4/4]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    auto boost::gil::subsampled_view (View const & src,
    typename View::point_t const & step 
    ) -> typename dynamic_xy_step_type<View>::type +
    +
    +inline
    +
    +
    @@ -163,7 +245,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___image_view_transformations_transposed.html b/develop/doc/html/reference/group___image_view_transformations_transposed.html index a80a8a8ff..7cb74b045 100644 --- a/develop/doc/html/reference/group___image_view_transformations_transposed.html +++ b/develop/doc/html/reference/group___image_view_transformations_transposed.html @@ -4,7 +4,7 @@ - + Generic Image Library: transposed_view @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,18 +51,19 @@ - - + + - - + +

    Functions

    -template<typename View >
    dynamic_xy_step_transposed_type< View >::type transposed_view (const View &src)
    template<typename View >
    dynamic_xy_step_transposed_type< View >::type transposed_view (const View &src)
     
    template<typename... Views>
    auto transposed_view (const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
    template<typename ... Views>
    auto transposed_view (const any_image_view< Views... > &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
     

    Detailed Description

    view of a view transposed

    Function Documentation

    - + +

    ◆ transposed_view() [1/2]

    +
    @@ -86,11 +87,37 @@ template<typename View >
    Template Parameters
    - +
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    ViewsModels Boost.MP11-compatible list of models of ImageViewConcept
    +
    +
    + +

    ◆ transposed_view() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dynamic_xy_step_transposed_type<View>::type boost::gil::transposed_view (const View & src)
    +
    +inline
    +
    +
    @@ -99,7 +126,7 @@ template<typename View > diff --git a/develop/doc/html/reference/group___j_p_e_g___i_o.html b/develop/doc/html/reference/group___j_p_e_g___i_o.html index 81003cf35..9f6b6ff40 100644 --- a/develop/doc/html/reference/group___j_p_e_g___i_o.html +++ b/develop/doc/html/reference/group___j_p_e_g___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: JPEG I/O @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -53,7 +53,7 @@ diff --git a/develop/doc/html/reference/group___layout_model.html b/develop/doc/html/reference/group___layout_model.html index f48657118..3383de48f 100644 --- a/develop/doc/html/reference/group___layout_model.html +++ b/develop/doc/html/reference/group___layout_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Layouts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -55,39 +55,144 @@ Classes - + - + - + - - - + + + - - - - - - + + + + + +

    Typedefs

    -using cmyk_layout_t = layout< cmyk_t >
    using cmyk_layout_t = layout< cmyk_t >
     
    -using gray_layout_t = layout< gray_t >
    using gray_layout_t = layout< gray_t >
     
    -using rgb_layout_t = layout< rgb_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 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 >>
     
    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 > >
     

    Detailed Description

    +

    Typedef Documentation

    + +

    ◆ abgr_layout_t

    + +
    +
    + + + + +
    using abgr_layout_t = layout<rgba_t, mp11::mp_list_c<int, 3, 2, 1, 0> >
    +
    + +
    +
    + +

    ◆ argb_layout_t

    + +
    +
    + + + + +
    using argb_layout_t = layout<rgba_t, mp11::mp_list_c<int, 1, 2, 3, 0> >
    +
    + +
    +
    + +

    ◆ bgr_layout_t

    + +
    +
    + + + + +
    using bgr_layout_t = layout<rgb_t, mp11::mp_list_c<int, 2, 1, 0> >
    +
    + +
    +
    + +

    ◆ bgra_layout_t

    + +
    +
    + + + + +
    using bgra_layout_t = layout<rgba_t, mp11::mp_list_c<int, 2, 1, 0, 3> >
    +
    + +
    +
    + +

    ◆ cmyk_layout_t

    + +
    +
    + + + + +
    using cmyk_layout_t = layout<cmyk_t>
    +
    + +
    +
    + +

    ◆ gray_layout_t

    + +
    +
    + + + + +
    using gray_layout_t = layout<gray_t>
    +
    + +
    +
    + +

    ◆ rgb_layout_t

    + +
    +
    + + + + +
    using rgb_layout_t = layout<rgb_t>
    +
    + +
    +
    + +

    ◆ rgba_layout_t

    + +
    +
    + + + + +
    using rgba_layout_t = layout<rgba_t>
    +
    + +
    +
    diff --git a/develop/doc/html/reference/group___locator2_d_concept.html b/develop/doc/html/reference/group___locator2_d_concept.html index b91391e40..6e0aa0419 100644 --- a/develop/doc/html/reference/group___locator2_d_concept.html +++ b/develop/doc/html/reference/group___locator2_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccess2DLocatorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___locator_n_d_concept.html b/develop/doc/html/reference/group___locator_n_d_concept.html index 4140c6304..f0864887f 100644 --- a/develop/doc/html/reference/group___locator_n_d_concept.html +++ b/develop/doc/html/reference/group___locator_n_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccessNDLocatorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___metafunctions.html b/develop/doc/html/reference/group___metafunctions.html index aab214a71..4ad65708f 100644 --- a/develop/doc/html/reference/group___metafunctions.html +++ b/develop/doc/html/reference/group___metafunctions.html @@ -4,7 +4,7 @@ - + Generic Image Library: Metafunctions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Modules diff --git a/develop/doc/html/reference/group___p_n_g___i_o.html b/develop/doc/html/reference/group___p_n_g___i_o.html index 9a66825bc..185da6548 100644 --- a/develop/doc/html/reference/group___p_n_g___i_o.html +++ b/develop/doc/html/reference/group___p_n_g___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: PNG I/O @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -53,7 +53,7 @@ diff --git a/develop/doc/html/reference/group___packed_channel_dynamic_reference_model.html b/develop/doc/html/reference/group___packed_channel_dynamic_reference_model.html index 923f6a637..43715eef1 100644 --- a/develop/doc/html/reference/group___packed_channel_dynamic_reference_model.html +++ b/develop/doc/html/reference/group___packed_channel_dynamic_reference_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_dynamic_channel_reference @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -61,17 +61,17 @@ Classes - - - @@ -79,13 +79,20 @@ template<typename BF , int NB, bool M>

    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
     
    +
    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
     
    +
    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

    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;
    uint16_t data=0;
    bits2_dynamic_ref_t channel_ref(&data,1);
    channel_ref = channel_traits<bits2_dynamic_ref_t>::max_value(); // == 3
    assert(data == 6); // == (3<<1) == 6
    +

    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;
    +
    +
    uint16_t data=0;
    +
    bits2_dynamic_ref_t channel_ref(&data,1);
    +
    channel_ref = channel_traits<bits2_dynamic_ref_t>::max_value(); // == 3
    +
    assert(data == 6); // == (3<<1) == 6
    +
    diff --git a/develop/doc/html/reference/group___packed_channel_reference_model.html b/develop/doc/html/reference/group___packed_channel_reference_model.html index 7dfddf69f..17aaea4db 100644 --- a/develop/doc/html/reference/group___packed_channel_reference_model.html +++ b/develop/doc/html/reference/group___packed_channel_reference_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_channel_reference @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -48,17 +48,17 @@ - - - @@ -66,13 +66,20 @@ template<typename BF , int FB, 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
     
    +
    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
     
    +
    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

    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;
    uint16_t data=0;
    bits2_1_ref_t channel_ref(&data);
    channel_ref = channel_traits<bits2_1_ref_t>::max_value(); // == 3
    assert(data == 6); // == 3<<1 == 6
    +

    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;
    +
    +
    uint16_t data=0;
    +
    bits2_1_ref_t channel_ref(&data);
    +
    channel_ref = channel_traits<bits2_1_ref_t>::max_value(); // == 3
    +
    assert(data == 6); // == 3<<1 == 6
    +
    diff --git a/develop/doc/html/reference/group___packed_channel_value_model.html b/develop/doc/html/reference/group___packed_channel_value_model.html index df73d3969..d08c43cf9 100644 --- a/develop/doc/html/reference/group___packed_channel_value_model.html +++ b/develop/doc/html/reference/group___packed_channel_value_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_channel_value @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -60,13 +60,20 @@ Modules -

    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>;
    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, "");
    +

    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>;
    +
    +
    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, "");
    +
    diff --git a/develop/doc/html/reference/group___pixel.html b/develop/doc/html/reference/group___pixel.html index a854c5a0e..71600ff6c 100644 --- a/develop/doc/html/reference/group___pixel.html +++ b/develop/doc/html/reference/group___pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -70,7 +70,7 @@ Modules diff --git a/develop/doc/html/reference/group___pixel_algorithm.html b/develop/doc/html/reference/group___pixel_algorithm.html index 294fe41a5..a0e29d1a9 100644 --- a/develop/doc/html/reference/group___pixel_algorithm.html +++ b/develop/doc/html/reference/group___pixel_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -61,10 +61,10 @@ Classes - - +

    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
     helper function for converting one pixel to another using GIL default color-converters where ScrP models HomogeneousPixelConcept DstP models HomogeneousPixelValueConcept
     

    Detailed Description

    @@ -76,7 +76,7 @@ template<typename SrcP , typename DstP > diff --git a/develop/doc/html/reference/group___pixel_based.html b/develop/doc/html/reference/group___pixel_based.html index ebb807517..e1b7b0d70 100644 --- a/develop/doc/html/reference/group___pixel_based.html +++ b/develop/doc/html/reference/group___pixel_based.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelBased @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -70,7 +70,7 @@ Modules diff --git a/develop/doc/html/reference/group___pixel_based_algorithm.html b/develop/doc/html/reference/group___pixel_based_algorithm.html index c4315c31a..bb6563b24 100644 --- a/develop/doc/html/reference/group___pixel_based_algorithm.html +++ b/develop/doc/html/reference/group___pixel_based_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -57,13 +57,22 @@ Classes

    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, "");
    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, "");
    +

    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,
    +
    channel_mapping_type<rgba8_pixel_t>::type>::value, "");
    +
    static_assert(std::is_same<channel_type<bgr8_pixel_t>::type, uint8_t>::value, "");
    +
    +
    mp11::mp_list< red_t, green_t, blue_t > rgb_t
    Definition: rgb.hpp:34
    diff --git a/develop/doc/html/reference/group___pixel_based_concept.html b/develop/doc/html/reference/group___pixel_based_concept.html index 5b7994240..3a7ddfa40 100644 --- a/develop/doc/html/reference/group___pixel_based_concept.html +++ b/develop/doc/html/reference/group___pixel_based_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_based_model.html b/develop/doc/html/reference/group___pixel_based_model.html index 2cfd8960e..2e5d9e837 100644 --- a/develop/doc/html/reference/group___pixel_based_model.html +++ b/develop/doc/html/reference/group___pixel_based_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -53,51 +53,51 @@

    Modules

     bit_aligned_pixel_reference - A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
    + A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
      - + - + - + - + - + - + - + - + - + - + - + - - + + - +

    Classes

    struct  bit_aligned_pixel_iterator< NonAlignedPixelReference >
     An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     
    class  image< Pixel, IsPlanar, Alloc >
     container interface over image view. Models ImageConcept, PixelBasedConcept More...
     container interface over image view. Models ImageConcept, PixelBasedConcept More...
     
    class  iterator_from_2d< Loc2 >
     Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...
     Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...
     
    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...
     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...
     
    struct  pixel< ChannelValue, Layout >
     Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
     Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
     
    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...
     An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept. More...
     
    struct  planar_pixel_iterator< ChannelPtr, ColorSpace >
     An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     
    struct  planar_pixel_reference< ChannelReference, ColorSpace >
     A reference proxy to a planar pixel. More...
     
    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...
     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...
     
    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...
     A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept. More...
     
    class  image_view< Loc >
     A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...
     A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...
     
    class  pixel_2d_locator_base< Loc, XIterator, YIterator >
     base class for models of PixelLocatorConceptPixel 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: More...
     base class for models of PixelLocatorConcept More...
     
    class  memory_based_2d_locator< StepIterator >
     Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConceptThe class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation. More...
    class  memory_based_2d_locator
     Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...
     
    class  memory_based_step_iterator< Iterator >
    class  memory_based_step_iterator
     MEMORY-BASED STEP ITERATOR. More...
     
    @@ -109,7 +109,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_concept.html b/develop/doc/html/reference/group___pixel_concept.html index e78f15887..58d28c055 100644 --- a/develop/doc/html/reference/group___pixel_concept.html +++ b/develop/doc/html/reference/group___pixel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -64,10 +64,10 @@ Classes  Homogeneous pixel concept that allows for changing its channels. More...
      struct  PixelValueConcept< P > - Pixel concept that is a Regular type. More...
    + Pixel concept that is a Regular type. More...
      struct  HomogeneousPixelValueConcept< P > - Homogeneous pixel concept that is a Regular type. More...
    + Homogeneous pixel concept that is a Regular type. More...
      struct  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. More...
    @@ -84,7 +84,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_dereference_adaptor.html b/develop/doc/html/reference/group___pixel_dereference_adaptor.html index ddda243fd..05c0fc0a6 100644 --- a/develop/doc/html/reference/group___pixel_dereference_adaptor.html +++ b/develop/doc/html/reference/group___pixel_dereference_adaptor.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel Dereference Adaptor @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -64,7 +64,7 @@ Modules diff --git a/develop/doc/html/reference/group___pixel_dereference_adaptor_concept.html b/develop/doc/html/reference/group___pixel_dereference_adaptor_concept.html index c5d258033..75fbf45dd 100644 --- a/develop/doc/html/reference/group___pixel_dereference_adaptor_concept.html +++ b/develop/doc/html/reference/group___pixel_dereference_adaptor_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -59,7 +59,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_dereference_adaptor_model.html b/develop/doc/html/reference/group___pixel_dereference_adaptor_model.html index 35d537b69..35f0e01b9 100644 --- a/develop/doc/html/reference/group___pixel_dereference_adaptor_model.html +++ b/develop/doc/html/reference/group___pixel_dereference_adaptor_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -49,19 +49,19 @@

    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...
    + Function object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept. More...
      struct  nth_channel_deref_fn< SrcP > - Function object that returns a grayscale reference of the N-th channel of a given reference. Models: PixelDereferenceAdaptorConcept.If the input is a pixel value or constant reference, the function object is immutable. Otherwise it is mutable (and returns non-const reference to the n-th channel) More...
    + Function object that returns a grayscale reference of the N-th channel of a given reference. Models: PixelDereferenceAdaptorConcept. More...
      struct  kth_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.If the input is a pixel value or constant reference, the function object is immutable. Otherwise it is mutable (and returns non-const reference to the k-th channel) More...
    + Function object that returns a grayscale reference of the K-th channel (specified as a template parameter) of a given reference. Models: PixelDereferenceAdaptorConcept. More...
      struct  deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >  Helper base class for pixel dereference adaptors. More...
      class  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. More...
    + Composes two dereference function objects. Similar to std::unary_compose but needs to pull some aliases from the component types. Models: PixelDereferenceAdaptorConcept. More...
     

    Detailed Description

    @@ -71,7 +71,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_image_view_concept.html b/develop/doc/html/reference/group___pixel_image_view_concept.html index 26a796ade..7161e5104 100644 --- a/develop/doc/html/reference/group___pixel_image_view_concept.html +++ b/develop/doc/html/reference/group___pixel_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageViewConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_iterator.html b/develop/doc/html/reference/group___pixel_iterator.html index 575a32b39..7d8d75aca 100644 --- a/develop/doc/html/reference/group___pixel_iterator.html +++ b/develop/doc/html/reference/group___pixel_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel Iterator @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Modules diff --git a/develop/doc/html/reference/group___pixel_iterator_concept.html b/develop/doc/html/reference/group___pixel_iterator_concept.html index 83cddd22e..f41da6a50 100644 --- a/develop/doc/html/reference/group___pixel_iterator_concept.html +++ b/develop/doc/html/reference/group___pixel_iterator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -76,7 +76,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_iterator_concept_iterator_adaptor.html b/develop/doc/html/reference/group___pixel_iterator_concept_iterator_adaptor.html index 2fe1e138c..7a633e673 100644 --- a/develop/doc/html/reference/group___pixel_iterator_concept_iterator_adaptor.html +++ b/develop/doc/html/reference/group___pixel_iterator_concept_iterator_adaptor.html @@ -4,7 +4,7 @@ - + Generic Image Library: IteratorAdaptorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_iterator_concept_pixel_iterator.html b/develop/doc/html/reference/group___pixel_iterator_concept_pixel_iterator.html index 2fcad0cb5..fa11dbca6 100644 --- a/develop/doc/html/reference/group___pixel_iterator_concept_pixel_iterator.html +++ b/develop/doc/html/reference/group___pixel_iterator_concept_pixel_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelIteratorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,7 +52,7 @@

    Classes

    struct  PixelIteratorConcept< Iterator > - An STL random access traversal iterator over a model of PixelConcept. More...
    + An STL random access traversal iterator over a model of PixelConcept. More...
      struct  MutablePixelIteratorConcept< Iterator >  Pixel iterator that allows for changing its pixel. More...
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_iterator_concept_step_iterator.html b/develop/doc/html/reference/group___pixel_iterator_concept_step_iterator.html index aa9fc93c1..377ffbf0d 100644 --- a/develop/doc/html/reference/group___pixel_iterator_concept_step_iterator.html +++ b/develop/doc/html/reference/group___pixel_iterator_concept_step_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: StepIteratorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -69,7 +69,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_iterator_model.html b/develop/doc/html/reference/group___pixel_iterator_model.html index ab12d7797..ffe8fb822 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model.html +++ b/develop/doc/html/reference/group___pixel_iterator_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,7 +52,7 @@

    Modules

     bit_aligned_pixel_iterator - An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
    + An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
       iterator_from_2d  pixel step iterator, pixel image iterator and pixel dereference iterator
    @@ -61,16 +61,16 @@ Modules  Support for interleaved iterators over packed 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.
    + 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 - An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept.
    + An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept.
       planar_pixel_iterator - An iterator over planar pixels. Models PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
    + An iterator over planar pixels. Models PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
       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.
    + 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  Iterators that allow for specifying the step between two adjacent values.
    @@ -84,7 +84,7 @@ Modules diff --git a/develop/doc/html/reference/group___pixel_iterator_model_deref_ptr.html b/develop/doc/html/reference/group___pixel_iterator_model_deref_ptr.html index 07421f387..75cb5314f 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model_deref_ptr.html +++ b/develop/doc/html/reference/group___pixel_iterator_model_deref_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: dereference_iterator_adaptor @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,13 +46,13 @@
    -

    An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept. +

    An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept. More...

    - + @@ -62,14 +62,14 @@ Classes

    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...
     An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept. More...
     
    struct  iterator_add_deref< Iterator, Deref >
     Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor upon dereferencing. More...
     

    Detailed Description

    -

    An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept.

    +

    An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept.

    diff --git a/develop/doc/html/reference/group___pixel_iterator_model_from_locator.html b/develop/doc/html/reference/group___pixel_iterator_model_from_locator.html index 4181dd163..b8c25f739 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model_from_locator.html +++ b/develop/doc/html/reference/group___pixel_iterator_model_from_locator.html @@ -4,7 +4,7 @@ - + Generic Image Library: iterator_from_2d @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,20 +52,20 @@

    Classes

    class  iterator_from_2d< Loc2 > - Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...
    + Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...
     

    Detailed Description

    pixel step iterator, pixel image iterator and pixel dereference iterator

    ITERATOR FROM 2D ADAPTOR

    -

    An iterator over two-dimensional locator. Useful for iterating over the pixels of an image view. Models PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept

    +

    An iterator over two-dimensional locator. Useful for iterating over the pixels of an image view. Models PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept

    diff --git a/develop/doc/html/reference/group___pixel_iterator_model_interleaved_ptr.html b/develop/doc/html/reference/group___pixel_iterator_model_interleaved_ptr.html index 7e0807d91..59a6c72f5 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model_interleaved_ptr.html +++ b/develop/doc/html/reference/group___pixel_iterator_model_interleaved_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: C pointer to a pixel @@ -27,34 +27,44 @@

    - - + + + + +
    +
    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. +

    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. More...

    + + + + + + +

    +Classes

    struct  dynamic_x_step_type< Pixel * >
     
    struct  dynamic_x_step_type< const Pixel * >
     

    Detailed Description

    -

    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.

    +

    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.

    diff --git a/develop/doc/html/reference/group___pixel_iterator_model_packed_interleaved_ptr.html b/develop/doc/html/reference/group___pixel_iterator_model_packed_interleaved_ptr.html index 98c33884a..5ea057a1c 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model_packed_interleaved_ptr.html +++ b/develop/doc/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,16 +27,16 @@

    - - + + + + +
    @@ -47,14 +47,14 @@

    Support for interleaved iterators over packed pixel. More...

    Support for interleaved iterators over packed pixel.

    -

    Iterators over interleaved pixels. The pointer packed_pixel<P,CR,Layout>* is used as an iterator over interleaved pixels of packed format. Models PixelIteratorConcept, HasDynamicXStepTypeConcept, MemoryBasedIteratorConcept

    +

    Iterators over interleaved pixels. The pointer packed_pixel<P,CR,Layout>* is used as an iterator over interleaved pixels of packed format. Models PixelIteratorConcept, HasDynamicXStepTypeConcept, MemoryBasedIteratorConcept

    diff --git a/develop/doc/html/reference/group___pixel_iterator_model_planar_ptr.html b/develop/doc/html/reference/group___pixel_iterator_model_planar_ptr.html index ccf8a0415..97e2f5af0 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model_planar_ptr.html +++ b/develop/doc/html/reference/group___pixel_iterator_model_planar_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_iterator @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,24 +46,24 @@
    diff --git a/develop/doc/html/reference/group___pixel_iterator_model_step_ptr.html b/develop/doc/html/reference/group___pixel_iterator_model_step_ptr.html index 42f2afddd..5c87c0ed0 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model_step_ptr.html +++ b/develop/doc/html/reference/group___pixel_iterator_model_step_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: step iterators @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -57,7 +57,7 @@ Classes struct  memunit_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) More...
      -class  memory_based_step_iterator< Iterator > +class  memory_based_step_iterator  MEMORY-BASED STEP ITERATOR. More...
      @@ -69,7 +69,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_iterator_model_virtual.html b/develop/doc/html/reference/group___pixel_iterator_model_virtual.html index 75ca26323..2cc090b99 100644 --- a/develop/doc/html/reference/group___pixel_iterator_model_virtual.html +++ b/develop/doc/html/reference/group___pixel_iterator_model_virtual.html @@ -4,7 +4,7 @@ - + Generic Image Library: position_iterator @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,24 +46,24 @@
    -

    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. +

    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

    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...
     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...
     

    Detailed Description

    -

    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.

    +

    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.

    diff --git a/develop/doc/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html b/develop/doc/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html index 95f59ede4..3ff27d3d4 100644 --- a/develop/doc/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html +++ b/develop/doc/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_iterator @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,17 +46,17 @@
    -

    An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. +

    An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...

    - +

    Classes

    struct  bit_aligned_pixel_iterator< NonAlignedPixelReference >
     An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
     

    Detailed Description

    -

    An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.

    +

    An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.

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

    @@ -64,7 +64,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_locator.html b/develop/doc/html/reference/group___pixel_locator.html index cb3744bb4..09d35fb0c 100644 --- a/develop/doc/html/reference/group___pixel_locator.html +++ b/develop/doc/html/reference/group___pixel_locator.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel Locator @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Modules diff --git a/develop/doc/html/reference/group___pixel_locator2_d_concept.html b/develop/doc/html/reference/group___pixel_locator2_d_concept.html index f3fdb63db..6c08d6db8 100644 --- a/develop/doc/html/reference/group___pixel_locator2_d_concept.html +++ b/develop/doc/html/reference/group___pixel_locator2_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelLocatorConcept @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_locator_concept.html b/develop/doc/html/reference/group___pixel_locator_concept.html index 922b0593c..fffd16955 100644 --- a/develop/doc/html/reference/group___pixel_locator_concept.html +++ b/develop/doc/html/reference/group___pixel_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -79,7 +79,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_locator_model.html b/develop/doc/html/reference/group___pixel_locator_model.html index c8796fb48..c42ed3481 100644 --- a/develop/doc/html/reference/group___pixel_locator_model.html +++ b/develop/doc/html/reference/group___pixel_locator_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,13 +52,13 @@

    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...
    + A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept. More...
      class  pixel_2d_locator_base< Loc, XIterator, YIterator > - base class for models of PixelLocatorConceptPixel 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: More...
    + base class for models of PixelLocatorConcept More...
      -class  memory_based_2d_locator< StepIterator > - Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConceptThe class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation. More...
    +class  memory_based_2d_locator + Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept. More...
     

    Detailed Description

    @@ -69,7 +69,7 @@ Classes diff --git a/develop/doc/html/reference/group___pixel_model.html b/develop/doc/html/reference/group___pixel_model.html index 3019eff7a..07e804f1f 100644 --- a/develop/doc/html/reference/group___pixel_model.html +++ b/develop/doc/html/reference/group___pixel_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,16 +52,16 @@

    Modules

     bit_aligned_pixel_reference - A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
    + A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
       packed_pixel - A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept.
    + A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept.
       pixel - A homogeneous pixel value. Models HomogeneousPixelValueConcept.
    + A homogeneous pixel value. Models HomogeneousPixelValueConcept.
       planar_pixel_reference - A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept.
    + A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept.
     

    Detailed Description

    @@ -72,7 +72,7 @@ Modules diff --git a/develop/doc/html/reference/group___pixel_model_non_aligned_pixel.html b/develop/doc/html/reference/group___pixel_model_non_aligned_pixel.html index 808ddc8f8..ecf51565e 100644 --- a/develop/doc/html/reference/group___pixel_model_non_aligned_pixel.html +++ b/develop/doc/html/reference/group___pixel_model_non_aligned_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_reference @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -44,10 +44,24 @@
    -

    A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept. +

    A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept. More...

    -

    A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.

    -

    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;
    // 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;
    assert(data == 0x04);
    get_color(ref, green_t()) = 3;
    assert(data == 0x1C);
    get_color(ref, blue_t()) = 7;
    assert(data == 0xFC);

    Heterogeneous pixel reference corresponding to non-byte-aligned bit range. Models ColorBaseConcept, PixelConcept, PixelBasedConcept

    +

    A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.

    +

    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;
    +
    +
    // 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;
    +
    assert(data == 0x04);
    +
    get_color(ref, green_t()) = 3;
    +
    assert(data == 0x1C);
    +
    get_color(ref, blue_t()) = 7;
    +
    assert(data == 0xFC);
    +

    Heterogeneous pixel reference corresponding to non-byte-aligned bit range. Models ColorBaseConcept, PixelConcept, PixelBasedConcept

    Template Parameters
    @@ -58,12 +72,14 @@ +
    color_element_reference_type< ColorBase, Color >::type get_color(ColorBase &cb, Color=Color())
    Mutable accessor to the element associated with a given color name.
    Definition: color_base_algorithm.hpp:190
    +
    layout< rgb_t > rgb_layout_t
    Definition: rgb.hpp:37
    diff --git a/develop/doc/html/reference/group___pixel_model_packed_pixel.html b/develop/doc/html/reference/group___pixel_model_packed_pixel.html index e5d6365d2..fd6c15b21 100644 --- a/develop/doc/html/reference/group___pixel_model_packed_pixel.html +++ b/develop/doc/html/reference/group___pixel_model_packed_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_pixel @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -46,24 +46,34 @@
    -

    A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept. +

    A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept. More...

    BitField
    - +

    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...
     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, "");
    rgb565_pixel_t r565;
    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));
    +

    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, "");
    +
    +
    rgb565_pixel_t r565;
    +
    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));
    +
    +
    color_element_reference_type< ColorBase, Color >::type get_color(ColorBase &cb, Color=Color())
    Mutable accessor to the element associated with a given color name.
    Definition: color_base_algorithm.hpp:190
    +
    layout< rgb_t > rgb_layout_t
    Definition: rgb.hpp:37
    diff --git a/develop/doc/html/reference/group___pixel_model_pixel.html b/develop/doc/html/reference/group___pixel_model_pixel.html index 1dd7c7434..a0e65d6a9 100644 --- a/develop/doc/html/reference/group___pixel_model_pixel.html +++ b/develop/doc/html/reference/group___pixel_model_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -46,24 +46,24 @@
    -

    A homogeneous pixel value. Models HomogeneousPixelValueConcept. +

    A homogeneous pixel value. Models HomogeneousPixelValueConcept. More...

    - +

    Classes

    struct  pixel< ChannelValue, Layout >
     Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
     Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
     

    Detailed Description

    -

    A homogeneous pixel value. Models HomogeneousPixelValueConcept.

    +

    A homogeneous pixel value. Models HomogeneousPixelValueConcept.

    diff --git a/develop/doc/html/reference/group___pixel_model_planar_ref.html b/develop/doc/html/reference/group___pixel_model_planar_ref.html index f1feeab06..55a690dc1 100644 --- a/develop/doc/html/reference/group___pixel_model_planar_ref.html +++ b/develop/doc/html/reference/group___pixel_model_planar_ref.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_reference @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -47,7 +47,7 @@
    -

    A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept. +

    A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept. More...

    - + - + - + - + - +

    @@ -56,48 +56,160 @@ Classes

     A reference proxy to a planar pixel. More...
     
    struct  is_pixel< planar_pixel_reference< ChannelReference, ColorSpace > >
     Metafunction predicate that flags planar_pixel_reference as a model of PixelConcept. Required by PixelConcept. More...
     Metafunction predicate that flags planar_pixel_reference as a model of PixelConcept. Required by PixelConcept. More...
     
    struct  color_space_type< planar_pixel_reference< ChannelReference, ColorSpace > >
     Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept. More...
     Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept. More...
     
    struct  channel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > >
     Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept. More...
     Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept. More...
     
    struct  is_planar< planar_pixel_reference< ChannelReference, ColorSpace > >
     Specifies that planar_pixel_reference represents a planar construct. Required by PixelBasedConcept. More...
     Specifies that planar_pixel_reference represents a planar construct. Required by PixelBasedConcept. More...
     
    struct  channel_type< planar_pixel_reference< ChannelReference, ColorSpace > >
     Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept. More...
     Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept. More...
     
    - + - + - + - + - + - +

    Functions

    -template<typename CR , typename CS , typename R >
    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
     swap for planar_pixel_reference More...
     
    -template<typename CR , typename CS >
    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
     swap for planar_pixel_reference More...
     
    -template<typename CR , typename CS >
    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
     swap for planar_pixel_reference More...
     

    Detailed Description

    -

    A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept.

    +

    A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept.

    +

    Function Documentation

    + +

    ◆ swap() [1/3]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    void std::swap (const boost::gil::planar_pixel_reference< CR, CS > x,
    const boost::gil::planar_pixel_reference< CR, CS > y 
    )
    +
    +inline
    +
    + +

    swap for planar_pixel_reference

    + +
    +
    + +

    ◆ swap() [2/3]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    void std::swap (const boost::gil::planar_pixel_reference< CR, CS > x,
    R & y 
    )
    +
    +inline
    +
    + +

    swap for planar_pixel_reference

    + +
    +
    + +

    ◆ swap() [3/3]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    void std::swap (typename boost::gil::planar_pixel_reference< CR, CS >::value_type & x,
    const boost::gil::planar_pixel_reference< CR, CS > y 
    )
    +
    +inline
    +
    + +

    swap for planar_pixel_reference

    + +
    +
    diff --git a/develop/doc/html/reference/group___point.html b/develop/doc/html/reference/group___point.html index 27945773b..c833b48d3 100644 --- a/develop/doc/html/reference/group___point.html +++ b/develop/doc/html/reference/group___point.html @@ -4,7 +4,7 @@ - + Generic Image Library: Point @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -69,7 +69,7 @@ Modules diff --git a/develop/doc/html/reference/group___point_algorithm.html b/develop/doc/html/reference/group___point_algorithm.html index 8973aba83..4e7db4e16 100644 --- a/develop/doc/html/reference/group___point_algorithm.html +++ b/develop/doc/html/reference/group___point_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,38 +51,216 @@ - - + + - + - + - + - + - + - +

    Functions

    -template<typename T >
    point< std::ptrdiff_t > iround (point< T > const &p)
    template<typename T >
    point< std::ptrdiff_t > iround (point< T > const &p)
     
    -point< std::ptrdiff_t > iround (point< float > const &p)
    point< std::ptrdiff_t > iround (point< float > const &p)
     
    -point< std::ptrdiff_t > iround (point< double > const &p)
    point< std::ptrdiff_t > iround (point< double > const &p)
     
    -point< std::ptrdiff_t > ifloor (point< float > const &p)
    point< std::ptrdiff_t > ifloor (point< float > const &p)
     
    -point< std::ptrdiff_t > ifloor (point< double > const &p)
    point< std::ptrdiff_t > ifloor (point< double > const &p)
     
    -point< std::ptrdiff_t > iceil (point< float > const &p)
    point< std::ptrdiff_t > iceil (point< float > const &p)
     
    -point< std::ptrdiff_t > iceil (point< double > const &p)
    point< std::ptrdiff_t > iceil (point< double > const &p)
     

    Detailed Description

    Algorithms and Utility Functions for points.

    -

    Example:

    assert(iround(point<double>(3.1, 3.9)) == point<std::ptrdiff_t>(3,4));
    +

    Example:

    assert(iround(point<double>(3.1, 3.9)) == point<std::ptrdiff_t>(3,4));
    +

    Function Documentation

    + +

    ◆ iceil() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    point<std::ptrdiff_t> boost::gil::iceil (point< double > const & p)
    +
    +inline
    +
    + +
    +
    + +

    ◆ iceil() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    point<std::ptrdiff_t> boost::gil::iceil (point< float > const & p)
    +
    +inline
    +
    + +
    +
    + +

    ◆ ifloor() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    point<std::ptrdiff_t> boost::gil::ifloor (point< double > const & p)
    +
    +inline
    +
    + +
    +
    + +

    ◆ ifloor() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    point<std::ptrdiff_t> boost::gil::ifloor (point< float > const & p)
    +
    +inline
    +
    + +
    +
    + +

    ◆ iround() [1/3]

    + +
    +
    + + + + + +
    + + + + + + + + +
    point<std::ptrdiff_t> boost::gil::iround (point< double > const & p)
    +
    +inline
    +
    + +
    +
    + +

    ◆ iround() [2/3]

    + +
    +
    + + + + + +
    + + + + + + + + +
    point<std::ptrdiff_t> boost::gil::iround (point< float > const & p)
    +
    +inline
    +
    + +
    +
    + +

    ◆ iround() [3/3]

    + +
    +
    + + + + + +
    + + + + + + + + +
    point<std::ptrdiff_t> boost::gil::iround (point< T > const & p)
    +
    +inline
    +
    + +
    +
    +
    +
    point< std::ptrdiff_t > iround(point< T > const &p)
    Definition: point.hpp:249
    diff --git a/develop/doc/html/reference/group___point_concept.html b/develop/doc/html/reference/group___point_concept.html index f1233fce9..5c54025ad 100644 --- a/develop/doc/html/reference/group___point_concept.html +++ b/develop/doc/html/reference/group___point_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___point_model.html b/develop/doc/html/reference/group___point_model.html index 3450b638e..bdc48f1b6 100644 --- a/develop/doc/html/reference/group___point_model.html +++ b/develop/doc/html/reference/group___point_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -53,61 +53,321 @@

    Classes

    class  point< T > - 2D point both axes of which have the same dimension typeModels: Point2DConcept More...
    + 2D point both axes of which have the same dimension type More...
      - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +

    Functions

    -template<typename T >
    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)
     
    -template<typename T >
    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)
     
    -template<typename T >
    BOOST_FORCEINLINE point< T > 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)
     
    -template<typename T >
    BOOST_FORCEINLINE point< T > operator- (const point< T > &p)
    template<typename T >
    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)
    template<typename T >
    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
    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
     
    -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
    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
     
    -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
    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
     
    -template<std::size_t K, typename T >
    BOOST_FORCEINLINE T const & axis_value (point< T > const &p)
    template<std::size_t K, typename T >
    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)
    template<std::size_t K, typename T >
    BOOST_FORCEINLINE T & axis_value (point< T > &p)
     

    Detailed Description

    Models for points.

    -

    Example:

    point<std::ptrdiff_t> p(3,2);
    assert((p[0] == p.x) && (p[1] == p.y));
    assert(axis_value<0>(p) == 3);
    assert(axis_value<1>(p) == 2);
    +

    Example:

    point<std::ptrdiff_t> p(3,2);
    +
    assert((p[0] == p.x) && (p[1] == p.y));
    +
    assert(axis_value<0>(p) == 3);
    +
    assert(axis_value<1>(p) == 2);
    +

    Function Documentation

    + +

    ◆ axis_value() [1/2]

    + +
    +
    + + + + + + + + +
    BOOST_FORCEINLINE T& boost::gil::axis_value (point< T > & p)
    +
    + +
    +
    + +

    ◆ axis_value() [2/2]

    + +
    +
    + + + + + + + + +
    BOOST_FORCEINLINE T const& boost::gil::axis_value (point< T > const & p)
    +
    + +
    +
    + +

    ◆ operator!=()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE bool boost::gil::operator!= (const point< T > & p1,
    const point< T > & p2 
    )
    +
    + +
    +
    + +

    ◆ operator*() [1/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE auto boost::gil::operator* (m,
    point< T > const & p 
    ) -> typename std::enable_if + < + std::is_arithmetic<M>::value, + point<typename detail::std_common_type<T, M>::type> + >::type +
    +
    + +
    +
    + +

    ◆ operator*() [2/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE auto boost::gil::operator* (point< T > const & p,
    m 
    ) -> typename std::enable_if + < + std::is_arithmetic<M>::value, + point<typename detail::std_common_type<T, M>::type> + >::type +
    +
    + +
    +
    + +

    ◆ operator+()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE point<T> boost::gil::operator+ (const point< T > & p1,
    const point< T > & p2 
    )
    +
    + +
    +
    + +

    ◆ operator-() [1/2]

    + +
    +
    + + + + + + + + +
    BOOST_FORCEINLINE point<T> boost::gil::operator- (const point< T > & p)
    +
    + +
    +
    + +

    ◆ operator-() [2/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE point<T> boost::gil::operator- (const point< T > & p1,
    const point< T > & p2 
    )
    +
    + +
    +
    + +

    ◆ operator/()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE auto boost::gil::operator/ (point< T > const & p,
    d 
    ) -> typename std::enable_if + < + std::is_arithmetic<D>::value, + point<typename detail::std_common_type<T, D>::type> + >::type +
    +
    + +
    +
    + +

    ◆ operator==()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    BOOST_FORCEINLINE bool boost::gil::operator== (const point< T > & p1,
    const point< T > & p2 
    )
    +
    + +
    +
    +
    diff --git a/develop/doc/html/reference/group___s_t_l_optimizations.html b/develop/doc/html/reference/group___s_t_l_optimizations.html index 6492b980c..c6c05ec8c 100644 --- a/develop/doc/html/reference/group___s_t_l_optimizations.html +++ b/develop/doc/html/reference/group___s_t_l_optimizations.html @@ -4,7 +4,7 @@ - + Generic Image Library: Performance overloads of STL algorithms @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,22 +51,22 @@ - - - - @@ -83,7 +83,9 @@ template<typename IL , typename OL >

    Detailed Description

    overloads of STL algorithms allowing more efficient implementation when used with GIL constructs

    Function Documentation

    - + +

    ◆ equal()

    +

    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 boost::gil::pixel< T, CS > * copy (const boost::gil::pixel< T, CS > *first, const boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst)
     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 boost::gil::planar_pixel_iterator< IC2, CS > 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)
     Copy when both src and dst are planar pointers is copy for each channel.
     
    +
    template<typename IL , typename OL >
    BOOST_FORCEINLINE boost::gil::iterator_from_2d< OL > copy1 (boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst)
     std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
    @@ -118,7 +120,9 @@ template<typename IL , typename OL > - + +

    ◆ fill()

    +
    @@ -159,7 +163,7 @@ template<typename IL , typename OL > diff --git a/develop/doc/html/reference/group___scaling_algorithms.html b/develop/doc/html/reference/group___scaling_algorithms.html index 439b96f03..5a0f41ac8 100644 --- a/develop/doc/html/reference/group___scaling_algorithms.html +++ b/develop/doc/html/reference/group___scaling_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: ScalingAlgorithms @@ -27,16 +27,16 @@
    - - + + + + +
    @@ -64,7 +64,7 @@ Modules diff --git a/develop/doc/html/reference/group___scoped_channel_value.html b/develop/doc/html/reference/group___scoped_channel_value.html index aeb941944..7e1952002 100644 --- a/develop/doc/html/reference/group___scoped_channel_value.html +++ b/develop/doc/html/reference/group___scoped_channel_value.html @@ -4,7 +4,7 @@ - + Generic Image Library: scoped_channel_value @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,14 +52,36 @@ Modules
     

    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 = ...;
    static const bool is_mutable;
    static value_type min_value();
    static value_type max_value();
    };

    A channel adaptor that modifies the range of the source channel. Models: ChannelValueConcept

    -

    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>;
    // channel_convert its maximum should map to the maximum
    bits64custom_t x = channel_traits<bits64custom_t>::max_value();
    assert(x == 0.5);
    uint16_t y = channel_convert<uint16_t>(x);
    assert(y == 65535);
    +

    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 = ...;
    +
    +
    static const bool is_mutable;
    +
    static value_type min_value();
    +
    static value_type max_value();
    +
    };
    +

    A channel adaptor that modifies the range of the source channel. Models: ChannelValueConcept

    +

    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>;
    +
    +
    // channel_convert its maximum should map to the maximum
    +
    bits64custom_t x = channel_traits<bits64custom_t>::max_value();
    +
    assert(x == 0.5);
    +
    uint16_t y = channel_convert<uint16_t>(x);
    +
    assert(y == 65535);
    +
    diff --git a/develop/doc/html/reference/group___t_i_f_f___i_o.html b/develop/doc/html/reference/group___t_i_f_f___i_o.html index efcf88d68..2af74530b 100644 --- a/develop/doc/html/reference/group___t_i_f_f___i_o.html +++ b/develop/doc/html/reference/group___t_i_f_f___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: TIFF I/O @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -53,7 +53,7 @@ diff --git a/develop/doc/html/reference/group___type_analysis.html b/develop/doc/html/reference/group___type_analysis.html index 17ec6fe9c..c377bbb4c 100644 --- a/develop/doc/html/reference/group___type_analysis.html +++ b/develop/doc/html/reference/group___type_analysis.html @@ -4,7 +4,7 @@ - + Generic Image Library: Type Analysis Metafunctions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -79,7 +79,7 @@ Classes diff --git a/develop/doc/html/reference/group___type_factory.html b/develop/doc/html/reference/group___type_factory.html index 4b0cdf26b..8b8eff24a 100644 --- a/develop/doc/html/reference/group___type_factory.html +++ b/develop/doc/html/reference/group___type_factory.html @@ -4,7 +4,7 @@ - + Generic Image Library: Type Factory Metafunctions @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -65,7 +65,7 @@ Modules

    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...
    + 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...
     

    Detailed Description

    @@ -76,7 +76,7 @@ Classes diff --git a/develop/doc/html/reference/group___type_factory_derived.html b/develop/doc/html/reference/group___type_factory_derived.html index 1a1c6a07a..5096a7d49 100644 --- a/develop/doc/html/reference/group___type_factory_derived.html +++ b/develop/doc/html/reference/group___type_factory_derived.html @@ -4,7 +4,7 @@ - + Generic Image Library: derived_xxx_type @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -52,16 +52,16 @@

    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...
    + Constructs a pixel reference type from a source pixel reference type by changing some of the properties. More...
      class  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. More...
    + Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties. More...
      class  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. More...
    + Constructs an image view type from a source view type by changing some of the properties. More...
      class  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. More...
    + Constructs a homogeneous image type from a source image type by changing some of the properties. More...
     

    Detailed Description

    @@ -72,7 +72,7 @@ Classes diff --git a/develop/doc/html/reference/group___type_factory_from_elements.html b/develop/doc/html/reference/group___type_factory_from_elements.html index cfbe9b5fb..e402cd1a5 100644 --- a/develop/doc/html/reference/group___type_factory_from_elements.html +++ b/develop/doc/html/reference/group___type_factory_from_elements.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_type @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -89,7 +89,7 @@ Classes diff --git a/develop/doc/html/reference/group___type_factory_from_pixel.html b/develop/doc/html/reference/group___type_factory_from_pixel.html index e7727e705..533a8c2ae 100644 --- a/develop/doc/html/reference/group___type_factory_from_pixel.html +++ b/develop/doc/html/reference/group___type_factory_from_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_type_from_pixel @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -66,7 +66,7 @@ Classes diff --git a/develop/doc/html/reference/group___type_factory_packed.html b/develop/doc/html/reference/group___type_factory_packed.html index a873672e8..ef506c89f 100644 --- a/develop/doc/html/reference/group___type_factory_packed.html +++ b/develop/doc/html/reference/group___type_factory_packed.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_image_type,bit_aligned_image_type @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -90,8 +90,8 @@ Classes

    Detailed Description

    Returns the type of an image whose channels are not byte-aligned.

    -

    A packed image is an image whose pixels are byte aligned, such as "rgb565".
    - A bit-aligned image is an image whose pixels are not byte aligned, such as "rgb222".
    +

    A packed image is an image whose pixels are byte aligned, such as "rgb565".
    + A bit-aligned image is an image whose pixels are not byte aligned, such as "rgb222".

    The sum of the bit sizes of all channels cannot exceed 64.

    @@ -100,7 +100,7 @@ Classes diff --git a/develop/doc/html/reference/group___variant.html b/develop/doc/html/reference/group___variant.html index 635d9acb1..cffcf7550 100644 --- a/develop/doc/html/reference/group___variant.html +++ b/develop/doc/html/reference/group___variant.html @@ -4,7 +4,7 @@ - + Generic Image Library: Variant @@ -27,16 +27,16 @@

    - - + + + + +
    @@ -51,12 +51,12 @@ - - @@ -70,7 +70,7 @@ template<typename Variant1 , typename Variant2 , typename Visitor > < diff --git a/develop/doc/html/reference/harris_8hpp_source.html b/develop/doc/html/reference/harris_8hpp_source.html index 7cce87385..716015a9f 100644 --- a/develop/doc/html/reference/harris_8hpp_source.html +++ b/develop/doc/html/reference/harris_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: harris.hpp Source File @@ -27,21 +27,16 @@
    - - - + + + + +
    -
    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/extension/numeric/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,
    38  boost::gil::detail::kernel_2d<T, Allocator> weights,
    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  auto 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
    Definition: algorithm.hpp:30
    -
    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 responsesThis algorithm computes Harris responses for structure tensor repr...
    Definition: harris.hpp:34
    +
    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/extension/numeric/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,
    +
    38  boost::gil::detail::kernel_2d<T, Allocator> weights,
    +
    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
    +
    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
    diff --git a/develop/doc/html/reference/hessian_8hpp_source.html b/develop/doc/html/reference/hessian_8hpp_source.html index c0c9119e1..00ac6ed1b 100644 --- a/develop/doc/html/reference/hessian_8hpp_source.html +++ b/develop/doc/html/reference/hessian_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: hessian.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    1 #ifndef BOOST_GIL_IMAGE_PROCESSING_HESSIAN_HPP
    2 #define BOOST_GIL_IMAGE_PROCESSING_HESSIAN_HPP
    3 
    4 #include <boost/gil/image_view.hpp>
    5 #include <boost/gil/typedefs.hpp>
    6 #include <boost/gil/extension/numeric/kernel.hpp>
    7 #include <stdexcept>
    8 
    9 namespace boost { namespace gil {
    10 
    19 template <typename GradientView, typename T, typename Allocator, typename OutputView>
    20 inline void compute_hessian_responses(
    21  GradientView ddxx,
    22  GradientView dxdy,
    23  GradientView ddyy,
    24  const detail::kernel_2d<T, Allocator>& weights,
    25  OutputView dst)
    26 {
    27  if (ddxx.dimensions() != ddyy.dimensions()
    28  || ddyy.dimensions() != dxdy.dimensions()
    29  || dxdy.dimensions() != dst.dimensions()
    30  || weights.center_x() != weights.center_y())
    31  {
    32  throw std::invalid_argument("dimensions of views are not the same"
    33  " or weights don't have equal width and height"
    34  " or weights' dimensions are not odd");
    35  }
    36  // Use pixel type of output, as values will be written to output
    37  using pixel_t = typename std::remove_reference<decltype(std::declval<OutputView>()(0, 0))>::type;
    38 
    39  using channel_t = typename std::remove_reference
    40  <
    41  decltype(std::declval<pixel_t>().at(std::integral_constant<int, 0>{}))
    42  >::type;
    43 
    44 
    45  auto center = weights.center_y();
    46  for (auto y = center; y < dst.height() - center; ++y)
    47  {
    48  for (auto x = center; x < dst.width() - center; ++x)
    49  {
    50  auto ddxx_i = channel_t();
    51  auto ddyy_i = channel_t();
    52  auto dxdy_i = channel_t();
    53  for (typename OutputView::coord_t w_y = 0; w_y < weights.size(); ++w_y)
    54  {
    55  for (typename OutputView::coord_t w_x = 0; w_x < weights.size(); ++w_x)
    56  {
    57  ddxx_i += ddxx(x + w_x - center, y + w_y - center)
    58  .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
    59  ddyy_i += ddyy(x + w_x - center, y + w_y - center)
    60  .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
    61  dxdy_i += dxdy(x + w_x - center, y + w_y - center)
    62  .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
    63  }
    64  }
    65  auto determinant = ddxx_i * ddyy_i - dxdy_i * dxdy_i;
    66  dst(x, y).at(std::integral_constant<int, 0>{}) = determinant;
    67  }
    68  }
    69 }
    70 
    71 }} // namespace boost::gil
    72 
    73 #endif
    Definition: algorithm.hpp:30
    +
    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/extension/numeric/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
    diff --git a/develop/doc/html/reference/hierarchy.html b/develop/doc/html/reference/hierarchy.html index 17b7622b3..4aec708eb 100644 --- a/develop/doc/html/reference/hierarchy.html +++ b/develop/doc/html/reference/hierarchy.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class Hierarchy @@ -27,24 +27,16 @@

    - - - + + + + +
    @@ -54,25 +46,25 @@
    This inheritance list is sorted roughly, but not completely, alphabetically:
    [detail level 123]

    Functions

    +
    template<typename Variant1 , typename Visitor >
    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.
    - - + + - + - + - + - + - + - + - + @@ -85,7 +77,7 @@ - + @@ -100,7 +92,7 @@ - + @@ -115,10 +107,10 @@ - + - + @@ -130,7 +122,7 @@ - + @@ -145,239 +137,245 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Calpha_tAlpha
     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
     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
     Cbinary_operation_obj< Derived, Result >A generic binary operation on viewsUse 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
     Cbinary_operation_obj< Derived, Result >A generic binary operation on views
     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, Alloc >
     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, Alloc >
     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, Alloc >
     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, Alloc >
     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, Alloc >
     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_aligned_pixel_iterator< NonAlignedPixelReference >An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
     Cbit_range< RangeSize, IsMutable >
     Cbit_range< bit_size, IsMutable >
     Cblack_tBlack
     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_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_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< float32_t >Specialization of channel_multiply for float 0..1 channels
     Cchannel_type< memory_based_2d_locator< SI >::parent_t >
     Cchannel_type< Pixel >
     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< 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< XIt >
     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
     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_converted_view_type< View, DstP, CC >
     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
     CColorBaseValueConcept< ColorBase >Color base that also has a default-constructor. Refines Regular
     CColorBaseValueConcept< ColorBase >Color base that also has a default-constructor. Refines Regular
     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
     CCopyConstructible< T >Concept of copy construction requirement
     Ccyan_tCyan
     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_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_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, CC >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
     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
     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_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
     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
     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
     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
     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
     Cdevicen_color_t< N >Unnamed color
     Cdevicen_t< N >Unnamed color space of 1, 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< 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 >
     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
     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
     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_is_step< V::xy_locator::x_iterator >
     Citerator_is_step< V::xy_locator::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
     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.If the input is a pixel value or constant reference, the function object is immutable. Otherwise it is mutable (and returns non-const reference to the k-th channel)
     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.If the channels in the source view are adjacent in memory (such as planar non-step view or single-channel view) then the return view is a single-channel non-step view. If the channels are non-adjacent (interleaved and/or step view) then the return view is a single-channel step 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.If the input is a pixel value or constant reference, the function object is immutable. Otherwise it is mutable (and returns non-const reference to the n-th channel)
     Cnth_channel_view_type< View >Given a source image view type View, returns the type of an image view over a single channel of ViewIf the channels in the source view are adjacent in memory (such as planar non-step view or single-channel view) then the return view is a single-channel non-step view. If the channels are non-adjacent (interleaved and/or step view) then the return view is a single-channel step 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, Alloc >
     Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2 >, Layout, Alloc >
     Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3 >, Layout, Alloc >
     Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4 >, Layout, Alloc >
     Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4, Size5 >, Layout, Alloc >
     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 PixelLocatorConceptPixel 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:
     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_is_reference< Pixel >Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value)
     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
     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 >
     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 >
     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_x_step_type< IteratorOrLocatorOrView >Base template for types that model HasDynamicXStepTypeConcept
     Cdynamic_x_step_type< const Pixel * >
     Cdynamic_x_step_type< Pixel * >
     Cdynamic_xy_step_type< View >Returns the type of a view that has a dynamic step along both X and Y
     Cdynamic_xy_step_type< transposed_type< View >::type >
     Cdynamic_y_step_type< LocatorOrView >Base template for types that model HasDynamicYStepTypeConcept
     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
     Chough_parameter< T >A type to encapsulate Hough transform parameter range
     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_is_step< V::xy_locator ::x_iterator >
     Citerator_is_step< V::xy_locator ::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
     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
     Cmemory_based_2d_locatorMemory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept
     Cmemory_based_step_iteratorMEMORY-BASED STEP ITERATOR
     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< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
     Cpixel_is_reference< Pixel >Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value)
     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
     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 type
     CPoint2DConcept< P >2-dimensional point concept
     Cpoint< std::ptrdiff_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
     Cstencil_5points5 point stencil approximation of Laplacian
     Cstencil_9points_standard9 point stencil approximation of Laplacian
     Cstep_iterator_adaptor< Derived, Iterator, SFn >An adaptor over an existing iterator that changes the step unit
     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, false >
     CViewsCompatibleConcept< V1, V2 >Views are compatible if they have the same color spaces and compatible channel values
     Cyellow_tYellow
    @@ -386,7 +384,7 @@ diff --git a/develop/doc/html/reference/histogram_8hpp_source.html b/develop/doc/html/reference/histogram_8hpp_source.html new file mode 100644 index 000000000..845cba47c --- /dev/null +++ b/develop/doc/html/reference/histogram_8hpp_source.html @@ -0,0 +1,671 @@ + + + + + + + + + Generic Image Library: histogram.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    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 <iostream>
    +
    21 #include <tuple>
    +
    22 #include <utility>
    +
    23 #include <vector>
    +
    24 #include <type_traits>
    +
    25 #include <map>
    +
    26 #include <unordered_map>
    +
    27 
    +
    28 namespace boost { namespace gil {
    +
    29 
    +
    38 
    +
    39 namespace detail {
    +
    40 
    +
    43 
    +
    46 template <std::size_t Index, typename... T>
    +
    47 inline typename std::enable_if<Index == sizeof...(T), void>::type
    +
    48  hash_tuple_impl(std::size_t&, std::tuple<T...> const&)
    +
    49 {
    +
    50 }
    +
    51 
    +
    54 template <std::size_t Index, typename... T>
    +
    55 inline typename std::enable_if<Index != sizeof...(T), void>::type
    +
    56  hash_tuple_impl(std::size_t& seed, std::tuple<T...> const& t)
    +
    57 {
    +
    58  boost::hash_combine(seed, std::get<Index>(t));
    +
    59  hash_tuple_impl<Index + 1>(seed, t);
    +
    60 }
    +
    61 
    +
    71 template <typename... T>
    +
    72 struct hash_tuple
    +
    73 {
    +
    74  std::size_t operator()(std::tuple<T...> const& t) const
    +
    75  {
    +
    76  std::size_t seed = 0;
    +
    77  hash_tuple_impl<0>(seed, t);
    +
    78  return seed;
    +
    79  }
    +
    80 };
    +
    81 
    +
    85 template <typename Pixel, std::size_t... I>
    +
    86 auto pixel_to_tuple(Pixel const& p, boost::mp11::index_sequence<I...>)
    +
    87  -> decltype(std::make_tuple(p[I]...))
    +
    88 {
    +
    89  return std::make_tuple(p[I]...);
    +
    90 }
    +
    91 
    +
    95 template <typename Tuple, std::size_t... I>
    +
    96 auto tuple_to_tuple(Tuple const& t, boost::mp11::index_sequence<I...>)
    +
    97  -> decltype(std::make_tuple(std::get<I>(t)...))
    +
    98 {
    +
    99  return std::make_tuple(std::get<I>(t)...);
    +
    100 }
    +
    101 
    +
    104 template <typename Tuple, std::size_t... I>
    +
    105 bool tuple_compare(Tuple const& t1, Tuple const& t2, boost::mp11::index_sequence<I...>)
    +
    106 {
    +
    107  std::array<bool, std::tuple_size<Tuple>::value> comp_list;
    +
    108  comp_list = {std::get<I>(t1) <= std::get<I>(t2)...};
    +
    109  bool comp = true;
    +
    110  for (std::size_t i = 0; i < comp_list.size(); i++)
    +
    111  {
    +
    112  comp = comp & comp_list[i];
    +
    113  }
    +
    114  return comp;
    +
    115 }
    +
    116 
    +
    122 template <typename Tuple>
    +
    123 bool tuple_compare(Tuple const& t1, Tuple const& t2)
    +
    124 {
    +
    125  std::size_t const tuple_size = std::tuple_size<Tuple>::value;
    +
    126  auto index_list = boost::mp11::make_index_sequence<tuple_size>{};
    +
    127  return tuple_compare(t1, t2, index_list);
    +
    128 }
    +
    129 
    +
    134 template <typename Tuple>
    + +
    136 {
    +
    137  static constexpr Tuple min()
    +
    138  {
    +
    139  return min_impl(boost::mp11::make_index_sequence<std::tuple_size<Tuple>::value>{});
    +
    140  }
    +
    141  static constexpr Tuple max()
    +
    142  {
    +
    143  return max_impl(boost::mp11::make_index_sequence<std::tuple_size<Tuple>::value>{});
    +
    144  }
    +
    145 
    +
    146 private:
    +
    147  template <std::size_t... I>
    +
    148  static constexpr Tuple min_impl(boost::mp11::index_sequence<I...>)
    +
    149  {
    +
    150  return std::make_tuple(
    +
    151  std::numeric_limits<typename std::tuple_element<I, Tuple>::type>::min()...);
    +
    152  }
    +
    153 
    +
    154  template <std::size_t... I>
    +
    155  static constexpr Tuple max_impl(boost::mp11::index_sequence<I...>)
    +
    156  {
    +
    157  return std::make_tuple(
    +
    158  std::numeric_limits<typename std::tuple_element<I, Tuple>::type>::max()...);
    +
    159  }
    +
    160 };
    +
    161 
    +
    169 template <std::size_t Dimension>
    +
    170 struct filler
    +
    171 {
    +
    172  template <typename Container, typename Tuple>
    +
    173  void operator()(Container&, Tuple&, Tuple&, std::size_t)
    +
    174  {
    +
    175  }
    +
    176 };
    +
    177 
    +
    180 template <>
    +
    181 struct filler<1>
    +
    182 {
    +
    183  template <typename Container, typename Tuple>
    +
    184  void operator()(Container& hist, Tuple& lower, Tuple& upper, std::size_t bin_width = 1)
    +
    185  {
    +
    186  for (auto i = std::get<0>(lower); static_cast<std::size_t>(std::get<0>(upper) - i) >= bin_width; i += bin_width)
    +
    187  {
    +
    188  hist(i / bin_width) = 0;
    +
    189  }
    +
    190  hist(std::get<0>(upper) / bin_width) = 0;
    +
    191  }
    +
    192 };
    +
    193 
    +
    194 } //namespace detail
    +
    195 
    +
    211 template <typename... T>
    +
    212 class histogram : public std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>
    +
    213 {
    +
    214  using base_t = std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>;
    +
    215  using bin_t = boost::mp11::mp_list<T...>;
    +
    216  using key_t = typename base_t::key_type;
    +
    217  using mapped_t = typename base_t::mapped_type;
    +
    218  using value_t = typename base_t::value_type;
    +
    219 
    +
    220 public:
    +
    221  histogram() = default;
    +
    222 
    +
    224  static constexpr std::size_t dimension()
    +
    225  {
    +
    226  return std::tuple_size<key_t>::value;
    +
    227  }
    +
    228 
    +
    230  mapped_t& operator()(T... indices)
    +
    231  {
    +
    232  auto key = std::make_tuple(indices...);
    +
    233  std::size_t const index_dimension = std::tuple_size<std::tuple<T...>>::value;
    +
    234  std::size_t const histogram_dimension = dimension();
    +
    235  static_assert(histogram_dimension == index_dimension, "Dimensions do not match.");
    +
    236 
    +
    237  return base_t::operator[](key);
    +
    238  }
    +
    239 
    +
    242  template <typename OtherType>
    +
    243  bool equals(OtherType const& otherhist) const
    +
    244  {
    +
    245  bool check = (dimension() == otherhist.dimension());
    +
    246 
    +
    247  using other_value_t = typename OtherType::value_type;
    +
    248  std::for_each(otherhist.begin(), otherhist.end(), [&](other_value_t const& v) {
    +
    249  key_t key = key_from_tuple(v.first);
    +
    250  if (base_t::find(key) != base_t::end())
    +
    251  {
    +
    252  check = check & (base_t::at(key) == otherhist.at(v.first));
    +
    253  }
    +
    254  else
    +
    255  {
    +
    256  check = false;
    +
    257  }
    +
    258  });
    +
    259  return check;
    +
    260  }
    +
    261 
    +
    264  static constexpr bool is_pixel_compatible()
    +
    265  {
    +
    266  using bin_types = boost::mp11::mp_list<T...>;
    +
    267  return boost::mp11::mp_all_of<bin_types, std::is_arithmetic>::value;
    +
    268  }
    +
    269 
    +
    272  template <typename Tuple>
    +
    273  bool is_tuple_compatible(Tuple const&)
    +
    274  {
    +
    275  std::size_t const tuple_size = std::tuple_size<Tuple>::value;
    +
    276  std::size_t const histogram_size = dimension();
    +
    277  // TODO : Explore consequence of using if-constexpr
    +
    278  using sequence_type = typename std::conditional
    +
    279  <
    +
    280  tuple_size >= histogram_size,
    +
    281  boost::mp11::make_index_sequence<histogram_size>,
    +
    282  boost::mp11::make_index_sequence<tuple_size>
    +
    283  >::type;
    +
    284 
    +
    285  if (is_tuple_size_compatible<Tuple>())
    +
    286  return is_tuple_type_compatible<Tuple>(sequence_type{});
    +
    287  else
    +
    288  return false;
    +
    289  }
    +
    290 
    +
    293  template <std::size_t... Dimensions, typename Tuple>
    +
    294  key_t key_from_tuple(Tuple const& t) const
    +
    295  {
    +
    296  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
    +
    297  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
    +
    298  std::size_t const tuple_size = std::tuple_size<Tuple>::value;
    +
    299  std::size_t const histogram_dimension = dimension();
    +
    300 
    +
    301  static_assert(
    +
    302  ((index_list_size != 0 && index_list_size == histogram_dimension) ||
    +
    303  (tuple_size == histogram_dimension)),
    +
    304  "Tuple and histogram key of different sizes");
    +
    305 
    +
    306  using new_index_list = typename std::conditional
    +
    307  <
    +
    308  index_list_size == 0,
    +
    309  boost::mp11::mp_list_c<std::size_t, 0>,
    +
    310  index_list
    +
    311  >::type;
    +
    312 
    +
    313  std::size_t const min =
    +
    314  boost::mp11::mp_min_element<new_index_list, boost::mp11::mp_less>::value;
    +
    315 
    +
    316  std::size_t const max =
    +
    317  boost::mp11::mp_max_element<new_index_list, boost::mp11::mp_less>::value;
    +
    318 
    +
    319  static_assert((0 <= min && max < tuple_size) || index_list_size == 0, "Index out of Range");
    +
    320 
    +
    321  using seq1 = boost::mp11::make_index_sequence<histogram_dimension>;
    +
    322  using seq2 = boost::mp11::index_sequence<Dimensions...>;
    +
    323  // TODO : Explore consequence of using if-constexpr
    +
    324  using sequence_type = typename std::conditional<index_list_size == 0, seq1, seq2>::type;
    +
    325 
    +
    326  auto key = detail::tuple_to_tuple(t, sequence_type{});
    +
    327  static_assert(
    +
    328  is_tuple_type_compatible<Tuple>(seq1{}),
    +
    329  "Tuple type and histogram type not compatible.");
    +
    330 
    +
    331  return make_histogram_key(key, seq1{});
    +
    332  }
    +
    333 
    +
    336  template <std::size_t... Dimensions, typename Pixel>
    +
    337  key_t key_from_pixel(Pixel const& p) const
    +
    338  {
    +
    339  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
    +
    340  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
    +
    341  std::size_t const pixel_dimension = num_channels<Pixel>::value;
    +
    342  std::size_t const histogram_dimension = dimension();
    +
    343 
    +
    344  static_assert(
    +
    345  ((index_list_size != 0 && index_list_size == histogram_dimension) ||
    +
    346  (index_list_size == 0 && pixel_dimension == histogram_dimension)) &&
    +
    347  is_pixel_compatible(),
    +
    348  "Pixels and histogram key are not compatible.");
    +
    349 
    +
    350  using new_index_list = typename std::conditional
    +
    351  <
    +
    352  index_list_size == 0,
    +
    353  boost::mp11::mp_list_c<std::size_t, 0>,
    +
    354  index_list
    +
    355  >::type;
    +
    356 
    +
    357  std::size_t const min =
    +
    358  boost::mp11::mp_min_element<new_index_list, boost::mp11::mp_less>::value;
    +
    359 
    +
    360  std::size_t const max =
    +
    361  boost::mp11::mp_max_element<new_index_list, boost::mp11::mp_less>::value;
    +
    362 
    +
    363  static_assert(
    +
    364  (0 <= min && max < pixel_dimension) || index_list_size == 0, "Index out of Range");
    +
    365 
    +
    366  using seq1 = boost::mp11::make_index_sequence<histogram_dimension>;
    +
    367  using seq2 = boost::mp11::index_sequence<Dimensions...>;
    +
    368  using sequence_type = typename std::conditional<index_list_size == 0, seq1, seq2>::type;
    +
    369 
    +
    370  auto key = detail::pixel_to_tuple(p, sequence_type{});
    +
    371  return make_histogram_key(key, seq1{});
    +
    372  }
    +
    373 
    +
    375  key_t nearest_key(key_t const& k) const
    +
    376  {
    +
    377  using check_list = boost::mp11::mp_list<boost::has_less<T>...>;
    +
    378  static_assert(
    +
    379  boost::mp11::mp_all_of<check_list, boost::mp11::mp_to_bool>::value,
    +
    380  "Keys are not comparable.");
    +
    381  auto nearest_k = k;
    +
    382  if (base_t::find(k) != base_t::end())
    +
    383  {
    +
    384  return nearest_k;
    +
    385  }
    +
    386  else
    +
    387  {
    +
    388  bool once = true;
    +
    389  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    390  if (v.first <= k)
    +
    391  {
    +
    392  if (once)
    +
    393  {
    +
    394  once = !once;
    +
    395  nearest_k = v.first;
    +
    396  }
    +
    397  else if (nearest_k < v.first)
    +
    398  nearest_k = v.first;
    +
    399  }
    +
    400  });
    +
    401  return nearest_k;
    +
    402  }
    +
    403  }
    +
    404 
    +
    406  template <std::size_t... Dimensions, typename SrcView>
    +
    407  void fill(
    +
    408  SrcView const& srcview,
    +
    409  std::size_t bin_width = 1,
    +
    410  bool applymask = false,
    +
    411  std::vector<std::vector<bool>> mask = {},
    +
    412  key_t lower = key_t(),
    +
    413  key_t upper = key_t(),
    +
    414  bool setlimits = false)
    +
    415  {
    +
    416  gil_function_requires<ImageViewConcept<SrcView>>();
    +
    417  using channel_t = typename channel_type<SrcView>::type;
    +
    418 
    +
    419  for (std::ptrdiff_t src_y = 0; src_y < srcview.height(); ++src_y)
    +
    420  {
    +
    421  auto src_it = srcview.row_begin(src_y);
    +
    422  for (std::ptrdiff_t src_x = 0; src_x < srcview.width(); ++src_x)
    +
    423  {
    +
    424  if (applymask && !mask[src_y][src_x])
    +
    425  continue;
    +
    426  auto scaled_px = src_it[src_x];
    +
    427  static_for_each(scaled_px, [&](channel_t& ch) {
    +
    428  ch = ch / bin_width;
    +
    429  });
    +
    430  auto key = key_from_pixel<Dimensions...>(scaled_px);
    +
    431  if (!setlimits ||
    +
    432  (detail::tuple_compare(lower, key) && detail::tuple_compare(key, upper)))
    +
    433  base_t::operator[](key)++;
    +
    434  }
    +
    435  }
    +
    436  }
    +
    437 
    +
    439  template <std::size_t... Dimensions, typename Tuple>
    +
    440  histogram sub_histogram(Tuple const& t1, Tuple const& t2)
    +
    441  {
    +
    442  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
    +
    443  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
    +
    444  std::size_t const histogram_dimension = dimension();
    +
    445 
    +
    446  std::size_t const min =
    +
    447  boost::mp11::mp_min_element<index_list, boost::mp11::mp_less>::value;
    +
    448 
    +
    449  std::size_t const max =
    +
    450  boost::mp11::mp_max_element<index_list, boost::mp11::mp_less>::value;
    +
    451 
    +
    452  static_assert(
    +
    453  (0 <= min && max < histogram_dimension) && index_list_size < histogram_dimension,
    +
    454  "Index out of Range");
    +
    455 
    +
    456  using seq1 = boost::mp11::make_index_sequence<dimension()>;
    +
    457  using seq2 = boost::mp11::index_sequence<Dimensions...>;
    +
    458 
    +
    459  static_assert(
    +
    460  is_tuple_type_compatible<Tuple>(seq1{}),
    +
    461  "Tuple type and histogram type not compatible.");
    +
    462 
    +
    463  auto low = make_histogram_key(t1, seq1{});
    +
    464  auto low_key = detail::tuple_to_tuple(low, seq2{});
    +
    465  auto high = make_histogram_key(t2, seq1{});
    +
    466  auto high_key = detail::tuple_to_tuple(high, seq2{});
    +
    467 
    +
    468  histogram sub_h;
    +
    469  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& k) {
    +
    470  auto tmp_key = detail::tuple_to_tuple(k.first, seq2{});
    +
    471  if (low_key <= tmp_key && tmp_key <= high_key)
    +
    472  sub_h[k.first] += base_t::operator[](k.first);
    +
    473  });
    +
    474  return sub_h;
    +
    475  }
    +
    476 
    +
    478  template <std::size_t... Dimensions>
    + +
    480  {
    +
    481  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
    +
    482  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
    +
    483  std::size_t const histogram_dimension = dimension();
    +
    484 
    +
    485  std::size_t const min =
    +
    486  boost::mp11::mp_min_element<index_list, boost::mp11::mp_less>::value;
    +
    487 
    +
    488  std::size_t const max =
    +
    489  boost::mp11::mp_max_element<index_list, boost::mp11::mp_less>::value;
    +
    490 
    +
    491  static_assert(
    +
    492  (0 <= min && max < histogram_dimension) && index_list_size < histogram_dimension,
    +
    493  "Index out of Range");
    +
    494 
    + +
    496 
    +
    497  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    498  auto sub_key =
    +
    499  detail::tuple_to_tuple(v.first, boost::mp11::index_sequence<Dimensions...>{});
    +
    500  sub_h[sub_key] += base_t::operator[](v.first);
    +
    501  });
    +
    502  return sub_h;
    +
    503  }
    +
    504 
    +
    506  void normalize()
    +
    507  {
    +
    508  double sum = 0.0;
    +
    509  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    510  sum += v.second;
    +
    511  });
    +
    512  // std::cout<<(long int)sum<<"asfe";
    +
    513  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    514  base_t::operator[](v.first) = v.second / sum;
    +
    515  });
    +
    516  }
    +
    517 
    +
    519  double sum() const
    +
    520  {
    +
    521  double sum = 0.0;
    +
    522  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    523  sum += v.second;
    +
    524  });
    +
    525  return sum;
    +
    526  }
    +
    527 
    +
    529  key_t min_key() const
    +
    530  {
    +
    531  key_t min_key = base_t::begin()->first;
    +
    532  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    533  if (v.first < min_key)
    +
    534  min_key = v.first;
    +
    535  });
    +
    536  return min_key;
    +
    537  }
    +
    538 
    +
    540  key_t max_key() const
    +
    541  {
    +
    542  key_t max_key = base_t::begin()->first;
    +
    543  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    544  if (v.first > max_key)
    +
    545  max_key = v.first;
    +
    546  });
    +
    547  return max_key;
    +
    548  }
    +
    549 
    +
    551  std::vector<key_t> sorted_keys() const
    +
    552  {
    +
    553  std::vector<key_t> sorted_keys;
    +
    554  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
    +
    555  sorted_keys.push_back(v.first);
    +
    556  });
    +
    557  std::sort(sorted_keys.begin(), sorted_keys.end());
    +
    558  return sorted_keys;
    +
    559  }
    +
    560 
    +
    561 private:
    +
    562  template <typename Tuple, std::size_t... I>
    +
    563  key_t make_histogram_key(Tuple const& t, boost::mp11::index_sequence<I...>) const
    +
    564  {
    +
    565  return std::make_tuple(
    +
    566  static_cast<typename boost::mp11::mp_at<bin_t, boost::mp11::mp_size_t<I>>>(
    +
    567  std::get<I>(t))...);
    +
    568  }
    +
    569 
    +
    570  template <typename Tuple, std::size_t... I>
    +
    571  static constexpr bool is_tuple_type_compatible(boost::mp11::index_sequence<I...>)
    +
    572  {
    +
    573  using tp = boost::mp11::mp_list
    +
    574  <
    +
    575  typename std::is_convertible
    +
    576  <
    +
    577  boost::mp11::mp_at<bin_t, boost::mp11::mp_size_t<I>>,
    +
    578  typename std::tuple_element<I, Tuple>::type
    +
    579  >::type...
    +
    580  >;
    +
    581  return boost::mp11::mp_all_of<tp, boost::mp11::mp_to_bool>::value;
    +
    582  }
    +
    583 
    +
    584  template <typename Tuple>
    +
    585  static constexpr bool is_tuple_size_compatible()
    +
    586  {
    +
    587  return (std::tuple_size<Tuple>::value == dimension());
    +
    588  }
    +
    589 };
    +
    590 
    +
    605 template <typename SrcView, typename Container>
    +
    606 void fill_histogram(SrcView const&, Container&);
    +
    607 
    +
    629 template <std::size_t... Dimensions, typename SrcView, typename... T>
    +
    630 void fill_histogram(
    +
    631  SrcView const& srcview,
    +
    632  histogram<T...>& hist,
    +
    633  std::size_t bin_width = 1,
    +
    634  bool accumulate = false,
    +
    635  bool sparsefill = true,
    +
    636  bool applymask = false,
    +
    637  std::vector<std::vector<bool>> mask = {},
    +
    638  typename histogram<T...>::key_type lower =
    +
    639  detail::tuple_limit<typename histogram<T...>::key_type>::min(),
    +
    640  typename histogram<T...>::key_type upper =
    +
    641  detail::tuple_limit<typename histogram<T...>::key_type>::max(),
    +
    642  bool setlimits = false)
    +
    643 {
    +
    644  if (!accumulate)
    +
    645  hist.clear();
    +
    646 
    +
    647  detail::filler<histogram<T...>::dimension()> f;
    +
    648  if (!sparsefill)
    +
    649  f(hist, lower, upper, bin_width);
    +
    650 
    +
    651  hist.template fill<Dimensions...>(srcview, bin_width, applymask, mask, lower, upper, setlimits);
    +
    652 }
    +
    653 
    +
    666 template <typename Container>
    +
    667 Container cumulative_histogram(Container const&);
    +
    668 
    +
    669 template <typename... T>
    +
    670 histogram<T...> cumulative_histogram(histogram<T...> const& hist)
    +
    671 {
    +
    672  using check_list = boost::mp11::mp_list<boost::has_less<T>...>;
    +
    673  static_assert(
    +
    674  boost::mp11::mp_all_of<check_list, boost::mp11::mp_to_bool>::value,
    +
    675  "Cumulative histogram not possible of this type");
    +
    676 
    +
    677  using histogram_t = histogram<T...>;
    +
    678  using pair_t = std::pair<typename histogram_t::key_type, typename histogram_t::mapped_type>;
    +
    679  using value_t = typename histogram_t::value_type;
    +
    680 
    +
    681  histogram_t cumulative_hist;
    +
    682  std::size_t const dims = histogram_t::dimension();
    +
    683  if (dims == 1)
    +
    684  {
    +
    685  std::vector<pair_t> sorted_keys(hist.size());
    +
    686  std::size_t counter = 0;
    +
    687  std::for_each(hist.begin(), hist.end(), [&](value_t const& v) {
    +
    688  sorted_keys[counter++] = std::make_pair(v.first, v.second);
    +
    689  });
    +
    690  std::sort(sorted_keys.begin(), sorted_keys.end());
    +
    691  auto cumulative_counter = static_cast<typename histogram_t::mapped_type>(0);
    +
    692  for (std::size_t i = 0; i < sorted_keys.size(); ++i)
    +
    693  {
    +
    694  cumulative_counter += sorted_keys[i].second;
    +
    695  cumulative_hist[(sorted_keys[i].first)] = cumulative_counter;
    +
    696  }
    +
    697  }
    +
    698  else
    +
    699  {
    +
    700  std::for_each(hist.begin(), hist.end(), [&](value_t const& v1) {
    +
    701  auto cumulative_counter = static_cast<typename histogram_t::mapped_type>(0);
    +
    702  std::for_each(hist.begin(), hist.end(), [&](value_t const& v2) {
    +
    703  bool comp = detail::tuple_compare(
    +
    704  v2.first, v1.first,
    +
    705  boost::mp11::make_index_sequence<histogram_t::dimension()>{});
    +
    706  if (comp)
    +
    707  cumulative_counter += hist.at(v2.first);
    +
    708  });
    +
    709  cumulative_hist[v1.first] = cumulative_counter;
    +
    710  });
    +
    711  }
    +
    712  return cumulative_hist;
    +
    713 }
    +
    714 
    +
    715 }} //namespace boost::gil
    +
    716 
    +
    717 #endif
    +
    +
    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:243
    +
    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:337
    +
    key_t min_key() const
    Return the minimum key in histogram.
    Definition: histogram.hpp:529
    +
    Filler is used to fill the histogram class with all values between a specified range This functor is ...
    Definition: histogram.hpp:170
    +
    key_t max_key() const
    Return the maximum key in histogram.
    Definition: histogram.hpp:540
    +
    Provides equivalent of std::numeric_limits for type std::tuple tuple_limit gets called with only tupl...
    Definition: histogram.hpp:135
    +
    bool is_tuple_compatible(Tuple const &)
    Checks if the histogram class is compatible to be used with the specified tuple type.
    Definition: histogram.hpp:273
    +
    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:123
    +
    auto pixel_to_tuple(Pixel const &p, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(p[I]...))
    Definition: histogram.hpp:86
    +
    void normalize()
    Normalize this histogram class.
    Definition: histogram.hpp:506
    +
    Functor provided for the hashing of tuples. The following approach makes use hash_combine from boost:...
    Definition: histogram.hpp:72
    +
    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:479
    +
    static constexpr std::size_t dimension()
    Returns the number of dimensions(axes) the class supports.
    Definition: histogram.hpp:224
    +
    double sum() const
    Return the sum count of all bins.
    Definition: histogram.hpp:519
    +
    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:294
    +
    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:407
    +
    key_t nearest_key(key_t const &k) const
    Return nearest smaller key to specified histogram key.
    Definition: histogram.hpp:375
    +
    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:359
    +
    mapped_t & operator()(T... indices)
    Returns bin value corresponding to specified tuple.
    Definition: histogram.hpp:230
    +
    static constexpr bool is_pixel_compatible()
    Checks if the histogram class is compatible to be used with a GIL image type.
    Definition: histogram.hpp:264
    +
    std::vector< key_t > sorted_keys() const
    Return sorted keys in a vector.
    Definition: histogram.hpp:551
    +
    histogram sub_histogram(Tuple const &t1, Tuple const &t2)
    Can return a subset or a mask over the current histogram.
    Definition: histogram.hpp:440
    +
    Definition: color_convert.hpp:31
    +
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    +
    Default histogram class provided by boost::gil.
    Definition: histogram.hpp:212
    +
    auto tuple_to_tuple(Tuple const &t, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(std::get< I >(t)...))
    Definition: histogram.hpp:96
    + + + + + + diff --git a/develop/doc/html/reference/histogram__equalization_8hpp_source.html b/develop/doc/html/reference/histogram__equalization_8hpp_source.html new file mode 100644 index 000000000..8293fae15 --- /dev/null +++ b/develop/doc/html/reference/histogram__equalization_8hpp_source.html @@ -0,0 +1,169 @@ + + + + + + + + + Generic Image Library: histogram_equalization.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    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 
    +
    20 
    +
    36 
    +
    44 template <typename SrcKeyType>
    +
    45 std::map<SrcKeyType, SrcKeyType> histogram_equalization(histogram<SrcKeyType> const& src_hist)
    +
    46 {
    +
    47  histogram<SrcKeyType> dst_hist;
    +
    48  return histogram_equalization(src_hist, dst_hist);
    +
    49 }
    +
    50 
    +
    61 template <typename SrcKeyType, typename DstKeyType>
    +
    62 std::map<SrcKeyType, DstKeyType>
    +
    63  histogram_equalization(histogram<SrcKeyType> const& src_hist, histogram<DstKeyType>& dst_hist)
    +
    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
    +
    +
    nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
    Definition: image_view_factory.hpp:418
    + + + + + + diff --git a/develop/doc/html/reference/histogram__matching_8hpp_source.html b/develop/doc/html/reference/histogram__matching_8hpp_source.html new file mode 100644 index 000000000..e617388ef --- /dev/null +++ b/develop/doc/html/reference/histogram__matching_8hpp_source.html @@ -0,0 +1,221 @@ + + + + + + + + + Generic Image Library: histogram_matching.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    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 std::map<SrcKeyType, SrcKeyType>
    +
    47  histogram_matching(histogram<SrcKeyType> const& src_hist, histogram<RefKeyType> const& ref_hist)
    +
    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 std::map<SrcKeyType, DstKeyType> histogram_matching(
    +
    67  histogram<SrcKeyType> const& src_hist,
    +
    68  histogram<RefKeyType> const& ref_hist,
    +
    69  histogram<DstKeyType>& dst_hist)
    +
    70 {
    +
    71  static_assert(
    +
    72  std::is_integral<SrcKeyType>::value &&
    +
    73  std::is_integral<RefKeyType>::value &&
    +
    74  std::is_integral<DstKeyType>::value,
    +
    75  "Source, Refernce or Destination histogram type is not appropriate.");
    +
    76 
    +
    77  using value_t = typename histogram<SrcKeyType>::value_type;
    +
    78  dst_hist.clear();
    +
    79  double src_sum = src_hist.sum();
    +
    80  double ref_sum = ref_hist.sum();
    +
    81  auto cumltv_srchist = cumulative_histogram(src_hist);
    +
    82  auto cumltv_refhist = cumulative_histogram(ref_hist);
    +
    83  std::map<SrcKeyType, RefKeyType> inverse_mapping;
    +
    84 
    +
    85  std::vector<typename histogram<RefKeyType>::key_type> src_keys, ref_keys;
    +
    86  src_keys = src_hist.sorted_keys();
    +
    87  ref_keys = ref_hist.sorted_keys();
    +
    88  std::ptrdiff_t start = ref_keys.size() - 1;
    +
    89  RefKeyType ref_max;
    +
    90  if (start >= 0)
    +
    91  ref_max = std::get<0>(ref_keys[start]);
    +
    92 
    +
    93  for (std::ptrdiff_t j = src_keys.size() - 1; j >= 0; --j)
    +
    94  {
    +
    95  double src_val = (cumltv_srchist[src_keys[j]] * ref_sum) / src_sum;
    +
    96  while (cumltv_refhist[ref_keys[start]] > src_val && start > 0)
    +
    97  {
    +
    98  start--;
    +
    99  }
    +
    100  if (std::abs(cumltv_refhist[ref_keys[start]] - src_val) >
    +
    101  std::abs(cumltv_refhist(std::min<RefKeyType>(ref_max, std::get<0>(ref_keys[start + 1]))) -
    +
    102  src_val))
    +
    103  {
    +
    104  inverse_mapping[std::get<0>(src_keys[j])] =
    +
    105  std::min<RefKeyType>(ref_max, std::get<0>(ref_keys[start + 1]));
    +
    106  }
    +
    107  else
    +
    108  {
    +
    109  inverse_mapping[std::get<0>(src_keys[j])] = std::get<0>(ref_keys[start]);
    +
    110  }
    +
    111  if (j == 0)
    +
    112  break;
    +
    113  }
    +
    114  std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
    +
    115  dst_hist[inverse_mapping[std::get<0>(v.first)]] += v.second;
    +
    116  });
    +
    117  return inverse_mapping;
    +
    118 }
    +
    119 
    +
    133 template <typename SrcView, typename ReferenceView, typename DstView>
    +
    134 void histogram_matching(
    +
    135  SrcView const& src_view,
    +
    136  ReferenceView const& ref_view,
    +
    137  DstView const& dst_view,
    +
    138  std::size_t bin_width = 1,
    +
    139  bool mask = false,
    +
    140  std::vector<std::vector<bool>> src_mask = {},
    +
    141  std::vector<std::vector<bool>> ref_mask = {})
    +
    142 {
    +
    143  gil_function_requires<ImageViewConcept<SrcView>>();
    +
    144  gil_function_requires<ImageViewConcept<ReferenceView>>();
    +
    145  gil_function_requires<MutableImageViewConcept<DstView>>();
    +
    146 
    +
    147  static_assert(
    +
    148  color_spaces_are_compatible<
    +
    149  typename color_space_type<SrcView>::type,
    +
    150  typename color_space_type<ReferenceView>::type>::value,
    +
    151  "Source and reference view must have same color space");
    +
    152 
    +
    153  static_assert(
    +
    154  color_spaces_are_compatible<
    +
    155  typename color_space_type<SrcView>::type,
    +
    156  typename color_space_type<DstView>::type>::value,
    +
    157  "Source and destination view must have same color space");
    +
    158 
    +
    159  // Defining channel type
    +
    160  using source_channel_t = typename channel_type<SrcView>::type;
    +
    161  using ref_channel_t = typename channel_type<ReferenceView>::type;
    +
    162  using dst_channel_t = typename channel_type<DstView>::type;
    +
    163  using coord_t = typename SrcView::x_coord_t;
    +
    164 
    +
    165  std::size_t const channels = num_channels<SrcView>::value;
    +
    166  coord_t const width = src_view.width();
    +
    167  coord_t const height = src_view.height();
    +
    168  source_channel_t src_pixel_min = std::numeric_limits<source_channel_t>::min();
    +
    169  source_channel_t src_pixel_max = std::numeric_limits<source_channel_t>::max();
    +
    170  ref_channel_t ref_pixel_min = std::numeric_limits<ref_channel_t>::min();
    +
    171  ref_channel_t ref_pixel_max = std::numeric_limits<ref_channel_t>::max();
    +
    172  dst_channel_t dst_pixel_min = std::numeric_limits<dst_channel_t>::min();
    +
    173  dst_channel_t dst_pixel_max = std::numeric_limits<dst_channel_t>::max();
    +
    174 
    +
    175  for (std::size_t i = 0; i < channels; i++)
    +
    176  {
    +
    177  histogram<source_channel_t> src_histogram;
    +
    178  histogram<ref_channel_t> ref_histogram;
    +
    179  fill_histogram(
    +
    180  nth_channel_view(src_view, i), src_histogram, bin_width, false, false, mask, src_mask,
    +
    181  std::tuple<source_channel_t>(src_pixel_min),
    +
    182  std::tuple<source_channel_t>(src_pixel_max), true);
    +
    183  fill_histogram(
    +
    184  nth_channel_view(ref_view, i), ref_histogram, bin_width, false, false, mask, ref_mask,
    +
    185  std::tuple<ref_channel_t>(ref_pixel_min), std::tuple<ref_channel_t>(ref_pixel_max),
    +
    186  true);
    +
    187  auto inverse_mapping = histogram_matching(src_histogram, ref_histogram);
    +
    188  for (std::ptrdiff_t src_y = 0; src_y < height; ++src_y)
    +
    189  {
    +
    190  auto src_it = nth_channel_view(src_view, i).row_begin(src_y);
    +
    191  auto dst_it = nth_channel_view(dst_view, i).row_begin(src_y);
    +
    192  for (std::ptrdiff_t src_x = 0; src_x < width; ++src_x)
    +
    193  {
    +
    194  if (mask && !src_mask[src_y][src_x])
    +
    195  dst_it[src_x][0] = src_it[src_x][0];
    +
    196  else
    +
    197  dst_it[src_x][0] =
    +
    198  static_cast<dst_channel_t>(inverse_mapping[src_it[src_x][0]]);
    +
    199  }
    +
    200  }
    +
    201  }
    +
    202 }
    +
    203 
    +
    204 }} //namespace boost::gil
    +
    205 
    +
    206 #endif
    +
    +
    nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
    Definition: image_view_factory.hpp:418
    + + + + + + diff --git a/develop/doc/html/reference/hough__parameter_8hpp_source.html b/develop/doc/html/reference/hough__parameter_8hpp_source.html new file mode 100644 index 000000000..d728e459f --- /dev/null +++ b/develop/doc/html/reference/hough__parameter_8hpp_source.html @@ -0,0 +1,141 @@ + + + + + + + + + Generic Image Library: hough_parameter.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    hough_parameter.hpp
    +
    +
    +
    1 // Boost.GIL (Generic Image Library) - tests
    +
    2 //
    +
    3 // Copyright 2020 Olzhas Zhumabek <anonymous.from.applecity@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_HOUGH_PARAMETER_HPP
    +
    10 #define BOOST_GIL_IMAGE_PROCESSING_HOUGH_PARAMETER_HPP
    +
    11 
    +
    12 #include <boost/gil/point.hpp>
    +
    13 #include <cmath>
    +
    14 #include <cstddef>
    +
    15 
    +
    16 namespace boost
    +
    17 {
    +
    18 namespace gil
    +
    19 {
    +
    25 template <typename T>
    + +
    27 {
    +
    28  T start_point;
    +
    29  T step_size;
    +
    30  std::size_t step_count;
    +
    31 
    +
    38  static hough_parameter<T> from_step_count(T start_point, T neighborhood,
    +
    39  std::size_t half_step_count)
    +
    40  {
    +
    41  T step_size = neighborhood / half_step_count;
    +
    42  std::size_t step_count = half_step_count * 2 + 1;
    +
    43  // explicitly fill out members, as aggregate init will error out with narrowing
    +
    44  hough_parameter<T> parameter;
    +
    45  parameter.start_point = start_point - neighborhood;
    +
    46  parameter.step_size = step_size;
    +
    47  parameter.step_count = step_count;
    +
    48  return parameter;
    +
    49  }
    +
    50 
    +
    57  static hough_parameter<T> from_step_size(T start_point, T neighborhood, T step_size)
    +
    58  {
    +
    59  std::size_t step_count =
    +
    60  2 * static_cast<std::size_t>(std::floor(neighborhood / step_size)) + 1;
    +
    61  // do not use step_size - neighborhood, as step_size might not allow
    +
    62  // landing exactly on that value when starting from start_point
    +
    63  // also use parentheses on step_count / 2 because flooring is exactly
    +
    64  // what we want
    +
    65 
    +
    66  // explicitly fill out members, as aggregate init will error out with narrowing
    +
    67  hough_parameter<T> parameter;
    +
    68  parameter.start_point = start_point - step_size * (step_count / 2);
    +
    69  parameter.step_size = step_size;
    +
    70  parameter.step_count = step_count;
    +
    71  return parameter;
    +
    72  }
    +
    73 };
    +
    74 
    +
    85 inline double minimum_angle_step(point_t dimensions)
    +
    86 {
    +
    87  auto longer_dimension = dimensions.x > dimensions.y ? dimensions.x : dimensions.y;
    +
    88  return std::atan2(1, longer_dimension);
    +
    89 }
    +
    90 
    +
    101 inline hough_parameter<double> make_theta_parameter(double approx_angle, double neighborhood,
    +
    102  point_t dimensions)
    +
    103 {
    +
    104  auto angle_step = minimum_angle_step(dimensions);
    +
    105 
    +
    106  // std::size_t step_count =
    +
    107  // 2 * static_cast<std::size_t>(std::floor(neighborhood / angle_step)) + 1;
    +
    108  // return {approx_angle - angle_step * (step_count / 2), angle_step, step_count};
    +
    109  return hough_parameter<double>::from_step_size(approx_angle, neighborhood, angle_step);
    +
    110 }
    +
    111 }} // namespace boost::gil
    +
    112 #endif
    +
    +
    static hough_parameter< T > from_step_count(T start_point, T neighborhood, std::size_t half_step_count)
    Create Hough parameter from value neighborhood and step count.
    Definition: hough_parameter.hpp:38
    +
    double minimum_angle_step(point_t dimensions)
    Calculate minimum angle which would be observable if walked on a circle.
    Definition: hough_parameter.hpp:85
    +
    hough_parameter< double > make_theta_parameter(double approx_angle, double neighborhood, point_t dimensions)
    Create a Hough transform parameter with optimal angle step.
    Definition: hough_parameter.hpp:101
    +
    A type to encapsulate Hough transform parameter range.
    Definition: hough_parameter.hpp:26
    +
    static hough_parameter< T > from_step_size(T start_point, T neighborhood, T step_size)
    Create Hough parameter from value neighborhood and step size.
    Definition: hough_parameter.hpp:57
    + + + + + + + diff --git a/develop/doc/html/reference/hough__transform_8hpp_source.html b/develop/doc/html/reference/hough__transform_8hpp_source.html new file mode 100644 index 000000000..6f980302d --- /dev/null +++ b/develop/doc/html/reference/hough__transform_8hpp_source.html @@ -0,0 +1,181 @@ + + + + + + + + + Generic Image Library: hough_transform.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    hough_transform.hpp
    +
    +
    +
    1 // Boost.GIL (Generic Image Library) - tests
    +
    2 //
    +
    3 // Copyright 2020 Olzhas Zhumabek <anonymous.from.applecity@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_HOUGH_TRANSFORM_HPP
    +
    10 #define BOOST_GIL_IMAGE_PROCESSING_HOUGH_TRANSFORM_HPP
    +
    11 
    +
    12 #include <algorithm>
    +
    13 #include <boost/gil/image_processing/hough_parameter.hpp>
    +
    14 #include <boost/gil/rasterization/circle.hpp>
    +
    15 #include <cmath>
    +
    16 #include <cstddef>
    +
    17 #include <iterator>
    +
    18 #include <vector>
    +
    19 
    +
    20 namespace boost { namespace gil {
    +
    29 
    +
    36 template <typename InputView, typename OutputView>
    +
    37 void hough_line_transform(const InputView& input_view, const OutputView& accumulator_array,
    +
    38  const hough_parameter<double>& theta,
    +
    39  const hough_parameter<std::ptrdiff_t>& radius)
    +
    40 {
    +
    41  std::ptrdiff_t r_lower_bound = radius.start_point;
    +
    42  std::ptrdiff_t r_upper_bound = r_lower_bound + radius.step_size * (radius.step_count - 1);
    +
    43 
    +
    44  for (std::ptrdiff_t y = 0; y < input_view.height(); ++y)
    +
    45  {
    +
    46  for (std::ptrdiff_t x = 0; x < input_view.width(); ++x)
    +
    47  {
    +
    48  if (!input_view(x, y)[0])
    +
    49  {
    +
    50  continue;
    +
    51  }
    +
    52 
    +
    53  for (std::size_t theta_index = 0; theta_index < theta.step_count; ++theta_index)
    +
    54  {
    +
    55  double theta_current =
    +
    56  theta.start_point + theta.step_size * static_cast<double>(theta_index);
    +
    57  std::ptrdiff_t current_r =
    +
    58  std::llround(static_cast<double>(x) * std::cos(theta_current) +
    +
    59  static_cast<double>(y) * std::sin(theta_current));
    +
    60  if (current_r < r_lower_bound || current_r > r_upper_bound)
    +
    61  {
    +
    62  continue;
    +
    63  }
    +
    64  std::size_t r_index = static_cast<std::size_t>(
    +
    65  std::llround((current_r - radius.start_point) / radius.step_size));
    +
    66  // one more safety guard to not get out of bounds
    +
    67  if (r_index < radius.step_count)
    +
    68  {
    +
    69  accumulator_array(theta_index, r_index)[0] += 1;
    +
    70  }
    +
    71  }
    +
    72  }
    +
    73  }
    +
    74 }
    +
    75 
    +
    83 template <typename ImageView, typename ForwardIterator, typename Rasterizer>
    +
    84 void hough_circle_transform_brute(const ImageView& input,
    +
    85  const hough_parameter<std::ptrdiff_t> radius_parameter,
    +
    86  const hough_parameter<std::ptrdiff_t> x_parameter,
    +
    87  const hough_parameter<std::ptrdiff_t>& y_parameter,
    +
    88  ForwardIterator d_first, Rasterizer rasterizer)
    +
    89 {
    +
    90  const auto width = input.width();
    +
    91  const auto height = input.height();
    +
    92  for (std::size_t radius_index = 0; radius_index < radius_parameter.step_count; ++radius_index)
    +
    93  {
    +
    94  const auto radius = radius_parameter.start_point +
    +
    95  radius_parameter.step_size * static_cast<std::ptrdiff_t>(radius_index);
    +
    96  std::vector<point_t> circle_points(rasterizer.point_count(radius));
    +
    97  rasterizer(radius, {0, 0}, circle_points.begin());
    +
    98  // sort by scanline to improve cache coherence for row major images
    +
    99  std::sort(circle_points.begin(), circle_points.end(),
    +
    100  [](const point_t& lhs, const point_t& rhs) { return lhs.y < rhs.y; });
    +
    101  const auto translate = [](std::vector<point_t>& points, point_t offset) {
    +
    102  std::transform(points.begin(), points.end(), points.begin(), [offset](point_t point) {
    +
    103  return point_t(point.x + offset.x, point.y + offset.y);
    +
    104  });
    +
    105  };
    +
    106 
    +
    107  // in case somebody passes iterator to likes of std::vector<bool>
    +
    108  typename std::iterator_traits<ForwardIterator>::reference current_image = *d_first;
    +
    109 
    +
    110  // the algorithm has to traverse over parameter space and look at input, instead
    +
    111  // of vice versa, as otherwise it will call translate too many times, as input
    +
    112  // is usually bigger than the coordinate portion of parameter space.
    +
    113  // This might cause extensive cache misses
    +
    114  for (std::size_t x_index = 0; x_index < x_parameter.step_count; ++x_index)
    +
    115  {
    +
    116  for (std::size_t y_index = 0; y_index < y_parameter.step_count; ++y_index)
    +
    117  {
    +
    118  const std::ptrdiff_t x = x_parameter.start_point + x_index * x_parameter.step_size;
    +
    119  const std::ptrdiff_t y = y_parameter.start_point + y_index * y_parameter.step_size;
    +
    120 
    +
    121  auto translated_circle = circle_points;
    +
    122  translate(translated_circle, {x, y});
    +
    123  for (const auto& point : translated_circle)
    +
    124  {
    +
    125  if (input(point))
    +
    126  {
    +
    127  ++current_image(x_index, y_index)[0];
    +
    128  }
    +
    129  }
    +
    130  }
    +
    131  }
    +
    132  ++d_first;
    +
    133  }
    +
    134 }
    +
    135 
    +
    136 }} // namespace boost::gil
    +
    137 
    +
    138 #endif
    +
    +
    A type to encapsulate Hough transform parameter range.
    Definition: hough_parameter.hpp:26
    +
    void hough_line_transform(const InputView &input_view, const OutputView &accumulator_array, const hough_parameter< double > &theta, const hough_parameter< std::ptrdiff_t > &radius)
    Vote for best fit of a line in parameter space.
    Definition: hough_transform.hpp:37
    + +
    void hough_circle_transform_brute(const ImageView &input, const hough_parameter< std::ptrdiff_t > radius_parameter, const hough_parameter< std::ptrdiff_t > x_parameter, const hough_parameter< std::ptrdiff_t > &y_parameter, ForwardIterator d_first, Rasterizer rasterizer)
    Vote for best fit of a circle in parameter space according to rasterizer.
    Definition: hough_transform.hpp:84
    + + + + + + diff --git a/develop/doc/html/reference/image_8hpp_source.html b/develop/doc/html/reference/image_8hpp_source.html index b70e8fe24..b02cbd6a5 100644 --- a/develop/doc/html/reference/image_8hpp_source.html +++ b/develop/doc/html/reference/image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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_HPP
    9 #define BOOST_GIL_IMAGE_HPP
    10 
    11 #include <boost/gil/algorithm.hpp>
    12 #include <boost/gil/image_view.hpp>
    13 #include <boost/gil/metafunctions.hpp>
    14 #include <boost/gil/detail/mp11.hpp>
    15 
    16 #include <boost/assert.hpp>
    17 #include <boost/core/exchange.hpp>
    18 
    19 #include <cstddef>
    20 #include <memory>
    21 #include <utility>
    22 #include <type_traits>
    23 
    24 namespace boost { namespace gil {
    25 
    39 
    40 template< typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> >
    41 class image
    42 {
    43 public:
    44 #if defined(BOOST_NO_CXX11_ALLOCATOR)
    45  using allocator_type = typename Alloc::template rebind<unsigned char>::other;
    46 #else
    47  using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
    48 #endif
    49  using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
    50  using const_view_t = typename view_t::const_t;
    51  using point_t = typename view_t::point_t;
    52  using coord_t = typename view_t::coord_t;
    53  using value_type = typename view_t::value_type;
    54  using x_coord_t = coord_t;
    55  using y_coord_t = coord_t;
    56 
    57  const point_t& dimensions() const { return _view.dimensions(); }
    58  x_coord_t width() const { return _view.width(); }
    59  y_coord_t height() const { return _view.height(); }
    60 
    61  explicit image(std::size_t alignment=0,
    62  const Alloc alloc_in = Alloc()) :
    63  _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}
    64 
    65  // Create with dimensions and optional initial value and alignment
    66  image(const point_t& dimensions,
    67  std::size_t alignment=0,
    68  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    69  , _allocated_bytes( 0 )
    70  {
    71  allocate_and_default_construct(dimensions);
    72  }
    73 
    74  image(x_coord_t width, y_coord_t height,
    75  std::size_t alignment=0,
    76  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    77  , _allocated_bytes( 0 )
    78  {
    79  allocate_and_default_construct(point_t(width,height));
    80  }
    81 
    82  image(const point_t& dimensions,
    83  const Pixel& p_in,
    84  std::size_t alignment = 0,
    85  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    86  , _allocated_bytes( 0 )
    87  {
    88  allocate_and_fill(dimensions, p_in);
    89  }
    90 
    91  image(x_coord_t width, y_coord_t height,
    92  const Pixel& p_in,
    93  std::size_t alignment = 0,
    94  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    95  , _allocated_bytes ( 0 )
    96  {
    97  allocate_and_fill(point_t(width,height),p_in);
    98  }
    99 
    100  image(const image& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    101  , _allocated_bytes( img._allocated_bytes )
    102  {
    103  allocate_and_copy(img.dimensions(),img._view);
    104  }
    105 
    106  template <typename P2, bool IP2, typename Alloc2>
    107  image(const image<P2,IP2,Alloc2>& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    108  , _allocated_bytes( img._allocated_bytes )
    109  {
    110  allocate_and_copy(img.dimensions(),img._view);
    111  }
    112 
    113  template <typename Loc,
    114  typename std::enable_if<pixels_are_compatible<typename Loc::value_type, Pixel>::value, int>::type = 0>
    115  image(const image_view<Loc>& view,
    116  std::size_t alignment = 0,
    117  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    118  , _allocated_bytes( 0 )
    119  {
    120  allocate_and_copy(view.dimensions(),view);
    121  }
    122 
    123  // TODO Optimization: use noexcept (requires _view to be nothrow copy constructible)
    124  image(image&& img) :
    125  _view(img._view),
    126  _memory(img._memory),
    127  _align_in_bytes(img._align_in_bytes),
    128  _alloc(std::move(img._alloc)),
    129  _allocated_bytes(img._allocated_bytes)
    130  {
    131  img._view = view_t();
    132  img._memory = nullptr;
    133  img._align_in_bytes = 0;
    134  img._allocated_bytes = 0;
    135  }
    136 
    137  image& operator=(const image& img)
    138  {
    139  if (dimensions() == img.dimensions())
    140  copy_pixels(img._view,_view);
    141  else
    142  {
    143  image tmp(img);
    144  swap(tmp);
    145  }
    146  return *this;
    147  }
    148 
    149  template <typename Img>
    150  image& operator=(const Img& img)
    151  {
    152  if (dimensions() == img.dimensions())
    153  copy_pixels(img._view,_view);
    154  else
    155  {
    156  image tmp(img);
    157  swap(tmp);
    158  }
    159  return *this;
    160  }
    161 
    162  private:
    163  using propagate_allocators = std::true_type;
    164  using no_propagate_allocators = std::false_type;
    165 
    166  template <class Alloc2>
    167  using choose_pocma = typename std::conditional<
    168  // TODO: Use std::allocator_traits<Allocator>::is_always_equal if available
    169  std::is_empty<Alloc2>::value,
    170  std::true_type,
    171  typename std::allocator_traits<Alloc2>::propagate_on_container_move_assignment::type
    172  >::type;
    173 
    174  static void exchange_memory(image& lhs, image& rhs)
    175  {
    176  lhs._memory = boost::exchange(rhs._memory, nullptr);
    177  lhs._align_in_bytes = boost::exchange(rhs._align_in_bytes, 0);
    178  lhs._allocated_bytes = boost::exchange(rhs._allocated_bytes, 0);
    179  lhs._view = boost::exchange(rhs._view, image::view_t{});
    180  };
    181 
    182  void move_assign(image& img, propagate_allocators) noexcept {
    183  // non-sticky allocator, can adopt the memory, fast
    184  destruct_pixels(_view);
    185  this->deallocate();
    186  this->_alloc = img._alloc;
    187  exchange_memory(*this, img);
    188  }
    189 
    190  void move_assign(image& img, no_propagate_allocators) {
    191  if (_alloc == img._alloc) {
    192  // allocator stuck to the rhs, but it's equivalent of ours, we can still adopt the memory
    193  destruct_pixels(_view);
    194  this->deallocate();
    195  exchange_memory(*this, img);
    196  } else {
    197  // cannot propagate the allocator and cannot adopt the memory
    198  if (img._memory)
    199  {
    200  allocate_and_copy(img.dimensions(), img._view);
    201  destruct_pixels(img._view);
    202  img.deallocate();
    203  img._view = image::view_t{};
    204  }
    205  else
    206  {
    207  destruct_pixels(this->_view);
    208  this->deallocate();
    209  this->_view = view_t{};
    210  }
    211  }
    212  }
    213 
    214  public:
    215  // TODO: Use noexcept(noexcept(move_assign(img, choose_pocma<allocator_type>{})))
    216  // But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 prevents it (fixed in GCC > 9)
    217  image& operator=(image&& img) {
    218  if (this != std::addressof(img))
    219  // Use rebinded alloc to choose pocma
    220  move_assign(img, choose_pocma<allocator_type>{});
    221 
    222  return *this;
    223  }
    224 
    225  ~image()
    226  {
    227  destruct_pixels(_view);
    228  deallocate();
    229  }
    230 
    231  Alloc& allocator() { return _alloc; }
    232  Alloc const& allocator() const { return _alloc; }
    233 
    234  void swap(image& img) // required by MutableContainerConcept
    235  {
    236  using std::swap;
    237  swap(_align_in_bytes, img._align_in_bytes);
    238  swap(_memory, img._memory);
    239  swap(_view, img._view);
    240  swap(_alloc, img._alloc);
    241  swap(_allocated_bytes, img._allocated_bytes );
    242  }
    243 
    245  // recreate
    247 
    248  // without Allocator
    249  void recreate(const point_t& dims, std::size_t alignment = 0)
    250  {
    251  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    252  return;
    253 
    254  _align_in_bytes = alignment;
    255 
    256  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    257  {
    258  destruct_pixels(_view);
    259  create_view(dims, std::integral_constant<bool, IsPlanar>());
    261  }
    262  else
    263  {
    264  image tmp(dims, alignment);
    265  swap(tmp);
    266  }
    267  }
    268 
    269  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment = 0)
    270  {
    271  recreate(point_t(width, height), alignment);
    272  }
    273 
    274  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment = 0)
    275  {
    276  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    277  return;
    278 
    279  _align_in_bytes = alignment;
    280 
    281  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    282  {
    283  destruct_pixels(_view);
    284  create_view(dims, typename std::integral_constant<bool, IsPlanar>());
    285  uninitialized_fill_pixels(_view, p_in);
    286  }
    287  else
    288  {
    289  image tmp(dims, p_in, alignment);
    290  swap(tmp);
    291  }
    292  }
    293 
    294  void recreate( x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment = 0 )
    295  {
    296  recreate( point_t( width, height ), p_in, alignment );
    297  }
    298 
    299  // with Allocator
    300  void recreate(const point_t& dims, std::size_t alignment, const Alloc alloc_in)
    301  {
    302  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    303  return;
    304 
    305  _align_in_bytes = alignment;
    306 
    307  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    308  {
    309  destruct_pixels(_view);
    310  create_view(dims, std::integral_constant<bool, IsPlanar>());
    312  }
    313  else
    314  {
    315  image tmp(dims, alignment, alloc_in);
    316  swap(tmp);
    317  }
    318  }
    319 
    320  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
    321  {
    322  recreate(point_t(width, height), alignment, alloc_in);
    323  }
    324 
    325  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in)
    326  {
    327  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    328  return;
    329 
    330  _align_in_bytes = alignment;
    331 
    332  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    333  {
    334  destruct_pixels(_view);
    335  create_view(dims, std::integral_constant<bool, IsPlanar>());
    336  uninitialized_fill_pixels(_view, p_in);
    337  }
    338  else
    339  {
    340  image tmp(dims, p_in, alignment, alloc_in);
    341  swap(tmp);
    342  }
    343  }
    344 
    345  void recreate(x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in )
    346  {
    347  recreate(point_t(width, height), p_in, alignment, alloc_in);
    348  }
    349 
    350  view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels
    351 
    352  // for construction from other type
    353  template <typename P2, bool IP2, typename Alloc2> friend class image;
    354 private:
    355  unsigned char* _memory;
    356  std::size_t _align_in_bytes;
    357  allocator_type _alloc;
    358 
    359  std::size_t _allocated_bytes;
    360 
    361  void allocate_and_default_construct(point_t const& dimensions)
    362  {
    363  try
    364  {
    365  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    367  }
    368  catch (...) { deallocate(); throw; }
    369  }
    370 
    371  void allocate_and_fill(const point_t& dimensions, Pixel const& p_in)
    372  {
    373  try
    374  {
    375  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    376  uninitialized_fill_pixels(_view, p_in);
    377  }
    378  catch(...) { deallocate(); throw; }
    379  }
    380 
    381  template <typename View>
    382  void allocate_and_copy(const point_t& dimensions, View const& v)
    383  {
    384  try
    385  {
    386  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    387  uninitialized_copy_pixels(v, _view);
    388  }
    389  catch(...) { deallocate(); throw; }
    390  }
    391 
    392  void deallocate()
    393  {
    394  if (_memory && _allocated_bytes > 0)
    395  _alloc.deallocate(_memory, _allocated_bytes);
    396  }
    397 
    398  std::size_t is_planar_impl(
    399  std::size_t const size_in_units,
    400  std::size_t const channels_in_image,
    401  std::true_type) const
    402  {
    403  return size_in_units * channels_in_image;
    404  }
    405 
    406  std::size_t is_planar_impl(
    407  std::size_t const size_in_units,
    408  std::size_t const,
    409  std::false_type) const
    410  {
    411  return size_in_units;
    412  }
    413 
    414  std::size_t total_allocated_size_in_bytes(point_t const& dimensions) const
    415  {
    416  using x_iterator = typename view_t::x_iterator;
    417 
    418  // when value_type is a non-pixel, like int or float, num_channels< ... > doesn't work.
    419  constexpr std::size_t _channels_in_image =
    420  std::conditional
    421  <
    422  is_pixel<value_type>::value,
    424  std::integral_constant<std::size_t, 1>
    425  >::type::value;
    426 
    427  std::size_t size_in_units = is_planar_impl(
    428  get_row_size_in_memunits(dimensions.x) * dimensions.y,
    429  _channels_in_image,
    430  std::integral_constant<bool, IsPlanar>());
    431 
    432  // return the size rounded up to the nearest byte
    433  return ( size_in_units + byte_to_memunit< x_iterator >::value - 1 )
    435  + ( _align_in_bytes > 0 ? _align_in_bytes - 1 : 0 ); // add extra padding in case we need to align the first image pixel
    436  }
    437 
    438  std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row
    439  std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
    440  if (_align_in_bytes>0) {
    441  std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
    442  return align(size_in_memunits, alignment_in_memunits);
    443  }
    444  return size_in_memunits;
    445  }
    446 
    447  void allocate_(point_t const& dimensions, std::false_type)
    448  {
    449  // if it throws and _memory!=0 the client must deallocate _memory
    450  _allocated_bytes = total_allocated_size_in_bytes(dimensions);
    451  _memory=_alloc.allocate( _allocated_bytes );
    452 
    453  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    454  _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp), get_row_size_in_memunits(dimensions.x)));
    455 
    456  BOOST_ASSERT(_view.width() == dimensions.x);
    457  BOOST_ASSERT(_view.height() == dimensions.y);
    458  }
    459 
    460  void allocate_(point_t const& dimensions, std::true_type)
    461  {
    462  // if it throws and _memory!=0 the client must deallocate _memory
    463  std::size_t row_size=get_row_size_in_memunits(dimensions.x);
    464  std::size_t plane_size=row_size*dimensions.y;
    465 
    466  _allocated_bytes = total_allocated_size_in_bytes( dimensions );
    467 
    468  _memory = _alloc.allocate( _allocated_bytes );
    469 
    470  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    471  typename view_t::x_iterator first;
    472  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
    473  {
    474  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
    475  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
    476  }
    477  _view=view_t(dimensions, typename view_t::locator(first, row_size));
    478 
    479  BOOST_ASSERT(_view.width() == dimensions.x);
    480  BOOST_ASSERT(_view.height() == dimensions.y);
    481  }
    482 
    483  void create_view(point_t const& dims, std::true_type) // is planar
    484  {
    485  std::size_t row_size=get_row_size_in_memunits(dims.x);
    486  std::size_t plane_size=row_size*dims.y;
    487 
    488  unsigned char* tmp = ( _align_in_bytes > 0 ) ? (unsigned char*) align( (std::size_t) _memory
    489  ,_align_in_bytes
    490  )
    491  : _memory;
    492  typename view_t::x_iterator first;
    493 
    494  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
    495  {
    496  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
    497  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
    498  }
    499 
    500  _view = view_t(dims, typename view_t::locator(first, row_size));
    501 
    502  BOOST_ASSERT(_view.width() == dims.x);
    503  BOOST_ASSERT(_view.height() == dims.y);
    504  }
    505 
    506  void create_view(point_t const& dims, std::false_type) // is planar
    507  {
    508  unsigned char* tmp = ( _align_in_bytes > 0 ) ? ( unsigned char* ) align( (std::size_t) _memory
    509  , _align_in_bytes
    510  )
    511  : _memory;
    512 
    513  _view = view_t( dims
    514  , typename view_t::locator( typename view_t::x_iterator( tmp )
    515  , get_row_size_in_memunits( dims.x )
    516  )
    517  );
    518 
    519  BOOST_ASSERT(_view.width() == dims.x);
    520  BOOST_ASSERT(_view.height() == dims.y);
    521  }
    522 };
    523 
    524 template <typename Pixel, bool IsPlanar, typename Alloc>
    526 {
    527  im1.swap(im2);
    528 }
    529 
    530 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    531 bool operator==(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2)
    532 {
    533  if ((void*)(&im1)==(void*)(&im2)) return true;
    534  if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
    535  return equal_pixels(const_view(im1),const_view(im2));
    536 }
    537 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    538 bool operator!=(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {return !(im1==im2);}
    539 
    543 
    545 
    547 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    548 const typename image<Pixel,IsPlanar,Alloc>::view_t& view(image<Pixel,IsPlanar,Alloc>& img) { return img._view; }
    549 
    551 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    552 const typename image<Pixel,IsPlanar,Alloc>::const_view_t const_view(const image<Pixel,IsPlanar,Alloc>& img)
    553 {
    554  return static_cast<const typename image<Pixel,IsPlanar,Alloc>::const_view_t>(img._view);
    555 }
    557 
    559 // PixelBasedConcept
    561 
    562 template <typename Pixel, bool IsPlanar, typename Alloc>
    563 struct channel_type<image<Pixel, IsPlanar, Alloc>> : channel_type<Pixel> {};
    564 
    565 template <typename Pixel, bool IsPlanar, typename Alloc>
    566 struct color_space_type<image<Pixel, IsPlanar, Alloc>> : color_space_type<Pixel> {};
    567 
    568 template <typename Pixel, bool IsPlanar, typename Alloc>
    569 struct channel_mapping_type<image<Pixel, IsPlanar, Alloc>> : channel_mapping_type<Pixel> {};
    570 
    571 template <typename Pixel, bool IsPlanar, typename Alloc>
    572 struct is_planar<image<Pixel, IsPlanar, Alloc>> : std::integral_constant<bool, IsPlanar> {};
    573 
    574 }} // namespace boost::gil
    575 
    576 #endif
    Definition: pixel_iterator.hpp:124
    -
    Definition: algorithm.hpp:30
    -
    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.
    Definition: algorithm.hpp:714
    -
    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.
    Definition: image_view.hpp:53
    -
    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
    Definition: algorithm.hpp:778
    -
    BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
    std::equal for image views
    Definition: algorithm.hpp:1051
    -
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    -
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    -
    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
    Definition: algorithm.hpp:577
    -
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    -
    Definition: color_convert.hpp:31
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:552
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    -
    Returns the type of a view the pixel type, whether it operates on planar data and whether it has a st...
    Definition: metafunctions.hpp:556
    -
    BOOST_FORCEINLINE void destruct_pixels(View const &view)
    Invokes the in-place destructor on every pixel of the view.
    Definition: algorithm.hpp:508
    +
    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_HPP
    +
    9 #define BOOST_GIL_IMAGE_HPP
    +
    10 
    +
    11 #include <boost/gil/algorithm.hpp>
    +
    12 #include <boost/gil/image_view.hpp>
    +
    13 #include <boost/gil/metafunctions.hpp>
    +
    14 #include <boost/gil/detail/mp11.hpp>
    +
    15 
    +
    16 #include <boost/assert.hpp>
    +
    17 #include <boost/core/exchange.hpp>
    +
    18 
    +
    19 #include <cstddef>
    +
    20 #include <memory>
    +
    21 #include <utility>
    +
    22 #include <type_traits>
    +
    23 
    +
    24 namespace boost { namespace gil {
    +
    25 
    +
    39 
    +
    40 template< typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> >
    +
    41 class image
    +
    42 {
    +
    43 public:
    +
    44 #if defined(BOOST_NO_CXX11_ALLOCATOR)
    +
    45  using allocator_type = typename Alloc::template rebind<unsigned char>::other;
    +
    46 #else
    +
    47  using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
    +
    48 #endif
    +
    49  using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
    +
    50  using const_view_t = typename view_t::const_t;
    +
    51  using point_t = typename view_t::point_t;
    +
    52  using coord_t = typename view_t::coord_t;
    +
    53  using value_type = typename view_t::value_type;
    +
    54  using x_coord_t = coord_t;
    +
    55  using y_coord_t = coord_t;
    +
    56 
    +
    57  const point_t& dimensions() const { return _view.dimensions(); }
    +
    58  x_coord_t width() const { return _view.width(); }
    +
    59  y_coord_t height() const { return _view.height(); }
    +
    60 
    +
    61  explicit image(std::size_t alignment=0,
    +
    62  const Alloc alloc_in = Alloc()) :
    +
    63  _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}
    +
    64 
    +
    65  // Create with dimensions and optional initial value and alignment
    +
    66  image(const point_t& dimensions,
    +
    67  std::size_t alignment=0,
    +
    68  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    +
    69  , _allocated_bytes( 0 )
    +
    70  {
    +
    71  allocate_and_default_construct(dimensions);
    +
    72  }
    +
    73 
    +
    74  image(x_coord_t width, y_coord_t height,
    +
    75  std::size_t alignment=0,
    +
    76  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    +
    77  , _allocated_bytes( 0 )
    +
    78  {
    +
    79  allocate_and_default_construct(point_t(width,height));
    +
    80  }
    +
    81 
    +
    82  image(const point_t& dimensions,
    +
    83  const Pixel& p_in,
    +
    84  std::size_t alignment = 0,
    +
    85  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    +
    86  , _allocated_bytes( 0 )
    +
    87  {
    +
    88  allocate_and_fill(dimensions, p_in);
    +
    89  }
    +
    90 
    +
    91  image(x_coord_t width, y_coord_t height,
    +
    92  const Pixel& p_in,
    +
    93  std::size_t alignment = 0,
    +
    94  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    +
    95  , _allocated_bytes ( 0 )
    +
    96  {
    +
    97  allocate_and_fill(point_t(width,height),p_in);
    +
    98  }
    +
    99 
    +
    100  image(const image& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    +
    101  , _allocated_bytes( img._allocated_bytes )
    +
    102  {
    +
    103  allocate_and_copy(img.dimensions(),img._view);
    +
    104  }
    +
    105 
    +
    106  template <typename P2, bool IP2, typename Alloc2>
    +
    107  image(const image<P2,IP2,Alloc2>& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    +
    108  , _allocated_bytes( img._allocated_bytes )
    +
    109  {
    +
    110  allocate_and_copy(img.dimensions(),img._view);
    +
    111  }
    +
    112 
    +
    113  template <typename Loc,
    +
    114  typename std::enable_if<pixels_are_compatible<typename Loc::value_type, Pixel>::value, int>::type = 0>
    +
    115  image(const image_view<Loc>& view,
    +
    116  std::size_t alignment = 0,
    +
    117  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    +
    118  , _allocated_bytes( 0 )
    +
    119  {
    +
    120  allocate_and_copy(view.dimensions(),view);
    +
    121  }
    +
    122 
    +
    123  // TODO Optimization: use noexcept (requires _view to be nothrow copy constructible)
    +
    124  image(image&& img) :
    +
    125  _view(img._view),
    +
    126  _memory(img._memory),
    +
    127  _align_in_bytes(img._align_in_bytes),
    +
    128  _alloc(std::move(img._alloc)),
    +
    129  _allocated_bytes(img._allocated_bytes)
    +
    130  {
    +
    131  img._view = view_t();
    +
    132  img._memory = nullptr;
    +
    133  img._align_in_bytes = 0;
    +
    134  img._allocated_bytes = 0;
    +
    135  }
    +
    136 
    +
    137  image& operator=(const image& img)
    +
    138  {
    +
    139  if (dimensions() == img.dimensions())
    +
    140  copy_pixels(img._view,_view);
    +
    141  else
    +
    142  {
    +
    143  image tmp(img);
    +
    144  swap(tmp);
    +
    145  }
    +
    146  return *this;
    +
    147  }
    +
    148 
    +
    149  template <typename Img>
    +
    150  image& operator=(const Img& img)
    +
    151  {
    +
    152  if (dimensions() == img.dimensions())
    +
    153  copy_pixels(img._view,_view);
    +
    154  else
    +
    155  {
    +
    156  image tmp(img);
    +
    157  swap(tmp);
    +
    158  }
    +
    159  return *this;
    +
    160  }
    +
    161 
    +
    162  private:
    +
    163  using propagate_allocators = std::true_type;
    +
    164  using no_propagate_allocators = std::false_type;
    +
    165 
    +
    166  template <class Alloc2>
    +
    167  using choose_pocma = typename std::conditional<
    +
    168  // TODO: Use std::allocator_traits<Allocator>::is_always_equal if available
    +
    169  std::is_empty<Alloc2>::value,
    +
    170  std::true_type,
    +
    171  typename std::allocator_traits<Alloc2>::propagate_on_container_move_assignment::type
    +
    172  >::type;
    +
    173 
    +
    174  static void exchange_memory(image& lhs, image& rhs)
    +
    175  {
    +
    176  lhs._memory = boost::exchange(rhs._memory, nullptr);
    +
    177  lhs._align_in_bytes = boost::exchange(rhs._align_in_bytes, 0);
    +
    178  lhs._allocated_bytes = boost::exchange(rhs._allocated_bytes, 0);
    +
    179  lhs._view = boost::exchange(rhs._view, image::view_t{});
    +
    180  };
    +
    181 
    +
    182  void move_assign(image& img, propagate_allocators) noexcept {
    +
    183  // non-sticky allocator, can adopt the memory, fast
    +
    184  destruct_pixels(_view);
    +
    185  this->deallocate();
    +
    186  this->_alloc = img._alloc;
    +
    187  exchange_memory(*this, img);
    +
    188  }
    +
    189 
    +
    190  void move_assign(image& img, no_propagate_allocators) {
    +
    191  if (_alloc == img._alloc) {
    +
    192  // allocator stuck to the rhs, but it's equivalent of ours, we can still adopt the memory
    +
    193  destruct_pixels(_view);
    +
    194  this->deallocate();
    +
    195  exchange_memory(*this, img);
    +
    196  } else {
    +
    197  // cannot propagate the allocator and cannot adopt the memory
    +
    198  if (img._memory)
    +
    199  {
    +
    200  allocate_and_copy(img.dimensions(), img._view);
    +
    201  destruct_pixels(img._view);
    +
    202  img.deallocate();
    +
    203  img._view = image::view_t{};
    +
    204  }
    +
    205  else
    +
    206  {
    +
    207  destruct_pixels(this->_view);
    +
    208  this->deallocate();
    +
    209  this->_view = view_t{};
    +
    210  }
    +
    211  }
    +
    212  }
    +
    213 
    +
    214  public:
    +
    215  // TODO: Use noexcept(noexcept(move_assign(img, choose_pocma<allocator_type>{})))
    +
    216  // But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 prevents it (fixed in GCC > 9)
    +
    217  image& operator=(image&& img) {
    +
    218  if (this != std::addressof(img))
    +
    219  // Use rebinded alloc to choose pocma
    +
    220  move_assign(img, choose_pocma<allocator_type>{});
    +
    221 
    +
    222  return *this;
    +
    223  }
    +
    224 
    +
    225  ~image()
    +
    226  {
    +
    227  destruct_pixels(_view);
    +
    228  deallocate();
    +
    229  }
    +
    230 
    +
    231  Alloc& allocator() { return _alloc; }
    +
    232  Alloc const& allocator() const { return _alloc; }
    +
    233 
    +
    234  void swap(image& img) // required by MutableContainerConcept
    +
    235  {
    +
    236  using std::swap;
    +
    237  swap(_align_in_bytes, img._align_in_bytes);
    +
    238  swap(_memory, img._memory);
    +
    239  swap(_view, img._view);
    +
    240  swap(_alloc, img._alloc);
    +
    241  swap(_allocated_bytes, img._allocated_bytes );
    +
    242  }
    +
    243 
    +
    245  // recreate
    +
    247 
    +
    248  // without Allocator
    +
    249  void recreate(const point_t& dims, std::size_t alignment = 0)
    +
    250  {
    +
    251  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    +
    252  return;
    +
    253 
    +
    254  _align_in_bytes = alignment;
    +
    255 
    +
    256  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    +
    257  {
    +
    258  destruct_pixels(_view);
    +
    259  create_view(dims, std::integral_constant<bool, IsPlanar>());
    + +
    261  }
    +
    262  else
    +
    263  {
    +
    264  image tmp(dims, alignment);
    +
    265  swap(tmp);
    +
    266  }
    +
    267  }
    +
    268 
    +
    269  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment = 0)
    +
    270  {
    +
    271  recreate(point_t(width, height), alignment);
    +
    272  }
    +
    273 
    +
    274  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment = 0)
    +
    275  {
    +
    276  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    +
    277  return;
    +
    278 
    +
    279  _align_in_bytes = alignment;
    +
    280 
    +
    281  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    +
    282  {
    +
    283  destruct_pixels(_view);
    +
    284  create_view(dims, typename std::integral_constant<bool, IsPlanar>());
    +
    285  uninitialized_fill_pixels(_view, p_in);
    +
    286  }
    +
    287  else
    +
    288  {
    +
    289  image tmp(dims, p_in, alignment);
    +
    290  swap(tmp);
    +
    291  }
    +
    292  }
    +
    293 
    +
    294  void recreate( x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment = 0 )
    +
    295  {
    +
    296  recreate( point_t( width, height ), p_in, alignment );
    +
    297  }
    +
    298 
    +
    299  // with Allocator
    +
    300  void recreate(const point_t& dims, std::size_t alignment, const Alloc alloc_in)
    +
    301  {
    +
    302  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    +
    303  return;
    +
    304 
    +
    305  _align_in_bytes = alignment;
    +
    306 
    +
    307  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    +
    308  {
    +
    309  destruct_pixels(_view);
    +
    310  create_view(dims, std::integral_constant<bool, IsPlanar>());
    + +
    312  }
    +
    313  else
    +
    314  {
    +
    315  image tmp(dims, alignment, alloc_in);
    +
    316  swap(tmp);
    +
    317  }
    +
    318  }
    +
    319 
    +
    320  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
    +
    321  {
    +
    322  recreate(point_t(width, height), alignment, alloc_in);
    +
    323  }
    +
    324 
    +
    325  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in)
    +
    326  {
    +
    327  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    +
    328  return;
    +
    329 
    +
    330  _align_in_bytes = alignment;
    +
    331 
    +
    332  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    +
    333  {
    +
    334  destruct_pixels(_view);
    +
    335  create_view(dims, std::integral_constant<bool, IsPlanar>());
    +
    336  uninitialized_fill_pixels(_view, p_in);
    +
    337  }
    +
    338  else
    +
    339  {
    +
    340  image tmp(dims, p_in, alignment, alloc_in);
    +
    341  swap(tmp);
    +
    342  }
    +
    343  }
    +
    344 
    +
    345  void recreate(x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in )
    +
    346  {
    +
    347  recreate(point_t(width, height), p_in, alignment, alloc_in);
    +
    348  }
    +
    349 
    +
    350  view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels
    +
    351 
    +
    352  // for construction from other type
    +
    353  template <typename P2, bool IP2, typename Alloc2> friend class image;
    +
    354 private:
    +
    355  unsigned char* _memory;
    +
    356  std::size_t _align_in_bytes;
    +
    357  allocator_type _alloc;
    +
    358 
    +
    359  std::size_t _allocated_bytes;
    +
    360 
    +
    361  void allocate_and_default_construct(point_t const& dimensions)
    +
    362  {
    +
    363  try
    +
    364  {
    +
    365  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    + +
    367  }
    +
    368  catch (...) { deallocate(); throw; }
    +
    369  }
    +
    370 
    +
    371  void allocate_and_fill(const point_t& dimensions, Pixel const& p_in)
    +
    372  {
    +
    373  try
    +
    374  {
    +
    375  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    +
    376  uninitialized_fill_pixels(_view, p_in);
    +
    377  }
    +
    378  catch(...) { deallocate(); throw; }
    +
    379  }
    +
    380 
    +
    381  template <typename View>
    +
    382  void allocate_and_copy(const point_t& dimensions, View const& v)
    +
    383  {
    +
    384  try
    +
    385  {
    +
    386  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    +
    387  uninitialized_copy_pixels(v, _view);
    +
    388  }
    +
    389  catch(...) { deallocate(); throw; }
    +
    390  }
    +
    391 
    +
    392  void deallocate()
    +
    393  {
    +
    394  if (_memory && _allocated_bytes > 0)
    +
    395  _alloc.deallocate(_memory, _allocated_bytes);
    +
    396  }
    +
    397 
    +
    398  std::size_t is_planar_impl(
    +
    399  std::size_t const size_in_units,
    +
    400  std::size_t const channels_in_image,
    +
    401  std::true_type) const
    +
    402  {
    +
    403  return size_in_units * channels_in_image;
    +
    404  }
    +
    405 
    +
    406  std::size_t is_planar_impl(
    +
    407  std::size_t const size_in_units,
    +
    408  std::size_t const,
    +
    409  std::false_type) const
    +
    410  {
    +
    411  return size_in_units;
    +
    412  }
    +
    413 
    +
    414  std::size_t total_allocated_size_in_bytes(point_t const& dimensions) const
    +
    415  {
    +
    416  using x_iterator = typename view_t::x_iterator;
    +
    417 
    +
    418  // when value_type is a non-pixel, like int or float, num_channels< ... > doesn't work.
    +
    419  constexpr std::size_t _channels_in_image =
    +
    420  std::conditional
    +
    421  <
    +
    422  is_pixel<value_type>::value,
    + +
    424  std::integral_constant<std::size_t, 1>
    +
    425  >::type::value;
    +
    426 
    +
    427  std::size_t size_in_units = is_planar_impl(
    +
    428  get_row_size_in_memunits(dimensions.x) * dimensions.y,
    +
    429  _channels_in_image,
    +
    430  std::integral_constant<bool, IsPlanar>());
    +
    431 
    +
    432  // return the size rounded up to the nearest byte
    +
    433  return ( size_in_units + byte_to_memunit< x_iterator >::value - 1 )
    + +
    435  + ( _align_in_bytes > 0 ? _align_in_bytes - 1 : 0 ); // add extra padding in case we need to align the first image pixel
    +
    436  }
    +
    437 
    +
    438  std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row
    +
    439  std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
    +
    440  if (_align_in_bytes>0) {
    +
    441  std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
    +
    442  return align(size_in_memunits, alignment_in_memunits);
    +
    443  }
    +
    444  return size_in_memunits;
    +
    445  }
    +
    446 
    +
    447  void allocate_(point_t const& dimensions, std::false_type)
    +
    448  {
    +
    449  // if it throws and _memory!=0 the client must deallocate _memory
    +
    450  _allocated_bytes = total_allocated_size_in_bytes(dimensions);
    +
    451  _memory=_alloc.allocate( _allocated_bytes );
    +
    452 
    +
    453  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    +
    454  _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp), get_row_size_in_memunits(dimensions.x)));
    +
    455 
    +
    456  BOOST_ASSERT(_view.width() == dimensions.x);
    +
    457  BOOST_ASSERT(_view.height() == dimensions.y);
    +
    458  }
    +
    459 
    +
    460  void allocate_(point_t const& dimensions, std::true_type)
    +
    461  {
    +
    462  // if it throws and _memory!=0 the client must deallocate _memory
    +
    463  std::size_t row_size=get_row_size_in_memunits(dimensions.x);
    +
    464  std::size_t plane_size=row_size*dimensions.y;
    +
    465 
    +
    466  _allocated_bytes = total_allocated_size_in_bytes( dimensions );
    +
    467 
    +
    468  _memory = _alloc.allocate( _allocated_bytes );
    +
    469 
    +
    470  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    +
    471  typename view_t::x_iterator first;
    +
    472  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
    +
    473  {
    +
    474  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
    +
    475  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
    +
    476  }
    +
    477  _view=view_t(dimensions, typename view_t::locator(first, row_size));
    +
    478 
    +
    479  BOOST_ASSERT(_view.width() == dimensions.x);
    +
    480  BOOST_ASSERT(_view.height() == dimensions.y);
    +
    481  }
    +
    482 
    +
    483  void create_view(point_t const& dims, std::true_type) // is planar
    +
    484  {
    +
    485  std::size_t row_size=get_row_size_in_memunits(dims.x);
    +
    486  std::size_t plane_size=row_size*dims.y;
    +
    487 
    +
    488  unsigned char* tmp = ( _align_in_bytes > 0 ) ? (unsigned char*) align( (std::size_t) _memory
    +
    489  ,_align_in_bytes
    +
    490  )
    +
    491  : _memory;
    +
    492  typename view_t::x_iterator first;
    +
    493 
    +
    494  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
    +
    495  {
    +
    496  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
    +
    497  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
    +
    498  }
    +
    499 
    +
    500  _view = view_t(dims, typename view_t::locator(first, row_size));
    +
    501 
    +
    502  BOOST_ASSERT(_view.width() == dims.x);
    +
    503  BOOST_ASSERT(_view.height() == dims.y);
    +
    504  }
    +
    505 
    +
    506  void create_view(point_t const& dims, std::false_type) // is planar
    +
    507  {
    +
    508  unsigned char* tmp = ( _align_in_bytes > 0 ) ? ( unsigned char* ) align( (std::size_t) _memory
    +
    509  , _align_in_bytes
    +
    510  )
    +
    511  : _memory;
    +
    512 
    +
    513  _view = view_t( dims
    +
    514  , typename view_t::locator( typename view_t::x_iterator( tmp )
    +
    515  , get_row_size_in_memunits( dims.x )
    +
    516  )
    +
    517  );
    +
    518 
    +
    519  BOOST_ASSERT(_view.width() == dims.x);
    +
    520  BOOST_ASSERT(_view.height() == dims.y);
    +
    521  }
    +
    522 };
    +
    523 
    +
    524 template <typename Pixel, bool IsPlanar, typename Alloc>
    + +
    526 {
    +
    527  im1.swap(im2);
    +
    528 }
    +
    529 
    +
    530 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    +
    531 bool operator==(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2)
    +
    532 {
    +
    533  if ((void*)(&im1)==(void*)(&im2)) return true;
    +
    534  if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
    +
    535  return equal_pixels(const_view(im1),const_view(im2));
    +
    536 }
    +
    537 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    +
    538 bool operator!=(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {return !(im1==im2);}
    +
    539 
    +
    543 
    +
    545 
    +
    547 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    +
    548 const typename image<Pixel,IsPlanar,Alloc>::view_t& view(image<Pixel,IsPlanar,Alloc>& img) { return img._view; }
    +
    549 
    +
    551 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    +
    552 const typename image<Pixel,IsPlanar,Alloc>::const_view_t const_view(const image<Pixel,IsPlanar,Alloc>& img)
    +
    553 {
    +
    554  return static_cast<const typename image<Pixel,IsPlanar,Alloc>::const_view_t>(img._view);
    +
    555 }
    +
    557 
    +
    559 // PixelBasedConcept
    +
    561 
    +
    562 template <typename Pixel, bool IsPlanar, typename Alloc>
    +
    563 struct channel_type<image<Pixel, IsPlanar, Alloc>> : channel_type<Pixel> {};
    +
    564 
    +
    565 template <typename Pixel, bool IsPlanar, typename Alloc>
    +
    566 struct color_space_type<image<Pixel, IsPlanar, Alloc>> : color_space_type<Pixel> {};
    +
    567 
    +
    568 template <typename Pixel, bool IsPlanar, typename Alloc>
    +
    569 struct channel_mapping_type<image<Pixel, IsPlanar, Alloc>> : channel_mapping_type<Pixel> {};
    +
    570 
    +
    571 template <typename Pixel, bool IsPlanar, typename Alloc>
    +
    572 struct is_planar<image<Pixel, IsPlanar, Alloc>> : std::integral_constant<bool, IsPlanar> {};
    +
    573 
    +
    574 }} // namespace boost::gil
    +
    575 
    +
    576 #endif
    +
    Definition: pixel_iterator.hpp:124
    +
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
    std::equal for image views
    Definition: algorithm.hpp:1098
    +
    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:813
    +
    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
    Definition: image_view.hpp:53
    +
    BOOST_FORCEINLINE bool operator!=(const point< T > &p1, const point< T > &p2)
    Definition: point.hpp:137
    +
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    +
    BOOST_FORCEINLINE void destruct_pixels(View const &view)
    Invokes the in-place destructor on every pixel of the view.
    Definition: algorithm.hpp:508
    +
    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:577
    +
    void default_construct_pixels(View const &view)
    Invokes the in-place default constructor on every pixel of the (uninitialized) view....
    Definition: algorithm.hpp:714
    +
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:552
    +
    Definition: color_convert.hpp:31
    +
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    +
    BOOST_FORCEINLINE bool operator==(const point< T > &p1, const point< T > &p2)
    Definition: point.hpp:129
    diff --git a/develop/doc/html/reference/image__view_8hpp_source.html b/develop/doc/html/reference/image__view_8hpp_source.html index d6c919457..86a6ea7b5 100644 --- a/develop/doc/html/reference/image__view_8hpp_source.html +++ b/develop/doc/html/reference/image__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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  {
    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 {
    408 };
    409 
    411 // HasDynamicYStepTypeConcept
    413 
    414 template <typename L>
    415 struct dynamic_y_step_type<image_view<L>>
    416 {
    418 };
    419 
    421 // HasTransposedTypeConcept
    423 
    424 template <typename L>
    425 struct transposed_type<image_view<L>>
    426 {
    428 };
    429 
    430 }} // namespace boost::gil
    431 
    432 #endif
    Definition: algorithm.hpp:30
    -
    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.
    Definition: image_view.hpp:53
    -
    bool empty() const
    Returns true if the view has no elements, false otherwise.
    Definition: image_view.hpp:186
    -
    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept.
    Definition: iterator_from_2d.hpp:42
    -
    auto back() const -> reference
    Returns a reference to the last element in raster order.
    Definition: image_view.hpp:205
    -
    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
    -
    Definition: image_view_factory.hpp:40
    -
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    -
    Definition: color_convert.hpp:31
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    -
    auto front() const -> reference
    Returns a reference to the first element in raster order.
    Definition: image_view.hpp:195
    +
    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
    +
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    +
    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
    Definition: image_view.hpp:53
    +
    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
    Definition: iterator_from_2d.hpp:42
    +
    auto back() const -> reference
    Returns a reference to the last element in raster order.
    Definition: image_view.hpp:205
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    + +
    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
    +
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    +
    bool empty() const
    Returns true if the view has no elements, false otherwise.
    Definition: image_view.hpp:186
    +
    auto front() const -> reference
    Returns a reference to the first element in raster order.
    Definition: image_view.hpp:195
    diff --git a/develop/doc/html/reference/image__view__factory_8hpp_source.html b/develop/doc/html/reference/image__view__factory_8hpp_source.html index 4b212b616..e2691a5cd 100644 --- a/develop/doc/html/reference/image__view__factory_8hpp_source.html +++ b/develop/doc/html/reference/image__view__factory_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view_factory.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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 interleaved_view(std::size_t width, std::size_t height,
    59  Iterator pixels, std::ptrdiff_t rowsize_in_bytes) {
    60  using RView = typename type_from_x_iterator<Iterator>::view_t;
    61  return RView(width, height, typename RView::locator(pixels, rowsize_in_bytes));
    62 }
    63 
    66 template <typename Iterator>
    67 auto interleaved_view(point<std::ptrdiff_t> dim, Iterator pixels,
    68  std::ptrdiff_t rowsize_in_bytes)
    70 {
    71  using RView = typename type_from_x_iterator<Iterator>::view_t;
    72  return RView(dim, typename RView::locator(pixels, rowsize_in_bytes));
    73 }
    74 
    76 // interleaved_view_get_raw_data, planar_view_get_raw_data - return pointers to the raw data (the channels) of a basic homogeneous view.
    78 
    79 namespace detail {
    80  template <typename View, bool IsMutable> struct channel_pointer_type_impl;
    81 
    82  template <typename View> struct channel_pointer_type_impl<View, true> {
    83  using type = typename channel_type<View>::type *;
    84  };
    85  template <typename View> struct channel_pointer_type_impl<View, false> {
    86  using type = const typename channel_type<View>::type *;
    87  };
    88 
    89  template <typename View> struct channel_pointer_type
    90  : public channel_pointer_type_impl<View, view_is_mutable<View>::value> {};
    91 } // namespace detail
    92 
    95 template <typename HomogeneousView>
    96 typename detail::channel_pointer_type<HomogeneousView>::type interleaved_view_get_raw_data(const HomogeneousView& view) {
    97  static_assert(!is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
    98  static_assert(std::is_pointer<typename HomogeneousView::x_iterator>::value, "");
    99 
    100  return &gil::at_c<0>(view(0,0));
    101 }
    102 
    105 template <typename HomogeneousView>
    106 typename detail::channel_pointer_type<HomogeneousView>::type planar_view_get_raw_data(const HomogeneousView& view, int plane_index) {
    107  static_assert(is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
    108  return dynamic_at_c(view.row_begin(0),plane_index);
    109 }
    110 
    111 
    115 
    120 template <typename SrcConstRefP, typename DstP, typename CC=default_color_converter > // const_reference to the source pixel and destination pixel value
    121 class color_convert_deref_fn : public deref_base<color_convert_deref_fn<SrcConstRefP,DstP,CC>, DstP, DstP, const DstP&, SrcConstRefP, DstP, false> {
    122 private:
    123  CC _cc; // color-converter
    124 public:
    126  color_convert_deref_fn(CC cc_in) : _cc(cc_in) {}
    127 
    128  DstP operator()(SrcConstRefP srcP) const {
    129  DstP dstP;
    130  _cc(srcP,dstP);
    131  return dstP;
    132  }
    133 };
    134 
    135 namespace detail {
    136  // Add color converter upon dereferencing
    137  template <typename SrcView, typename CC, typename DstP, typename SrcP>
    138  struct _color_converted_view_type {
    139  private:
    141  using add_ref_t = typename SrcView::template add_deref<deref_t>;
    142  public:
    143  using type = typename add_ref_t::type;
    144  static type make(const SrcView& sv,CC cc) {return add_ref_t::make(sv,deref_t(cc));}
    145  };
    146 
    147  // If the Src view has the same pixel type as the target, there is no need for color conversion
    148  template <typename SrcView, typename CC, typename DstP>
    149  struct _color_converted_view_type<SrcView,CC,DstP,DstP> {
    150  using type = SrcView;
    151  static type make(const SrcView& sv,CC) {return sv;}
    152  };
    153 } // namespace detail
    154 
    155 
    158 template <typename SrcView, typename DstP, typename CC=default_color_converter>
    159 struct color_converted_view_type : public detail::_color_converted_view_type<SrcView,
    160  CC,
    161  DstP,
    162  typename SrcView::value_type> {
    163  BOOST_GIL_CLASS_REQUIRE(DstP, boost::gil, MutablePixelConcept)//why does it have to be mutable???
    164 };
    165 
    166 
    169 template <typename DstP, typename View, typename CC>
    172 }
    173 
    176 template <typename DstP, typename View>
    177 inline typename color_converted_view_type<View,DstP>::type
    178 color_converted_view(const View& src) {
    179  return color_converted_view<DstP>(src,default_color_converter());
    180 }
    181 
    185 
    187 template <typename View>
    188 inline typename dynamic_y_step_type<View>::type flipped_up_down_view(const View& src) {
    189  using RView = typename dynamic_y_step_type<View>::type;
    190  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1));
    191 }
    192 
    196 
    198 template <typename View>
    199 inline typename dynamic_x_step_type<View>::type flipped_left_right_view(const View& src) {
    200  using RView = typename dynamic_x_step_type<View>::type;
    201  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,0),-1,1));
    202 }
    203 
    207 
    209 template <typename View>
    210 inline typename dynamic_xy_step_transposed_type<View>::type transposed_view(const View& src) {
    211  using RView = typename dynamic_xy_step_transposed_type<View>::type;
    212  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,0),1,1,true));
    213 }
    214 
    218 
    220 template <typename View>
    221 inline typename dynamic_xy_step_transposed_type<View>::type rotated90cw_view(const View& src) {
    222  using RView = typename dynamic_xy_step_transposed_type<View>::type;
    223  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1,1,true));
    224 }
    225 
    229 
    231 template <typename View>
    232 inline typename dynamic_xy_step_transposed_type<View>::type rotated90ccw_view(const View& src) {
    233  using RView = typename dynamic_xy_step_transposed_type<View>::type;
    234  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(src.width()-1,0),1,-1,true));
    235 }
    236 
    240 
    242 template <typename View>
    243 inline typename dynamic_xy_step_type<View>::type rotated180_view(const View& src) {
    244  using RView = typename dynamic_xy_step_type<View>::type;
    245  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,src.height()-1),-1,-1));
    246 }
    247 
    251 
    253 template <typename View>
    254 inline View subimage_view(
    255  View const& src,
    256  typename View::point_t const& topleft,
    257  typename View::point_t const& dimensions)
    258 {
    259  return View(dimensions, src.xy_at(topleft));
    260 }
    261 
    263 template <typename View>
    264 inline View subimage_view(View const& src,
    265  typename View::coord_t x_min,
    266  typename View::coord_t y_min,
    267  typename View::coord_t width,
    268  typename View::coord_t height)
    269 {
    270  return View(width, height, src.xy_at(x_min, y_min));
    271 }
    272 
    276 
    278 template <typename View>
    279 inline
    280 auto subsampled_view(View const& src, typename View::coord_t x_step, typename View::coord_t y_step)
    282 {
    283  BOOST_ASSERT(x_step > 0 && y_step > 0);
    284  using view_t =typename dynamic_xy_step_type<View>::type;
    285  return view_t(
    286  (src.width() + (x_step - 1)) / x_step,
    287  (src.height() + (y_step - 1)) / y_step,
    288  typename view_t::xy_locator(src.xy_at(0,0), x_step, y_step));
    289 }
    290 
    292 template <typename View>
    293 inline auto subsampled_view(View const& src, typename View::point_t const& step)
    295 {
    296  return subsampled_view(src, step.x, step.y);
    297 }
    298 
    302 
    303 namespace detail {
    304  template <typename View, bool AreChannelsTogether> struct __nth_channel_view_basic;
    305 
    306  // nth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
    307  // or images with a step
    308  template <typename View>
    309  struct __nth_channel_view_basic<View,false> {
    311 
    312  static type make(const View& src, int n) {
    313  using locator_t = typename type::xy_locator;
    314  using x_iterator_t = typename type::x_iterator;
    315  using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
    316  x_iterator_t sit(x_iterator_base_t(&(src(0,0)[n])),src.pixels().pixel_size());
    317  return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
    318  }
    319  };
    320 
    321  // nth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
    322  template <typename View>
    323  struct __nth_channel_view_basic<View,true> {
    325  static type make(const View& src, int n) {
    326  using x_iterator_t = typename type::x_iterator;
    327  return interleaved_view(src.width(),src.height(),(x_iterator_t)&(src(0,0)[n]), src.pixels().row_size());
    328  }
    329  };
    330 
    331  template <typename View, bool IsBasic> struct __nth_channel_view;
    332 
    333  // For basic (memory-based) views dispatch to __nth_channel_view_basic
    334  template <typename View>
    335  struct __nth_channel_view<View,true>
    336  {
    337  private:
    338  using src_x_iterator = typename View::x_iterator;
    339 
    340  // Determines whether the channels of a given pixel iterator are adjacent in memory.
    341  // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
    342  static constexpr bool adjacent =
    344  (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
    345 
    346  public:
    347  using type = typename __nth_channel_view_basic<View,adjacent>::type;
    348 
    349  static type make(const View& src, int n) {
    350  return __nth_channel_view_basic<View,adjacent>::make(src,n);
    351  }
    352  };
    353 
    358  template <typename SrcP> // SrcP is a reference to PixelConcept (could be pixel value or const/non-const reference)
    359  // Examples: pixel<T,L>, pixel<T,L>&, const pixel<T,L>&, planar_pixel_reference<T&,L>, planar_pixel_reference<const T&,L>
    361  {
    362  static constexpr bool is_mutable =
    364  private:
    365  using src_pixel_t = typename std::remove_reference<SrcP>::type;
    366  using channel_t = typename channel_type<src_pixel_t>::type;
    367  using const_ref_t = typename src_pixel_t::const_reference;
    369  public:
    371  using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
    373  using argument_type = SrcP;
    374  using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
    375  using result_type = reference;
    376 
    377  nth_channel_deref_fn(int n=0) : _n(n) {}
    378  template <typename P> nth_channel_deref_fn(const nth_channel_deref_fn<P>& d) : _n(d._n) {}
    379 
    380  int _n; // the channel to use
    381 
    382  result_type operator()(argument_type srcP) const {
    383  return result_type(srcP[_n]);
    384  }
    385  };
    386 
    387  template <typename View> struct __nth_channel_view<View,false> {
    388  private:
    390  using AD = typename View::template add_deref<deref_t>;
    391  public:
    392  using type = typename AD::type;
    393  static type make(const View& src, int n) {
    394  return AD::make(src, deref_t(n));
    395  }
    396  };
    397 } // namespace detail
    398 
    405 template <typename View>
    407 private:
    408  BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
    409  using VB = detail::__nth_channel_view<View,view_is_basic<View>::value>;
    410 public:
    411  using type = typename VB::type;
    412  static type make(const View& src, int n) { return VB::make(src,n); }
    413 };
    414 
    415 
    417 template <typename View>
    418 typename nth_channel_view_type<View>::type nth_channel_view(const View& src, int n) {
    419  return nth_channel_view_type<View>::make(src,n);
    420 }
    421 
    422 
    423 
    424 
    425 
    426 
    427 
    431 
    432 namespace detail {
    433  template <int K, typename View, bool AreChannelsTogether> struct __kth_channel_view_basic;
    434 
    435  // kth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
    436  // or images with a step
    437  template <int K, typename View>
    438  struct __kth_channel_view_basic<K,View,false> {
    439  private:
    440  using channel_t = typename kth_element_type<typename View::value_type,K>::type;
    441  public:
    443 
    444  static type make(const View& src) {
    445  using locator_t = typename type::xy_locator;
    446  using x_iterator_t = typename type::x_iterator;
    447  using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
    448  x_iterator_t sit(x_iterator_base_t(&gil::at_c<K>(src(0,0))),src.pixels().pixel_size());
    449  return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
    450  }
    451  };
    452 
    453  // kth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
    454  template <int K, typename View>
    455  struct __kth_channel_view_basic<K,View,true> {
    456  private:
    457  using channel_t = typename kth_element_type<typename View::value_type, K>::type;
    458  public:
    460  static type make(const View& src) {
    461  using x_iterator_t = typename type::x_iterator;
    462  return interleaved_view(src.width(),src.height(),(x_iterator_t)&gil::at_c<K>(src(0,0)), src.pixels().row_size());
    463  }
    464  };
    465 
    466  template <int K, typename View, bool IsBasic> struct __kth_channel_view;
    467 
    468  // For basic (memory-based) views dispatch to __kth_channel_view_basic
    469  template <int K, typename View> struct __kth_channel_view<K,View,true>
    470  {
    471  private:
    472  using src_x_iterator = typename View::x_iterator;
    473 
    474  // Determines whether the channels of a given pixel iterator are adjacent in memory.
    475  // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
    476  static constexpr bool adjacent =
    478  (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
    479 
    480  public:
    481  using type = typename __kth_channel_view_basic<K,View,adjacent>::type;
    482 
    483  static type make(const View& src) {
    484  return __kth_channel_view_basic<K,View,adjacent>::make(src);
    485  }
    486  };
    487 
    494  template <int K, typename SrcP>
    496  {
    497  static constexpr bool is_mutable =
    499 
    500  private:
    501  using src_pixel_t = typename std::remove_reference<SrcP>::type;
    502  using channel_t = typename kth_element_type<src_pixel_t, K>::type;
    503  using const_ref_t = typename src_pixel_t::const_reference;
    505 
    506  public:
    508  using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
    510  using argument_type = SrcP;
    511  using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
    512  using result_type = reference;
    513 
    515  template <typename P> kth_channel_deref_fn(const kth_channel_deref_fn<K,P>&) {}
    516 
    517  result_type operator()(argument_type srcP) const {
    518  return result_type(gil::at_c<K>(srcP));
    519  }
    520  };
    521 
    522  template <int K, typename View> struct __kth_channel_view<K,View,false> {
    523  private:
    525  using AD = typename View::template add_deref<deref_t>;
    526  public:
    527  using type = typename AD::type;
    528  static type make(const View& src) {
    529  return AD::make(src, deref_t());
    530  }
    531  };
    532 } // namespace detail
    533 
    540 template <int K, typename View>
    542 private:
    543  BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
    544  using VB = detail::__kth_channel_view<K,View,view_is_basic<View>::value>;
    545 public:
    546  using type = typename VB::type;
    547  static type make(const View& src) { return VB::make(src); }
    548 };
    549 
    551 template <int K, typename View>
    552 typename kth_channel_view_type<K,View>::type kth_channel_view(const View& src) {
    554 }
    555 
    556 } } // namespace boost::gil
    557 
    558 #endif
    Definition: algorithm.hpp:30
    -
    Returns the type of a transposed view that has a dynamic step along both X and Y. ...
    Definition: image_view_factory.hpp:51
    -
    Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar ...
    Definition: metafunctions.hpp:537
    -
    Definition: algorithm.hpp:30
    -
    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.
    Definition: image_view.hpp:53
    -
    returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
    Definition: metafunctions.hpp:35
    -
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept.
    Definition: metafunctions.hpp:23
    -
    Function object that given a source pixel, returns it converted to a given color space and channel de...
    Definition: image_view_factory.hpp:121
    -
    Returns the type of a view that has a dynamic step along both X and Y.
    Definition: dynamic_step.hpp:27
    -
    Given a source image view type View, returns the type of an image view over a single channel of ViewI...
    Definition: image_view_factory.hpp:406
    -
    Helper base class for pixel dereference adaptors.
    Definition: utilities.hpp:106
    -
    Function object that returns a grayscale reference of the K-th channel (specified as a template param...
    Definition: image_view_factory.hpp:495
    -
    Returns the type of a view that does color conversion upon dereferencing its pixels.
    Definition: image_view_factory.hpp:159
    -
    Determines if the given pixel reference is mutable (i.e. its channels can be changed) ...
    Definition: metafunctions.hpp:228
    -
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    -
    Definition: image_view_factory.hpp:40
    -
    Function object that returns a grayscale reference of the N-th channel of a given reference...
    Definition: image_view_factory.hpp:360
    -
    detail::channel_pointer_type< HomogeneousView >::type planar_view_get_raw_data(const HomogeneousView &view, int plane_index)
    Returns C pointer to the the channels of a given color plane of a planar homogeneous view...
    Definition: image_view_factory.hpp:106
    -
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:101
    -
    Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
    Definition: metafunctions.hpp:266
    -
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    detail::channel_pointer_type< HomogeneousView >::type interleaved_view_get_raw_data(const HomogeneousView &view)
    Returns C pointer to the the channels of an interleaved homogeneous view.
    Definition: image_view_factory.hpp:96
    -
    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:67
    -
    Determines if the given view is mutable (i.e. its pixels can be changed)
    Definition: metafunctions.hpp:242
    -
    Definition: color_convert.hpp:31
    -
    GIL&#39;s 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:375
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    -
    color_converted_view_type< View, DstP >::type color_converted_view(const View &src)
    overload of generic color_converted_view with the default color-converter
    Definition: image_view_factory.hpp:178
    -
    Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
    Definition: metafunctions.hpp:216
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    -
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    -
    Basic views must be over basic locators.
    Definition: metafunctions.hpp:129
    -
    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:541
    -
    Determines if the given iterator has a step that could be set dynamically.
    Definition: metafunctions.hpp:148
    - -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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 interleaved_view(std::size_t width, std::size_t height,
    +
    59  Iterator pixels, std::ptrdiff_t rowsize_in_bytes) {
    +
    60  using RView = typename type_from_x_iterator<Iterator>::view_t;
    +
    61  return RView(width, height, typename RView::locator(pixels, rowsize_in_bytes));
    +
    62 }
    +
    63 
    +
    66 template <typename Iterator>
    +
    67 auto interleaved_view(point<std::ptrdiff_t> dim, Iterator pixels,
    +
    68  std::ptrdiff_t rowsize_in_bytes)
    + +
    70 {
    +
    71  using RView = typename type_from_x_iterator<Iterator>::view_t;
    +
    72  return RView(dim, typename RView::locator(pixels, rowsize_in_bytes));
    +
    73 }
    +
    74 
    +
    76 // interleaved_view_get_raw_data, planar_view_get_raw_data - return pointers to the raw data (the channels) of a basic homogeneous view.
    +
    78 
    +
    79 namespace detail {
    +
    80  template <typename View, bool IsMutable> struct channel_pointer_type_impl;
    +
    81 
    +
    82  template <typename View> struct channel_pointer_type_impl<View, true> {
    +
    83  using type = typename channel_type<View>::type *;
    +
    84  };
    +
    85  template <typename View> struct channel_pointer_type_impl<View, false> {
    +
    86  using type = const typename channel_type<View>::type *;
    +
    87  };
    +
    88 
    +
    89  template <typename View> struct channel_pointer_type
    +
    90  : public channel_pointer_type_impl<View, view_is_mutable<View>::value> {};
    +
    91 } // namespace detail
    +
    92 
    +
    95 template <typename HomogeneousView>
    +
    96 typename detail::channel_pointer_type<HomogeneousView>::type interleaved_view_get_raw_data(const HomogeneousView& view) {
    +
    97  static_assert(!is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
    +
    98  static_assert(std::is_pointer<typename HomogeneousView::x_iterator>::value, "");
    +
    99 
    +
    100  return &gil::at_c<0>(view(0,0));
    +
    101 }
    +
    102 
    +
    105 template <typename HomogeneousView>
    +
    106 typename detail::channel_pointer_type<HomogeneousView>::type planar_view_get_raw_data(const HomogeneousView& view, int plane_index) {
    +
    107  static_assert(is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
    +
    108  return dynamic_at_c(view.row_begin(0),plane_index);
    +
    109 }
    +
    110 
    +
    111 
    +
    115 
    +
    120 template <typename SrcConstRefP, typename DstP, typename CC=default_color_converter > // const_reference to the source pixel and destination pixel value
    +
    121 class color_convert_deref_fn : public deref_base<color_convert_deref_fn<SrcConstRefP,DstP,CC>, DstP, DstP, const DstP&, SrcConstRefP, DstP, false> {
    +
    122 private:
    +
    123  CC _cc; // color-converter
    +
    124 public:
    + +
    126  color_convert_deref_fn(CC cc_in) : _cc(cc_in) {}
    +
    127 
    +
    128  DstP operator()(SrcConstRefP srcP) const {
    +
    129  DstP dstP;
    +
    130  _cc(srcP,dstP);
    +
    131  return dstP;
    +
    132  }
    +
    133 };
    +
    134 
    +
    135 namespace detail {
    +
    136  // Add color converter upon dereferencing
    +
    137  template <typename SrcView, typename CC, typename DstP, typename SrcP>
    +
    138  struct _color_converted_view_type {
    +
    139  private:
    + +
    141  using add_ref_t = typename SrcView::template add_deref<deref_t>;
    +
    142  public:
    +
    143  using type = typename add_ref_t::type;
    +
    144  static type make(const SrcView& sv,CC cc) {return add_ref_t::make(sv,deref_t(cc));}
    +
    145  };
    +
    146 
    +
    147  // If the Src view has the same pixel type as the target, there is no need for color conversion
    +
    148  template <typename SrcView, typename CC, typename DstP>
    +
    149  struct _color_converted_view_type<SrcView,CC,DstP,DstP> {
    +
    150  using type = SrcView;
    +
    151  static type make(const SrcView& sv,CC) {return sv;}
    +
    152  };
    +
    153 } // namespace detail
    +
    154 
    +
    155 
    +
    158 template <typename SrcView, typename DstP, typename CC=default_color_converter>
    +
    159 struct color_converted_view_type : public detail::_color_converted_view_type<SrcView,
    +
    160  CC,
    +
    161  DstP,
    +
    162  typename SrcView::value_type> {
    +
    163  BOOST_GIL_CLASS_REQUIRE(DstP, boost::gil, MutablePixelConcept)//why does it have to be mutable???
    +
    164 };
    +
    165 
    +
    166 
    +
    169 template <typename DstP, typename View, typename CC>
    + + +
    172 }
    +
    173 
    +
    176 template <typename DstP, typename View>
    +
    177 inline typename color_converted_view_type<View,DstP>::type
    +
    178 color_converted_view(const View& src) {
    +
    179  return color_converted_view<DstP>(src,default_color_converter());
    +
    180 }
    +
    181 
    +
    185 
    +
    187 template <typename View>
    +
    188 inline typename dynamic_y_step_type<View>::type flipped_up_down_view(const View& src) {
    +
    189  using RView = typename dynamic_y_step_type<View>::type;
    +
    190  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1));
    +
    191 }
    +
    192 
    +
    196 
    +
    198 template <typename View>
    + +
    200  using RView = typename dynamic_x_step_type<View>::type;
    +
    201  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,0),-1,1));
    +
    202 }
    +
    203 
    +
    207 
    +
    209 template <typename View>
    + +
    211  using RView = typename dynamic_xy_step_transposed_type<View>::type;
    +
    212  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,0),1,1,true));
    +
    213 }
    +
    214 
    +
    218 
    +
    220 template <typename View>
    + +
    222  using RView = typename dynamic_xy_step_transposed_type<View>::type;
    +
    223  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1,1,true));
    +
    224 }
    +
    225 
    +
    229 
    +
    231 template <typename View>
    + +
    233  using RView = typename dynamic_xy_step_transposed_type<View>::type;
    +
    234  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(src.width()-1,0),1,-1,true));
    +
    235 }
    +
    236 
    +
    240 
    +
    242 template <typename View>
    +
    243 inline typename dynamic_xy_step_type<View>::type rotated180_view(const View& src) {
    +
    244  using RView = typename dynamic_xy_step_type<View>::type;
    +
    245  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,src.height()-1),-1,-1));
    +
    246 }
    +
    247 
    +
    251 
    +
    253 template <typename View>
    +
    254 inline View subimage_view(
    +
    255  View const& src,
    +
    256  typename View::point_t const& topleft,
    +
    257  typename View::point_t const& dimensions)
    +
    258 {
    +
    259  return View(dimensions, src.xy_at(topleft));
    +
    260 }
    +
    261 
    +
    263 template <typename View>
    +
    264 inline View subimage_view(View const& src,
    +
    265  typename View::coord_t x_min,
    +
    266  typename View::coord_t y_min,
    +
    267  typename View::coord_t width,
    +
    268  typename View::coord_t height)
    +
    269 {
    +
    270  return View(width, height, src.xy_at(x_min, y_min));
    +
    271 }
    +
    272 
    +
    276 
    +
    278 template <typename View>
    +
    279 inline
    +
    280 auto subsampled_view(View const& src, typename View::coord_t x_step, typename View::coord_t y_step)
    + +
    282 {
    +
    283  BOOST_ASSERT(x_step > 0 && y_step > 0);
    +
    284  using view_t =typename dynamic_xy_step_type<View>::type;
    +
    285  return view_t(
    +
    286  (src.width() + (x_step - 1)) / x_step,
    +
    287  (src.height() + (y_step - 1)) / y_step,
    +
    288  typename view_t::xy_locator(src.xy_at(0,0), x_step, y_step));
    +
    289 }
    +
    290 
    +
    292 template <typename View>
    +
    293 inline auto subsampled_view(View const& src, typename View::point_t const& step)
    + +
    295 {
    +
    296  return subsampled_view(src, step.x, step.y);
    +
    297 }
    +
    298 
    +
    302 
    +
    303 namespace detail {
    +
    304  template <typename View, bool AreChannelsTogether> struct __nth_channel_view_basic;
    +
    305 
    +
    306  // nth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
    +
    307  // or images with a step
    +
    308  template <typename View>
    +
    309  struct __nth_channel_view_basic<View,false> {
    +
    310  using type = typename view_type<typename channel_type<View>::type, gray_layout_t, false, true, view_is_mutable<View>::value>::type;
    +
    311 
    +
    312  static type make(const View& src, int n) {
    +
    313  using locator_t = typename type::xy_locator;
    +
    314  using x_iterator_t = typename type::x_iterator;
    +
    315  using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
    +
    316  x_iterator_t sit(x_iterator_base_t(&(src(0,0)[n])),src.pixels().pixel_size());
    +
    317  return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
    +
    318  }
    +
    319  };
    +
    320 
    +
    321  // nth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
    +
    322  template <typename View>
    +
    323  struct __nth_channel_view_basic<View,true> {
    +
    324  using type = typename view_type<typename channel_type<View>::type, gray_layout_t, false, false, view_is_mutable<View>::value>::type;
    +
    325  static type make(const View& src, int n) {
    +
    326  using x_iterator_t = typename type::x_iterator;
    +
    327  return interleaved_view(src.width(),src.height(),(x_iterator_t)&(src(0,0)[n]), src.pixels().row_size());
    +
    328  }
    +
    329  };
    +
    330 
    +
    331  template <typename View, bool IsBasic> struct __nth_channel_view;
    +
    332 
    +
    333  // For basic (memory-based) views dispatch to __nth_channel_view_basic
    +
    334  template <typename View>
    +
    335  struct __nth_channel_view<View,true>
    +
    336  {
    +
    337  private:
    +
    338  using src_x_iterator = typename View::x_iterator;
    +
    339 
    +
    340  // Determines whether the channels of a given pixel iterator are adjacent in memory.
    +
    341  // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
    +
    342  static constexpr bool adjacent =
    +
    343  !iterator_is_step<src_x_iterator>::value &&
    +
    344  (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
    +
    345 
    +
    346  public:
    +
    347  using type = typename __nth_channel_view_basic<View,adjacent>::type;
    +
    348 
    +
    349  static type make(const View& src, int n) {
    +
    350  return __nth_channel_view_basic<View,adjacent>::make(src,n);
    +
    351  }
    +
    352  };
    +
    353 
    +
    358  template <typename SrcP> // SrcP is a reference to PixelConcept (could be pixel value or const/non-const reference)
    +
    359  // Examples: pixel<T,L>, pixel<T,L>&, const pixel<T,L>&, planar_pixel_reference<T&,L>, planar_pixel_reference<const T&,L>
    + +
    361  {
    +
    362  static constexpr bool is_mutable =
    + +
    364  private:
    +
    365  using src_pixel_t = typename std::remove_reference<SrcP>::type;
    +
    366  using channel_t = typename channel_type<src_pixel_t>::type;
    +
    367  using const_ref_t = typename src_pixel_t::const_reference;
    + +
    369  public:
    + +
    371  using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
    + +
    373  using argument_type = SrcP;
    +
    374  using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
    +
    375  using result_type = reference;
    +
    376 
    +
    377  nth_channel_deref_fn(int n=0) : _n(n) {}
    +
    378  template <typename P> nth_channel_deref_fn(const nth_channel_deref_fn<P>& d) : _n(d._n) {}
    +
    379 
    +
    380  int _n; // the channel to use
    +
    381 
    +
    382  result_type operator()(argument_type srcP) const {
    +
    383  return result_type(srcP[_n]);
    +
    384  }
    +
    385  };
    +
    386 
    +
    387  template <typename View> struct __nth_channel_view<View,false> {
    +
    388  private:
    + +
    390  using AD = typename View::template add_deref<deref_t>;
    +
    391  public:
    +
    392  using type = typename AD::type;
    +
    393  static type make(const View& src, int n) {
    +
    394  return AD::make(src, deref_t(n));
    +
    395  }
    +
    396  };
    +
    397 } // namespace detail
    +
    398 
    +
    405 template <typename View>
    + +
    407 private:
    +
    408  BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
    +
    409  using VB = detail::__nth_channel_view<View,view_is_basic<View>::value>;
    +
    410 public:
    +
    411  using type = typename VB::type;
    +
    412  static type make(const View& src, int n) { return VB::make(src,n); }
    +
    413 };
    +
    414 
    +
    415 
    +
    417 template <typename View>
    +
    418 typename nth_channel_view_type<View>::type nth_channel_view(const View& src, int n) {
    +
    419  return nth_channel_view_type<View>::make(src,n);
    +
    420 }
    +
    421 
    +
    422 
    +
    423 
    +
    424 
    +
    425 
    +
    426 
    +
    427 
    +
    431 
    +
    432 namespace detail {
    +
    433  template <int K, typename View, bool AreChannelsTogether> struct __kth_channel_view_basic;
    +
    434 
    +
    435  // kth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
    +
    436  // or images with a step
    +
    437  template <int K, typename View>
    +
    438  struct __kth_channel_view_basic<K,View,false> {
    +
    439  private:
    +
    440  using channel_t = typename kth_element_type<typename View::value_type,K>::type;
    +
    441  public:
    +
    442  using type = typename view_type<channel_t, gray_layout_t, false, true, view_is_mutable<View>::value>::type;
    +
    443 
    +
    444  static type make(const View& src) {
    +
    445  using locator_t = typename type::xy_locator;
    +
    446  using x_iterator_t = typename type::x_iterator;
    +
    447  using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
    +
    448  x_iterator_t sit(x_iterator_base_t(&gil::at_c<K>(src(0,0))),src.pixels().pixel_size());
    +
    449  return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
    +
    450  }
    +
    451  };
    +
    452 
    +
    453  // kth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
    +
    454  template <int K, typename View>
    +
    455  struct __kth_channel_view_basic<K,View,true> {
    +
    456  private:
    +
    457  using channel_t = typename kth_element_type<typename View::value_type, K>::type;
    +
    458  public:
    +
    459  using type = typename view_type<channel_t, gray_layout_t, false, false, view_is_mutable<View>::value>::type;
    +
    460  static type make(const View& src) {
    +
    461  using x_iterator_t = typename type::x_iterator;
    +
    462  return interleaved_view(src.width(),src.height(),(x_iterator_t)&gil::at_c<K>(src(0,0)), src.pixels().row_size());
    +
    463  }
    +
    464  };
    +
    465 
    +
    466  template <int K, typename View, bool IsBasic> struct __kth_channel_view;
    +
    467 
    +
    468  // For basic (memory-based) views dispatch to __kth_channel_view_basic
    +
    469  template <int K, typename View> struct __kth_channel_view<K,View,true>
    +
    470  {
    +
    471  private:
    +
    472  using src_x_iterator = typename View::x_iterator;
    +
    473 
    +
    474  // Determines whether the channels of a given pixel iterator are adjacent in memory.
    +
    475  // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
    +
    476  static constexpr bool adjacent =
    +
    477  !iterator_is_step<src_x_iterator>::value &&
    +
    478  (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
    +
    479 
    +
    480  public:
    +
    481  using type = typename __kth_channel_view_basic<K,View,adjacent>::type;
    +
    482 
    +
    483  static type make(const View& src) {
    +
    484  return __kth_channel_view_basic<K,View,adjacent>::make(src);
    +
    485  }
    +
    486  };
    +
    487 
    +
    494  template <int K, typename SrcP>
    + +
    496  {
    +
    497  static constexpr bool is_mutable =
    + +
    499 
    +
    500  private:
    +
    501  using src_pixel_t = typename std::remove_reference<SrcP>::type;
    +
    502  using channel_t = typename kth_element_type<src_pixel_t, K>::type;
    +
    503  using const_ref_t = typename src_pixel_t::const_reference;
    + +
    505 
    +
    506  public:
    + +
    508  using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
    + +
    510  using argument_type = SrcP;
    +
    511  using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
    +
    512  using result_type = reference;
    +
    513 
    + +
    515  template <typename P> kth_channel_deref_fn(const kth_channel_deref_fn<K,P>&) {}
    +
    516 
    +
    517  result_type operator()(argument_type srcP) const {
    +
    518  return result_type(gil::at_c<K>(srcP));
    +
    519  }
    +
    520  };
    +
    521 
    +
    522  template <int K, typename View> struct __kth_channel_view<K,View,false> {
    +
    523  private:
    + +
    525  using AD = typename View::template add_deref<deref_t>;
    +
    526  public:
    +
    527  using type = typename AD::type;
    +
    528  static type make(const View& src) {
    +
    529  return AD::make(src, deref_t());
    +
    530  }
    +
    531  };
    +
    532 } // namespace detail
    +
    533 
    +
    540 template <int K, typename View>
    + +
    542 private:
    +
    543  BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
    +
    544  using VB = detail::__kth_channel_view<K,View,view_is_basic<View>::value>;
    +
    545 public:
    +
    546  using type = typename VB::type;
    +
    547  static type make(const View& src) { return VB::make(src); }
    +
    548 };
    +
    549 
    +
    551 template <int K, typename View>
    +
    552 typename kth_channel_view_type<K,View>::type kth_channel_view(const View& src) {
    + +
    554 }
    +
    555 
    +
    556 } } // namespace boost::gil
    +
    557 
    +
    558 #endif
    +
    dynamic_xy_step_transposed_type< View >::type rotated90ccw_view(const View &src)
    Definition: image_view_factory.hpp:232
    +
    auto subsampled_view(View const &src, typename View::point_t const &step) -> typename dynamic_xy_step_type< View >::type
    Definition: image_view_factory.hpp:293
    +
    Returns the type of a view that does color conversion upon dereferencing its pixels.
    Definition: image_view_factory.hpp:159
    +
    detail::channel_pointer_type< HomogeneousView >::type planar_view_get_raw_data(const HomogeneousView &view, int plane_index)
    Returns C pointer to the the channels of a given color plane of a planar homogeneous view.
    Definition: image_view_factory.hpp:106
    +
    detail::channel_pointer_type< HomogeneousView >::type interleaved_view_get_raw_data(const HomogeneousView &view)
    Returns C pointer to the the channels of an interleaved homogeneous view.
    Definition: image_view_factory.hpp:96
    +
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:101
    +
    Function object that given a source pixel, returns it converted to a given color space and channel de...
    Definition: image_view_factory.hpp:121
    +
    nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
    Definition: image_view_factory.hpp:418
    +
    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:51
    +
    layout< gray_t > gray_layout_t
    Definition: gray.hpp:24
    +
    dynamic_xy_step_transposed_type< View >::type transposed_view(const View &src)
    Definition: image_view_factory.hpp:210
    +
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
    Definition: metafunctions.hpp:23
    +
    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:541
    +
    Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
    Definition: metafunctions.hpp:266
    +
    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)
    Definition: image_view_factory.hpp:264
    +
    Determines if the given pixel reference is mutable (i.e. its channels can be changed)
    Definition: metafunctions.hpp:228
    +
    Basic views must be over basic locators.
    Definition: metafunctions.hpp:129
    +
    A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
    Definition: image_view.hpp:53
    +
    GIL's 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:375
    +
    dynamic_x_step_type< View >::type flipped_left_right_view(const View &src)
    Definition: image_view_factory.hpp:199
    +
    Returns the type of a view that has a dynamic step along both X and Y.
    Definition: dynamic_step.hpp:27
    +
    Definition: image_view_factory.hpp:40
    +
    Function object that returns a grayscale reference of the K-th channel (specified as a template param...
    Definition: image_view_factory.hpp:495
    +
    dynamic_xy_step_type< View >::type rotated180_view(const View &src)
    Definition: image_view_factory.hpp:243
    +
    Helper base class for pixel dereference adaptors.
    Definition: utilities.hpp:106
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:548
    + +
    Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
    Definition: metafunctions.hpp:216
    +
    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:406
    +
    Definition: color_convert.hpp:31
    +
    dynamic_xy_step_transposed_type< View >::type rotated90cw_view(const View &src)
    Definition: image_view_factory.hpp:221
    +
    dynamic_y_step_type< View >::type flipped_up_down_view(const View &src)
    Definition: image_view_factory.hpp:188
    +
    Function object that returns a grayscale reference of the N-th channel of a given reference....
    Definition: image_view_factory.hpp:360
    +
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    +
    kth_channel_view_type< K, View >::type kth_channel_view(const View &src)
    Definition: image_view_factory.hpp:552
    +
    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:67
    +
    color_converted_view_type< View, DstP >::type color_converted_view(const View &src)
    overload of generic color_converted_view with the default color-converter
    Definition: image_view_factory.hpp:178
    +
    class for color-converting one pixel to another
    Definition: color_convert.hpp:325
    diff --git a/develop/doc/html/reference/index.html b/develop/doc/html/reference/index.html index aefe9da85..91838de46 100644 --- a/develop/doc/html/reference/index.html +++ b/develop/doc/html/reference/index.html @@ -4,7 +4,7 @@ - + Generic Image Library: API Reference @@ -27,18 +27,18 @@

    - - + + + + +
    -
    +
    API Reference
    @@ -122,13 +122,14 @@ Modules
-
+
+
diff --git a/develop/doc/html/reference/io_2typedefs_8hpp_source.html b/develop/doc/html/reference/io_2typedefs_8hpp_source.html index 87c199565..34d3f7316 100644 --- a/develop/doc/html/reference/io_2typedefs_8hpp_source.html +++ b/develop/doc/html/reference/io_2typedefs_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: typedefs.hpp Source File @@ -27,21 +27,16 @@

- - - + + + + +
-
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:128
-
Definition: algorithm.hpp:30
-
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:124
+
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:128
+
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:124
diff --git a/develop/doc/html/reference/io_8hpp_source.html b/develop/doc/html/reference/io_8hpp_source.html index 80d87547d..c97cb7363 100644 --- a/develop/doc/html/reference/io_8hpp_source.html +++ b/develop/doc/html/reference/io_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: io.hpp Source File @@ -27,21 +27,16 @@

- - - + + + + +
-
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/develop/doc/html/reference/iobackend.html b/develop/doc/html/reference/iobackend.html index d6920dac5..a55b6683a 100644 --- a/develop/doc/html/reference/iobackend.html +++ b/develop/doc/html/reference/iobackend.html @@ -4,7 +4,7 @@ - + Generic Image Library: Adding a new io backend @@ -27,18 +27,18 @@

- - + + + + +
-
+
Adding a new io backend
@@ -50,24 +50,64 @@ of backend requirements
  • boolean meta function is_supported<PixelType,FormatTag> must be implemented for the new format tag
  • explicit specialisation of image_read_info<FormatTag> must be provided, containing runtime information available before/at reading the image
  • explicit specialisation of image_write_info<FormatTag> must be provided, containing runtime encoding parameters for writing an image
  • -
  • An image reader must be specialized:
    template<typename IODevice, typename ConversionPolicy>
    struct boost::gil::reader<IODevice,FormatTag,ConversionPolicy>
    {
    reader( IODevice & device )
    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 );
    template<typename View>
    void read_view( View &, point_t const& top_left );
    };
  • -
  • An image writer must be specialized:
    \template <typename IODevice>
    struct boost::gil::writer<IODevice,FormatTag>
    {
    writer( IODevice & device )
    template<typename View>
    void apply( View const&, point_t const& top_left );
    template<typename View>
    void apply( View const&, point_t const& top_left, image_write_info<FormatTag> const& );
    };
  • +
  • An image reader must be specialized:
    template<typename IODevice, typename ConversionPolicy>
    +
    struct boost::gil::reader<IODevice,FormatTag,ConversionPolicy>
    +
    {
    +
    reader( IODevice & device )
    +
    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 );
    +
    template<typename View>
    +
    void read_view( View &, point_t const& top_left );
    +
    };
    +
  • +
  • An image writer must be specialized:
    \template <typename IODevice>
    +
    struct boost::gil::writer<IODevice,FormatTag>
    +
    {
    +
    writer( IODevice & device )
    +
    template<typename View>
    +
    void apply( View const&, point_t const& top_left );
    +
    template<typename View>
    +
    void apply( View const&, point_t const& top_left, image_write_info<FormatTag> const& );
    +
    };
    +
  • Or instead of the items above implement overloads of read_view, read_and_convert_view, read_image, read_and_convert_image, write_view and read_image_info.

    Interface of the ConversionPolicy

    There are two different conversion policies in use, when reading images: read_and_convert<ColorConverter> and read_and_no_convert. ColorConverter can be a user defined color converter.

    -
    struct ConversionPolicy
    {
    template<typename InputIterator,typename OutputIterator>
    void read( InputIterator in_begin, InputIterator in_end,
    OutputIterator out_end );
    };

    Methods like read_view and read_image are supposed to bail out with an exception instead of converting the image

    +
    struct ConversionPolicy
    +
    {
    +
    template<typename InputIterator,typename OutputIterator>
    +
    void read( InputIterator in_begin, InputIterator in_end,
    +
    OutputIterator out_end );
    +
    };
    +

    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
    {
    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{
    template<typename Device>
    struct detail::is_input_device;
    }}}
    +
    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();
    +
    };
    +

    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;
    +
    }}}
    +
    +
    +
    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
    diff --git a/develop/doc/html/reference/iterator__from__2d_8hpp_source.html b/develop/doc/html/reference/iterator__from__2d_8hpp_source.html index b37d2fd8a..af3b78068 100644 --- a/develop/doc/html/reference/iterator__from__2d_8hpp_source.html +++ b/develop/doc/html/reference/iterator__from__2d_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: iterator_from_2d.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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> > {
    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> > {
    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
    Definition: algorithm.hpp:30
    -
    Definition: algorithm.hpp:30
    -
    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept.
    Definition: iterator_from_2d.hpp:42
    -
    GIL&#39;s 2-dimensional locator over immutable GIL pixels.
    Definition: pixel_locator.hpp:291
    -
    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:1029
    -
    reference operator[](difference_type d) const
    Definition: iterator_from_2d.hpp:65
    -
    Definition: color_convert.hpp:31
    -
    Metafunction predicate returning whether the given iterator allows for changing its values...
    Definition: pixel_iterator.hpp:49
    -
    Returns the type of an iterator just like the input iterator, except operating over immutable values...
    Definition: pixel_iterator.hpp:40
    -
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    +
    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
    +
    GIL's 2-dimensional locator over immutable GIL pixels.
    Definition: pixel_locator.hpp:291
    +
    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
    Definition: iterator_from_2d.hpp:42
    +
    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:1076
    +
    reference operator[](difference_type d) const
    Definition: iterator_from_2d.hpp:65
    diff --git a/develop/doc/html/reference/jpeg_8hpp_source.html b/develop/doc/html/reference/jpeg_8hpp_source.html index e833af753..b89c4e09e 100644 --- a/develop/doc/html/reference/jpeg_8hpp_source.html +++ b/develop/doc/html/reference/jpeg_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: jpeg.hpp Source File @@ -27,21 +27,16 @@

    - - - + + + + +
    -
    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/develop/doc/html/reference/jquery.js b/develop/doc/html/reference/jquery.js index d52a1c775..103c32d79 100644 --- a/develop/doc/html/reference/jquery.js +++ b/develop/doc/html/reference/jquery.js @@ -1,68 +1,35 @@ -/* - * jQuery JavaScript Library v1.7.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Nov 21 21:11:03 2011 -0500 +/*! 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 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});/** + * Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler + * Licensed under MIT + * @author Ariel Flesler + * @version 2.1.2 */ -(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
    a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
    ";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
    t
    ";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
    ";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); -/* - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

    ";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
    ","
    "]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
    ").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/* - * jQuery UI 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/* - * jQuery UI Widget 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/* - * jQuery UI Mouse 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
    ').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("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom: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({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{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"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
    ');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,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}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/* - * jQuery hashchange event - v1.3 - 7/21/2010 - * http://benalman.com/projects/jquery-hashchange-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('