From 0d47fc0208241ab11ebd5bb25dd72c84d2b5b807 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 18 Feb 2022 08:57:25 +0000 Subject: [PATCH] deploy: 9bd8642f69bdbf5dfd01df45682efd50dd18fa53 --- .../convolution.cpp | 5 +- develop/doc/html/design/basics.html | 2 +- develop/doc/html/design/channel.html | 2 +- develop/doc/html/design/color_base.html | 2 +- develop/doc/html/design/color_space.html | 2 +- develop/doc/html/design/concepts.html | 2 +- develop/doc/html/design/conclusions.html | 2 +- develop/doc/html/design/dynamic_image.html | 2 +- develop/doc/html/design/examples.html | 2 +- develop/doc/html/design/extending.html | 2 +- develop/doc/html/design/image.html | 2 +- develop/doc/html/design/image_view.html | 2 +- develop/doc/html/design/index.html | 2 +- develop/doc/html/design/metafunctions.html | 2 +- develop/doc/html/design/pixel.html | 2 +- develop/doc/html/design/pixel_iterator.html | 2 +- develop/doc/html/design/pixel_locator.html | 2 +- develop/doc/html/design/point.html | 2 +- develop/doc/html/design/technicalities.html | 2 +- develop/doc/html/genindex.html | 2 +- develop/doc/html/histogram/create.html | 2 +- develop/doc/html/histogram/cumulative.html | 2 +- develop/doc/html/histogram/extend.html | 2 +- .../doc/html/histogram/extension/index.html | 2 +- .../html/histogram/extension/overview.html | 2 +- develop/doc/html/histogram/extension/std.html | 2 +- develop/doc/html/histogram/fill.html | 2 +- develop/doc/html/histogram/index.html | 2 +- develop/doc/html/histogram/limitations.html | 2 +- develop/doc/html/histogram/overview.html | 2 +- .../doc/html/histogram/stl_compatibility.html | 2 +- develop/doc/html/histogram/subhistogram.html | 2 +- develop/doc/html/histogram/utilities.html | 2 +- .../affine-region-detectors.html | 2 +- develop/doc/html/image_processing/basics.html | 2 +- .../histogram_equalization.html | 2 +- .../histogram_matching.html | 2 +- .../contrast_enhancement/index.html | 2 +- .../contrast_enhancement/overview.html | 2 +- develop/doc/html/image_processing/index.html | 2 +- .../doc/html/image_processing/overview.html | 2 +- develop/doc/html/index.html | 2 +- develop/doc/html/installation.html | 2 +- develop/doc/html/io.html | 2 +- develop/doc/html/naming.html | 2 +- develop/doc/html/numeric.html | 2 +- ...__histogram__equalization_8hpp_source.html | 4 +- .../html/reference/algorithm_8hpp_source.html | 2372 ++++++++++------- develop/doc/html/reference/annotated.html | 532 ++-- .../any__image__view_8hpp_source.html | 2 +- ..._aligned__pixel__iterator_8hpp_source.html | 4 +- ...aligned__pixel__reference_8hpp_source.html | 4 +- ...nnel__numeric__operations_8hpp_source.html | 283 ++ ...il_1_1detail_1_1correlator__n-members.html | 65 + ...ost_1_1gil_1_1detail_1_1correlator__n.html | 87 + ...detail_1_1kernel__1d__adaptor-members.html | 72 + ...1gil_1_1detail_1_1kernel__1d__adaptor.html | 106 + ..._1gil_1_1detail_1_1kernel__2d-members.html | 84 + ...sboost_1_1gil_1_1detail_1_1kernel__2d.html | 95 + ..._1detail_1_1kernel__2d__fixed-members.html | 85 + ...1_1gil_1_1detail_1_1kernel__2d__fixed.html | 102 + .../reference/classboost_1_1gil_1_1image.html | 2 +- .../classboost_1_1gil_1_1image__view.html | 2 +- ...assboost_1_1gil_1_1kernel__1d-members.html | 77 + .../classboost_1_1gil_1_1kernel__1d.html | 127 + .../classboost_1_1gil_1_1kernel__1d.png | Bin 0 -> 995 bytes ...t_1_1gil_1_1kernel__1d__fixed-members.html | 78 + ...lassboost_1_1gil_1_1kernel__1d__fixed.html | 134 + ...classboost_1_1gil_1_1kernel__1d__fixed.png | Bin 0 -> 837 bytes develop/doc/html/reference/classes.html | 435 +-- .../doc/html/reference/cmyk_8hpp_source.html | 4 +- .../reference/color__convert_8hpp_source.html | 2 +- .../concepts_2image_8hpp_source.html | 6 +- ...concepts_2pixel__iterator_8hpp_source.html | 4 +- .../conversion__policies_8hpp_source.html | 2 +- .../html/reference/convolve_8hpp_source.html | 413 +++ .../html/reference/device__n_8hpp_source.html | 2 +- .../html/reference/diffusion_8hpp_source.html | 6 +- .../dynamic__io__new_8hpp_source.html | 2 +- ...dynamic__image_2algorithm_8hpp_source.html | 2 +- develop/doc/html/reference/files.html | 188 +- .../html/reference/filter_8hpp_source.html | 272 +- develop/doc/html/reference/functions.html | 10 +- .../doc/html/reference/functions_func.html | 10 +- .../group___corner_detection_algorithms.html | 4 +- .../group___image_processing_math.html | 28 +- .../html/reference/harris_8hpp_source.html | 5 +- .../html/reference/hessian_8hpp_source.html | 2 +- develop/doc/html/reference/hierarchy.html | 641 ++--- .../html/reference/histogram_8hpp_source.html | 2 +- .../doc/html/reference/image_8hpp_source.html | 1120 ++++---- .../reference/image__view_8hpp_source.html | 2 +- .../image__view__factory_8hpp_source.html | 12 +- .../iterator__from__2d_8hpp_source.html | 2 +- .../html/reference/kernel_8hpp_source.html | 418 +++ .../reference/metafunctions_8hpp_source.html | 1291 ++++----- .../reference/morphology_8hpp_source.html | 369 +-- .../html/reference/numeric_8hpp_source.html | 476 ++-- .../pixel__iterator_8hpp_source.html | 2 +- ...ixel__numeric__operations_8hpp_source.html | 250 ++ .../planar__pixel__iterator_8hpp_source.html | 2 +- .../planar__pixel__reference_8hpp_source.html | 4 +- .../position__iterator_8hpp_source.html | 2 +- ...read__and__convert__image_8hpp_source.html | 2 +- .../read__and__convert__view_8hpp_source.html | 2 +- .../reference/read__image_8hpp_source.html | 2 +- .../reference/read__view_8hpp_source.html | 2 +- .../reference/reader__base_8hpp_source.html | 2 +- .../doc/html/reference/rgb_8hpp_source.html | 4 +- .../doc/html/reference/rgba_8hpp_source.html | 4 +- .../html/reference/scaling_8hpp_source.html | 2 +- .../scanline__read__iterator_8hpp_source.html | 2 +- .../reference/step__iterator_8hpp_source.html | 2 +- ...l_1_1_random_access_n_d_image_concept.html | 4 +- ...1_1gil_1_1channel__assigns__t-members.html | 66 + ...ctboost_1_1gil_1_1channel__assigns__t.html | 134 + ..._1channel__divides__scalar__t-members.html | 65 + ...1_1gil_1_1channel__divides__scalar__t.html | 135 + ...1_1gil_1_1channel__divides__t-members.html | 66 + ...ctboost_1_1gil_1_1channel__divides__t.html | 138 + ..._1_1gil_1_1channel__halves__t-members.html | 65 + ...uctboost_1_1gil_1_1channel__halves__t.html | 91 + ..._1_1channel__minus__scalar__t-members.html | 65 + ...t_1_1gil_1_1channel__minus__scalar__t.html | 135 + ...t_1_1gil_1_1channel__minus__t-members.html | 66 + ...ructboost_1_1gil_1_1channel__minus__t.html | 138 + ...hannel__multiplies__scalar__t-members.html | 65 + ...gil_1_1channel__multiplies__scalar__t.html | 135 + ...gil_1_1channel__multiplies__t-members.html | 66 + ...oost_1_1gil_1_1channel__multiplies__t.html | 138 + ...l_1_1channel__plus__scalar__t-members.html | 65 + ...st_1_1gil_1_1channel__plus__scalar__t.html | 91 + ...st_1_1gil_1_1channel__plus__t-members.html | 66 + ...tructboost_1_1gil_1_1channel__plus__t.html | 138 + ...t_1_1gil_1_1channel__zeros__t-members.html | 65 + ...ructboost_1_1gil_1_1channel__zeros__t.html | 91 + ...il_1_1detail_1_1correlator__k-members.html | 64 + ...ost_1_1gil_1_1detail_1_1correlator__k.html | 84 + ...t_1_1gil_1_1pixel__assigns__t-members.html | 64 + ...ructboost_1_1gil_1_1pixel__assigns__t.html | 91 + ...st_1_1gil_1_1pixel__divide__t-members.html | 64 + ...tructboost_1_1gil_1_1pixel__divide__t.html | 91 + ..._1_1pixel__divides__scalar__t-members.html | 64 + ...t_1_1gil_1_1pixel__divides__scalar__t.html | 91 + ...st_1_1gil_1_1pixel__halves__t-members.html | 64 + ...tructboost_1_1gil_1_1pixel__halves__t.html | 89 + ...ost_1_1gil_1_1pixel__minus__t-members.html | 64 + ...structboost_1_1gil_1_1pixel__minus__t.html | 91 + ...1pixel__multiplies__scalar__t-members.html | 64 + ..._1gil_1_1pixel__multiplies__scalar__t.html | 91 + ..._1_1gil_1_1pixel__multiply__t-members.html | 64 + ...uctboost_1_1gil_1_1pixel__multiply__t.html | 91 + ...oost_1_1gil_1_1pixel__plus__t-members.html | 64 + .../structboost_1_1gil_1_1pixel__plus__t.html | 91 + .../structboost_1_1gil_1_1pixel__proxy.html | 76 + ...ost_1_1gil_1_1pixel__zeros__t-members.html | 64 + ...structboost_1_1gil_1_1pixel__zeros__t.html | 89 + .../html/reference/threshold_8hpp_source.html | 853 +++--- .../html/reference/utilities_8hpp_source.html | 2 +- .../reference/write__view_8hpp_source.html | 2 +- develop/doc/html/search.html | 2 +- develop/doc/html/toolbox.html | 2 +- develop/doc/html/tutorial/gradient.html | 2 +- develop/doc/html/tutorial/histogram.html | 2 +- develop/doc/html/tutorial/video.html | 2 +- 165 files changed, 10846 insertions(+), 4150 deletions(-) create mode 100644 develop/doc/html/reference/channel__numeric__operations_8hpp_source.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n-members.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d-members.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d.png create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html create mode 100644 develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.png create mode 100644 develop/doc/html/reference/convolve_8hpp_source.html create mode 100644 develop/doc/html/reference/kernel_8hpp_source.html create mode 100644 develop/doc/html/reference/pixel__numeric__operations_8hpp_source.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__proxy.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t-members.html create mode 100644 develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t.html diff --git a/develop/doc/html/_downloads/975e2af95a20efe1ab7b36bc39833e6a/convolution.cpp b/develop/doc/html/_downloads/975e2af95a20efe1ab7b36bc39833e6a/convolution.cpp index b5e911da9..52c27b5d0 100644 --- a/develop/doc/html/_downloads/975e2af95a20efe1ab7b36bc39833e6a/convolution.cpp +++ b/develop/doc/html/_downloads/975e2af95a20efe1ab7b36bc39833e6a/convolution.cpp @@ -1,5 +1,6 @@ // // Copyright 2005-2007 Adobe Systems Incorporated +// Copyright 2021 Pranam Lashkari // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at @@ -7,8 +8,8 @@ #include #include -#include -#include +#include +#include // Convolves the image with a Gaussian kernel. diff --git a/develop/doc/html/design/basics.html b/develop/doc/html/design/basics.html index f4b807531..d91a1263b 100644 --- a/develop/doc/html/design/basics.html +++ b/develop/doc/html/design/basics.html @@ -114,7 +114,7 @@ read the sections in order.

diff --git a/develop/doc/html/design/channel.html b/develop/doc/html/design/channel.html index 67b659f6c..33b05a5c7 100644 --- a/develop/doc/html/design/channel.html +++ b/develop/doc/html/design/channel.html @@ -263,7 +263,7 @@ channel-level algorithms that GIL provides:

diff --git a/develop/doc/html/design/color_base.html b/develop/doc/html/design/color_base.html index ea992afa3..70f789482 100644 --- a/develop/doc/html/design/color_base.html +++ b/develop/doc/html/design/color_base.html @@ -310,7 +310,7 @@ color base require that they all have the same color space.

diff --git a/develop/doc/html/design/color_space.html b/develop/doc/html/design/color_space.html index 09ed5ef53..8567ea404 100644 --- a/develop/doc/html/design/color_space.html +++ b/develop/doc/html/design/color_space.html @@ -162,7 +162,7 @@ A color space and its associated mapping are often used together.

diff --git a/develop/doc/html/design/concepts.html b/develop/doc/html/design/concepts.html index b7a07f7f7..3bc000978 100644 --- a/develop/doc/html/design/concepts.html +++ b/develop/doc/html/design/concepts.html @@ -143,7 +143,7 @@ Most of them are defined at the diff --git a/develop/doc/html/design/conclusions.html b/develop/doc/html/design/conclusions.html index d510d4033..4b2f7fc94 100644 --- a/develop/doc/html/design/conclusions.html +++ b/develop/doc/html/design/conclusions.html @@ -121,7 +121,7 @@ raw pixel data from another image library.

diff --git a/develop/doc/html/design/dynamic_image.html b/develop/doc/html/design/dynamic_image.html index 013a94129..249859507 100644 --- a/develop/doc/html/design/dynamic_image.html +++ b/develop/doc/html/design/dynamic_image.html @@ -274,7 +274,7 @@ uniformly as a collection and store them in the same container.

diff --git a/develop/doc/html/design/examples.html b/develop/doc/html/design/examples.html index 1e049b52c..b31ee1f7f 100644 --- a/develop/doc/html/design/examples.html +++ b/develop/doc/html/design/examples.html @@ -264,7 +264,7 @@ channel depth. They could be either planar or interleaved.

diff --git a/develop/doc/html/design/extending.html b/develop/doc/html/design/extending.html index 3065b87af..9aac6e59b 100644 --- a/develop/doc/html/design/extending.html +++ b/develop/doc/html/design/extending.html @@ -234,7 +234,7 @@ defines the Mandelbrot set.

diff --git a/develop/doc/html/design/image.html b/develop/doc/html/design/image.html index f44ea798a..2e61d843c 100644 --- a/develop/doc/html/design/image.html +++ b/develop/doc/html/design/image.html @@ -175,7 +175,7 @@ there are no padding bits at the end of rows of packed images.

diff --git a/develop/doc/html/design/image_view.html b/develop/doc/html/design/image_view.html index 6c048224b..be2fca01a 100644 --- a/develop/doc/html/design/image_view.html +++ b/develop/doc/html/design/image_view.html @@ -486,7 +486,7 @@ development and is not optimized for speed

diff --git a/develop/doc/html/design/index.html b/develop/doc/html/design/index.html index ca4656a45..6d6de243f 100644 --- a/develop/doc/html/design/index.html +++ b/develop/doc/html/design/index.html @@ -102,7 +102,7 @@ structure and basic elements of the Generic Image Library (GIL).

diff --git a/develop/doc/html/design/metafunctions.html b/develop/doc/html/design/metafunctions.html index 526271395..44864e906 100644 --- a/develop/doc/html/design/metafunctions.html +++ b/develop/doc/html/design/metafunctions.html @@ -302,7 +302,7 @@ is basic, but a color converted view or a virtual view is not.

diff --git a/develop/doc/html/design/pixel.html b/develop/doc/html/design/pixel.html index 46b2e27c2..34e10652a 100644 --- a/develop/doc/html/design/pixel.html +++ b/develop/doc/html/design/pixel.html @@ -348,7 +348,7 @@ different color spaces and channel types:

diff --git a/develop/doc/html/design/pixel_iterator.html b/develop/doc/html/design/pixel_iterator.html index 486677969..62292aca4 100644 --- a/develop/doc/html/design/pixel_iterator.html +++ b/develop/doc/html/design/pixel_iterator.html @@ -368,7 +368,7 @@ but not MemoryBased diff --git a/develop/doc/html/design/pixel_locator.html b/develop/doc/html/design/pixel_locator.html index ab5893095..00c8d0c15 100644 --- a/develop/doc/html/design/pixel_locator.html +++ b/develop/doc/html/design/pixel_locator.html @@ -358,7 +358,7 @@ using the x-iterators directly.

diff --git a/develop/doc/html/design/point.html b/develop/doc/html/design/point.html index 1a5e12c7c..e527eb2db 100644 --- a/develop/doc/html/design/point.html +++ b/develop/doc/html/design/point.html @@ -134,7 +134,7 @@ coordinate type.

diff --git a/develop/doc/html/design/technicalities.html b/develop/doc/html/design/technicalities.html index 13f0ced0c..f06e41938 100644 --- a/develop/doc/html/design/technicalities.html +++ b/develop/doc/html/design/technicalities.html @@ -159,7 +159,7 @@ suggesting the above solution.

diff --git a/develop/doc/html/genindex.html b/develop/doc/html/genindex.html index ac620e9e2..d62b57de8 100644 --- a/develop/doc/html/genindex.html +++ b/develop/doc/html/genindex.html @@ -76,7 +76,7 @@ diff --git a/develop/doc/html/histogram/create.html b/develop/doc/html/histogram/create.html index 5fb8f82fd..27ae1e239 100644 --- a/develop/doc/html/histogram/create.html +++ b/develop/doc/html/histogram/create.html @@ -105,7 +105,7 @@ to match the GIL image.

diff --git a/develop/doc/html/histogram/cumulative.html b/develop/doc/html/histogram/cumulative.html index aa8b621b3..8aed2146c 100644 --- a/develop/doc/html/histogram/cumulative.html +++ b/develop/doc/html/histogram/cumulative.html @@ -102,7 +102,7 @@ and then call the function.

diff --git a/develop/doc/html/histogram/extend.html b/develop/doc/html/histogram/extend.html index 2721a2079..aa74db71d 100644 --- a/develop/doc/html/histogram/extend.html +++ b/develop/doc/html/histogram/extend.html @@ -138,7 +138,7 @@ the key.

diff --git a/develop/doc/html/histogram/extension/index.html b/develop/doc/html/histogram/extension/index.html index b51b09c06..b2438c261 100644 --- a/develop/doc/html/histogram/extension/index.html +++ b/develop/doc/html/histogram/extension/index.html @@ -90,7 +90,7 @@ usage of external containers as histograms for GIL images.

diff --git a/develop/doc/html/histogram/extension/overview.html b/develop/doc/html/histogram/extension/overview.html index b39dd2f33..eac4305b0 100644 --- a/develop/doc/html/histogram/extension/overview.html +++ b/develop/doc/html/histogram/extension/overview.html @@ -121,7 +121,7 @@ are provided as extensions.

diff --git a/develop/doc/html/histogram/extension/std.html b/develop/doc/html/histogram/extension/std.html index 4cd22c938..2a828d003 100644 --- a/develop/doc/html/histogram/extension/std.html +++ b/develop/doc/html/histogram/extension/std.html @@ -120,7 +120,7 @@ diff --git a/develop/doc/html/histogram/fill.html b/develop/doc/html/histogram/fill.html index 8cc7ad32c..07c5b6763 100644 --- a/develop/doc/html/histogram/fill.html +++ b/develop/doc/html/histogram/fill.html @@ -182,7 +182,7 @@ which is of std::tu diff --git a/develop/doc/html/histogram/index.html b/develop/doc/html/histogram/index.html index 612f71437..4ddd667ea 100644 --- a/develop/doc/html/histogram/index.html +++ b/develop/doc/html/histogram/index.html @@ -95,7 +95,7 @@ histogram class and functions used in many image processing algorithms.

diff --git a/develop/doc/html/histogram/limitations.html b/develop/doc/html/histogram/limitations.html index 2cdd0d544..b92582fa5 100644 --- a/develop/doc/html/histogram/limitations.html +++ b/develop/doc/html/histogram/limitations.html @@ -82,7 +82,7 @@ diff --git a/develop/doc/html/histogram/overview.html b/develop/doc/html/histogram/overview.html index 4ea1a603a..0085f1a05 100644 --- a/develop/doc/html/histogram/overview.html +++ b/develop/doc/html/histogram/overview.html @@ -114,7 +114,7 @@ key are shipped with the class itself.

diff --git a/develop/doc/html/histogram/stl_compatibility.html b/develop/doc/html/histogram/stl_compatibility.html index 766727224..2be6375bf 100644 --- a/develop/doc/html/histogram/stl_compatibility.html +++ b/develop/doc/html/histogram/stl_compatibility.html @@ -82,7 +82,7 @@ diff --git a/develop/doc/html/histogram/subhistogram.html b/develop/doc/html/histogram/subhistogram.html index b7d81bd94..a61de7e85 100644 --- a/develop/doc/html/histogram/subhistogram.html +++ b/develop/doc/html/histogram/subhistogram.html @@ -137,7 +137,7 @@ and blue color lie between 2 - 10

diff --git a/develop/doc/html/histogram/utilities.html b/develop/doc/html/histogram/utilities.html index 3958bbbf9..73af85ce3 100644 --- a/develop/doc/html/histogram/utilities.html +++ b/develop/doc/html/histogram/utilities.html @@ -82,7 +82,7 @@ diff --git a/develop/doc/html/image_processing/affine-region-detectors.html b/develop/doc/html/image_processing/affine-region-detectors.html index fa906abdc..29b7c2e15 100644 --- a/develop/doc/html/image_processing/affine-region-detectors.html +++ b/develop/doc/html/image_processing/affine-region-detectors.html @@ -162,7 +162,7 @@ detector.” In Alvey vision conference, vol. 15, no. 50, pp. 10-5244. diff --git a/develop/doc/html/image_processing/basics.html b/develop/doc/html/image_processing/basics.html index 4e3295ddf..d8769e032 100644 --- a/develop/doc/html/image_processing/basics.html +++ b/develop/doc/html/image_processing/basics.html @@ -123,7 +123,7 @@ gets sharper depending on it’s sigma value.

diff --git a/develop/doc/html/image_processing/contrast_enhancement/histogram_equalization.html b/develop/doc/html/image_processing/contrast_enhancement/histogram_equalization.html index 8330fdbca..32d68462d 100644 --- a/develop/doc/html/image_processing/contrast_enhancement/histogram_equalization.html +++ b/develop/doc/html/image_processing/contrast_enhancement/histogram_equalization.html @@ -145,7 +145,7 @@ before trying the histogram equalization algorithm.

diff --git a/develop/doc/html/image_processing/contrast_enhancement/histogram_matching.html b/develop/doc/html/image_processing/contrast_enhancement/histogram_matching.html index 4df55d7f0..c137d21bc 100644 --- a/develop/doc/html/image_processing/contrast_enhancement/histogram_matching.html +++ b/develop/doc/html/image_processing/contrast_enhancement/histogram_matching.html @@ -138,7 +138,7 @@ before trying the histogram matching algorithm.

diff --git a/develop/doc/html/image_processing/contrast_enhancement/index.html b/develop/doc/html/image_processing/contrast_enhancement/index.html index 8960c3037..6aab0d572 100644 --- a/develop/doc/html/image_processing/contrast_enhancement/index.html +++ b/develop/doc/html/image_processing/contrast_enhancement/index.html @@ -89,7 +89,7 @@ processing algorithms used for contrast enhancement.

diff --git a/develop/doc/html/image_processing/contrast_enhancement/overview.html b/develop/doc/html/image_processing/contrast_enhancement/overview.html index 72a864a47..1f993ebe4 100644 --- a/develop/doc/html/image_processing/contrast_enhancement/overview.html +++ b/develop/doc/html/image_processing/contrast_enhancement/overview.html @@ -95,7 +95,7 @@ These include :

diff --git a/develop/doc/html/image_processing/index.html b/develop/doc/html/image_processing/index.html index e1c4d0cf4..91685b7e5 100644 --- a/develop/doc/html/image_processing/index.html +++ b/develop/doc/html/image_processing/index.html @@ -103,7 +103,7 @@ features, structures and algorithms, for image processing and analysis.

diff --git a/develop/doc/html/image_processing/overview.html b/develop/doc/html/image_processing/overview.html index 1fa1d2de5..e2907d7cd 100644 --- a/develop/doc/html/image_processing/overview.html +++ b/develop/doc/html/image_processing/overview.html @@ -88,7 +88,7 @@ projects run in frame of the Google Summer of Code 2019:

diff --git a/develop/doc/html/index.html b/develop/doc/html/index.html index 95dc6d6e6..5c43cce2a 100644 --- a/develop/doc/html/index.html +++ b/develop/doc/html/index.html @@ -197,7 +197,7 @@ Blurring images (requires the optional Numeric extension) diff --git a/develop/doc/html/installation.html b/develop/doc/html/installation.html index 98099ed6d..c69b5990a 100644 --- a/develop/doc/html/installation.html +++ b/develop/doc/html/installation.html @@ -105,7 +105,7 @@ of the library repository.

diff --git a/develop/doc/html/io.html b/develop/doc/html/io.html index dc5e6f928..4a02a45cc 100644 --- a/develop/doc/html/io.html +++ b/develop/doc/html/io.html @@ -742,7 +742,7 @@ to enable the tests:

diff --git a/develop/doc/html/naming.html b/develop/doc/html/naming.html index 4d998a6c9..25ece978f 100644 --- a/develop/doc/html/naming.html +++ b/develop/doc/html/naming.html @@ -114,7 +114,7 @@ pixel. diff --git a/develop/doc/html/numeric.html b/develop/doc/html/numeric.html index 783798c8c..3c2cb1a11 100644 --- a/develop/doc/html/numeric.html +++ b/develop/doc/html/numeric.html @@ -79,7 +79,7 @@ diff --git a/develop/doc/html/reference/adaptive__histogram__equalization_8hpp_source.html b/develop/doc/html/reference/adaptive__histogram__equalization_8hpp_source.html index 92126ade4..1d1c8f303 100644 --- a/develop/doc/html/reference/adaptive__histogram__equalization_8hpp_source.html +++ b/develop/doc/html/reference/adaptive__histogram__equalization_8hpp_source.html @@ -310,8 +310,8 @@ $(function() {
303 #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
+
BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
std::copy for image views
Definition: algorithm.hpp:288
+
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:549
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 7a87e5722..72b70159b 100644 --- a/develop/doc/html/reference/algorithm_8hpp_source.html +++ b/develop/doc/html/reference/algorithm_8hpp_source.html @@ -49,1013 +49,1407 @@ $(function() {
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
+
3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
+
4 //
+
5 // Distributed under the Boost Software License, Version 1.0
+
6 // See accompanying file LICENSE_1_0.txt or copy at
+
7 // http://www.boost.org/LICENSE_1_0.txt
+
8 //
+
9 #ifndef BOOST_GIL_ALGORITHM_HPP
+
10 #define BOOST_GIL_ALGORITHM_HPP
+
11 
+
12 #include <boost/gil/metafunctions.hpp>
+
13 #include <boost/gil/pixel_iterator.hpp>
+
14 #include <boost/gil/pixel_numeric_operations.hpp>
+
15 #include <boost/gil/image.hpp>
+
16 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
+
17 #include <boost/gil/color_base_algorithm.hpp>
+
18 #include <boost/gil/concepts.hpp>
+
19 #include <boost/gil/image_view.hpp>
+
20 #include <boost/gil/image_view_factory.hpp>
+
21 #include <boost/gil/detail/mp11.hpp>
+
22 #include <boost/gil/detail/type_traits.hpp>
+
23 
+
24 #include <boost/assert.hpp>
+
25 #include <boost/config.hpp>
+
26 
+
27 #include <algorithm>
+
28 #include <cstddef>
+
29 #include <cstring>
+
30 #include <iterator>
+
31 #include <memory>
+
32 #include <type_traits>
+
33 #include <typeinfo>
+
34 #include <numeric>
+
35 
+
36 namespace boost { namespace gil {
+
37 
+
38 //forward declarations
+
39 template <typename ChannelPtr, typename ColorSpace>
+ +
41 template <typename Iterator>
+ +
43 template <typename StepIterator>
+ +
45 
+
46 // a tag denoting incompatible arguments
+
47 struct error_t {};
+
48 
+
73 
+
77 
+
86 template <typename Derived, typename Result=void>
+ +
88 {
+
89  using result_type = Result;
+
90 
+
91  template <typename V1, typename V2> BOOST_FORCEINLINE
+
92  result_type operator()(const std::pair<const V1*,const V2*>& p) const {
+
93  return apply(*p.first, *p.second, typename views_are_compatible<V1,V2>::type());
+
94  }
+
95 
+
96  template <typename V1, typename V2> BOOST_FORCEINLINE
+
97  result_type operator()(const V1& v1, const V2& v2) const {
+
98  return apply(v1, v2, typename views_are_compatible<V1,V2>::type());
+
99  }
+
100 
+
101  result_type operator()(const error_t&) const { throw std::bad_cast(); }
+
102 private:
+
103 
+
104  // dispatch from apply overload to a function with distinct name
+
105  template <typename V1, typename V2>
+
106  BOOST_FORCEINLINE
+
107  result_type apply(V1 const& v1, V2 const& v2, std::false_type) const
+
108  {
+
109  return ((const Derived*)this)->apply_incompatible(v1, v2);
+
110  }
+
111 
+
112  // dispatch from apply overload to a function with distinct name
+
113  template <typename V1, typename V2>
+
114  BOOST_FORCEINLINE
+
115  result_type apply(V1 const& v1, V2 const& v2, std::true_type) const
+
116  {
+
117  return ((const Derived*)this)->apply_compatible(v1, v2);
+
118  }
+
119 
+
120  // function with distinct name - it can be overloaded by subclasses
+
121  template <typename V1, typename V2>
+
122  BOOST_FORCEINLINE
+
123  result_type apply_incompatible(V1 const& /*v1*/, V2 const& /*v2*/) const
+
124  {
+
125  throw std::bad_cast();
+
126  }
+
127 };
+
128 
+
129 }} // namespace boost::gil
+
130 
+
132 // std::copy and gil::copy_pixels
+
134 
+
138 
+
139 namespace std {
+
140 
+
143 template<typename T, typename CS>
+
144 BOOST_FORCEINLINE
+
145 auto copy(
+ + + + +
150 {
+
151  auto p = std::copy((unsigned char*)first, (unsigned char*)last, (unsigned char*)dst);
+
152  return reinterpret_cast<boost::gil::pixel<T, CS>*>(p);
+
153 }
+
154 
+
157 template<typename T, typename CS>
+
158 BOOST_FORCEINLINE boost::gil::pixel<T,CS>*
+ + +
161  return (boost::gil::pixel<T,CS>*)std::copy((unsigned char*)first,(unsigned char*)last, (unsigned char*)dst);
+
162 }
+
163 } // namespace std
+
164 
+
165 namespace boost { namespace gil {
+
166 namespace detail {
+
167 template <typename I, typename O> struct copy_fn {
+
168  BOOST_FORCEINLINE I operator()(I first, I last, O dst) const { return std::copy(first,last,dst); }
+
169 };
+
170 } // namespace detail
+
171 } } // namespace boost::gil
+
172 
+
173 namespace std {
+
176 template<typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
+ +
178  boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
+
179  static_for_each(first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
+
180  return dst+(last-first);
+
181 }
+
182 } // namespace std
+
183 
+
184 namespace boost { namespace gil {
+
185 namespace detail {
+
188 template <typename I, typename O>
+
189 struct copier_n {
+
190  BOOST_FORCEINLINE void operator()(I src, typename std::iterator_traits<I>::difference_type n, O dst) const { std::copy(src,src+n, dst); }
+
191 };
+
192 
+
194 template <typename IL, typename O> // IL Models ConstPixelLocatorConcept, O Models PixelIteratorConcept
+
195 struct copier_n<iterator_from_2d<IL>,O> {
+
196  using diff_t = typename std::iterator_traits<iterator_from_2d<IL>>::difference_type;
+
197  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, O dst) const {
+
198  gil_function_requires<PixelLocatorConcept<IL>>();
+
199  gil_function_requires<MutablePixelIteratorConcept<O>>();
+
200  while (n>0) {
+
201  diff_t l=src.width()-src.x_pos();
+
202  diff_t numToCopy=(n<l ? n:l);
+
203  detail::copy_n(src.x(), numToCopy, dst);
+
204  dst+=numToCopy;
+
205  src+=numToCopy;
+
206  n-=numToCopy;
+
207  }
+
208  }
+
209 };
+
210 
+
212 template <typename I, typename OL> // I Models ConstPixelIteratorConcept, OL Models PixelLocatorConcept
+
213 struct copier_n<I,iterator_from_2d<OL>> {
+
214  using diff_t = typename std::iterator_traits<I>::difference_type;
+
215  BOOST_FORCEINLINE void operator()(I src, diff_t n, iterator_from_2d<OL> dst) const {
+
216  gil_function_requires<PixelIteratorConcept<I>>();
+
217  gil_function_requires<MutablePixelLocatorConcept<OL>>();
+
218  while (n>0) {
+
219  diff_t l=dst.width()-dst.x_pos();
+
220  diff_t numToCopy=(n<l ? n:l);
+
221  detail::copy_n(src, numToCopy, dst.x());
+
222  dst+=numToCopy;
+
223  src+=numToCopy;
+
224  n-=numToCopy;
+
225  }
+
226  }
+
227 };
+
228 
+
230 template <typename IL, typename OL>
+ +
232  using diff_t = typename iterator_from_2d<IL>::difference_type;
+
233  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, iterator_from_2d<OL> dst) const {
+
234  gil_function_requires<PixelLocatorConcept<IL>>();
+
235  gil_function_requires<MutablePixelLocatorConcept<OL>>();
+
236  if (src.x_pos()!=dst.x_pos() || src.width()!=dst.width()) {
+
237  while(n-->0) {
+
238  *dst++=*src++;
+
239  }
+
240  }
+
241  while (n>0) {
+
242  diff_t l=dst.width()-dst.x_pos();
+
243  diff_t numToCopy=(n<l ? n : l);
+
244  detail::copy_n(src.x(), numToCopy, dst.x());
+
245  dst+=numToCopy;
+
246  src+=numToCopy;
+
247  n-=numToCopy;
+
248  }
+
249  }
+
250 };
+
251 
+
252 template <typename SrcIterator, typename DstIterator>
+
253 BOOST_FORCEINLINE DstIterator copy_with_2d_iterators(SrcIterator first, SrcIterator last, DstIterator dst) {
+
254  using src_x_iterator = typename SrcIterator::x_iterator;
+
255  using dst_x_iterator = typename DstIterator::x_iterator;
+
256 
+
257  typename SrcIterator::difference_type n = last - first;
+
258 
+
259  if (first.is_1d_traversable()) {
+
260  if (dst.is_1d_traversable())
+
261  copier_n<src_x_iterator,dst_x_iterator>()(first.x(),n, dst.x());
+
262  else
+
263  copier_n<src_x_iterator,DstIterator >()(first.x(),n, dst);
+
264  } else {
+
265  if (dst.is_1d_traversable())
+
266  copier_n<SrcIterator,dst_x_iterator>()(first,n, dst.x());
+
267  else
+
268  copier_n<SrcIterator,DstIterator>()(first,n,dst);
+
269  }
+
270  return dst+n;
+
271 }
+
272 } // namespace detail
+
273 } } // namespace boost::gil
+
274 
+
275 namespace std {
+
278 template <typename IL, typename OL>
+ +
280  return boost::gil::detail::copy_with_2d_iterators(first,last,dst);
+
281 }
+
282 } // namespace std
+
283 
+
284 namespace boost { namespace gil {
+
287 template <typename View1, typename View2> BOOST_FORCEINLINE
+
288 void copy_pixels(const View1& src, const View2& dst)
+
289 {
+
290  BOOST_ASSERT(src.dimensions() == dst.dimensions());
+
291  detail::copy_with_2d_iterators(src.begin(),src.end(),dst.begin());
+
292 }
+
293 
+
295 // copy_and_convert_pixels
+
297 
+
303 
+
304 namespace detail {
+
305 template <typename CC>
+
306 class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_pixels_fn<CC>>
+
307 {
+
308 private:
+
309  CC _cc;
+
310 public:
+
311  using result_type = typename binary_operation_obj<copy_and_convert_pixels_fn<default_color_converter>>::result_type;
+
312  copy_and_convert_pixels_fn() {}
+
313  copy_and_convert_pixels_fn(CC cc_in) : _cc(cc_in) {}
+
314  // when the two color spaces are incompatible, a color conversion is performed
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);
+
316  result_type apply_incompatible(const V1& src, const V2& dst) const {
+
317  copy_pixels(color_converted_view<typename V2::value_type>(src,_cc),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>());
+
319 
+
320  // If the two color spaces are compatible, copy_and_convert is just copy
+
321  template <typename V1, typename V2> BOOST_FORCEINLINE
+
322  result_type apply_compatible(const V1& src, const V2& dst) const {
+
323  copy_pixels(src,dst);
+
324  }
+
325 };
+
326 } // namespace detail
+
327 
+
329 template <typename V1, typename V2,typename CC>
+
330 BOOST_FORCEINLINE
+
331 void copy_and_convert_pixels(const V1& src, const V2& dst,CC cc) {
+
332  detail::copy_and_convert_pixels_fn<CC> ccp(cc);
+
333  ccp(src,dst);
+
334 }
+
335 
+
336 struct default_color_converter;
+
337 
+
339 template <typename View1, typename View2>
+
340 BOOST_FORCEINLINE
+
341 void copy_and_convert_pixels(const View1& src, const View2& dst) {
+
342  detail::copy_and_convert_pixels_fn<default_color_converter> ccp;
+
343  ccp(src,dst);
+
344 }
+
345 } } // namespace boost::gil
+
346 
+
348 // std::fill and gil::fill_pixels
+
350 
+
354 
+
355 namespace std {
+
364 template <typename IL, typename V>
+ +
366  boost::gil::gil_function_requires<boost::gil::MutablePixelLocatorConcept<IL>>();
+
367  if (first.is_1d_traversable()) {
+
368  std::fill(first.x(), last.x(), val);
+
369  } else {
+
370  // fill row by row
+
371  std::ptrdiff_t n=last-first;
+
372  while (n>0) {
+
373  std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
+
374  std::fill_n(first.x(), numToDo, val);
+
375  first+=numToDo;
+
376  n-=numToDo;
+
377  }
+
378  }
+
379 }
+
380 } // namespace std
+
381 
+
382 namespace boost { namespace gil {
+
383 
+
384 namespace detail {
+
385 
+
387 struct std_fill_t {
+
388  template <typename It, typename P>
+
389  void operator()(It first, It last, const P& p_in) {
+
390  std::fill(first,last,p_in);
+
391  }
+
392 };
+
393 
+
395 template <typename It, typename P>
+
396 BOOST_FORCEINLINE
+
397 void fill_aux(It first, It last, P const& p, std::true_type)
+
398 {
+
399  static_for_each(first, last, p, std_fill_t());
+
400 }
+
401 
+
403 template <typename It, typename P>
+
404 BOOST_FORCEINLINE
+
405 void fill_aux(It first, It last, P const& p, std::false_type)
+
406 {
+
407  std::fill(first, last, p);
+
408 }
+
409 
+
410 } // namespace detail
+
411 
+
414 template <typename View, typename Value>
+
415 BOOST_FORCEINLINE
+
416 void fill_pixels(View const& view, Value const& value)
+
417 {
+
418  if (view.is_1d_traversable())
+
419  {
+
420  detail::fill_aux(
+
421  view.begin().x(), view.end().x(), 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)
+
423  else
+
424  {
+
425  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
+
426  detail::fill_aux(
+
427  view.row_begin(y), view.row_end(y), value, is_planar<View>());
+
428  }
+
429 }
+
430 
+
432 // destruct_pixels
+
434 
+
438 
+
439 namespace detail {
+
440 template <typename Iterator>
+
441 BOOST_FORCEINLINE
+
442 void destruct_range_impl(Iterator first, Iterator last,
+
443  typename std::enable_if
+
444  <
+
445  mp11::mp_and
+
446  <
+
447  std::is_pointer<Iterator>,
+
448  mp11::mp_not
+
449  <
+
450  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
+
451  >
+
452  >::value
+
453  >::type* /*ptr*/ = 0)
+
454 {
+
455  while (first != last)
+
456  {
+
457  first->~value_t();
+
458  ++first;
+
459  }
+
460 }
+
461 
+
462 template <typename Iterator>
+
463 BOOST_FORCEINLINE
+
464 void destruct_range_impl(Iterator /*first*/, Iterator /*last*/,
+
465  typename std::enable_if
+
466  <
+
467  mp11::mp_or
+
468  <
+
469  mp11::mp_not<std::is_pointer<Iterator>>,
+
470  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
+
471  >::value
+
472  >::type* /* ptr */ = nullptr)
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>());
+
474 }
+
475 
+
476 template <typename Iterator>
+
477 BOOST_FORCEINLINE
+
478 void destruct_range(Iterator first, Iterator last)
+
479 {
+
480  destruct_range_impl(first, last);
+
481 }
+
482 
+
483 struct std_destruct_t
+
484 {
+
485  template <typename Iterator>
+
486  void operator()(Iterator first, Iterator last) const
+
487  {
+
488  destruct_range(first,last);
+
489  }
+
490 };
+
491 
+
493 template <typename It>
+
494 BOOST_FORCEINLINE
+
495 void destruct_aux(It first, It last, std::true_type)
+
496 {
+
497  static_for_each(first,last,std_destruct_t());
+
498 }
+
499 
+
501 template <typename It>
+
502 BOOST_FORCEINLINE
+
503 void destruct_aux(It first, It last, std::false_type)
+
504 {
+
505  destruct_range(first,last);
+
506 }
+
507 
+
508 } // namespace detail
+
509 
+
512 template <typename View>
+
513 BOOST_FORCEINLINE
+
514 void destruct_pixels(View const& view)
+
515 {
+
516  if (view.is_1d_traversable())
+
517  {
+
518  detail::destruct_aux(
+
519  view.begin().x(), view.end().x(), 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;
+
521  else
+
522  {
+
523  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
+
524  detail::destruct_aux(
+
525  view.row_begin(y), view.row_end(y), is_planar<View>());
+
526  }
+
527 }
+
528 
+
530 // uninitialized_fill_pixels
+
532 
+
536 
+
537 namespace detail {
+
538 
+
541 template <typename It, typename P>
+
542 BOOST_FORCEINLINE
+
543 void uninitialized_fill_aux(It first, It last, P const& p, std::true_type)
+
544 {
+
545  std::size_t channel = 0;
+
546  try
+
547  {
+
548  using pixel_t = typename std::iterator_traits<It>::value_type;
+
549  while (channel < num_channels<pixel_t>::value)
+
550  {
+
551  std::uninitialized_fill(
+
552  dynamic_at_c(first,channel),
+
553  dynamic_at_c(last,channel),
+
554  dynamic_at_c(p,channel));
+
555 
+
556  ++channel;
+
557  }
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;
+
559  catch (...)
+
560  {
+
561  for (std::size_t c = 0; c < channel; ++c)
+
562  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
+
563  throw;
+
564  }
+
565 }
+
566 
+
569 template <typename It, typename P>
+
570 BOOST_FORCEINLINE
+
571 void uninitialized_fill_aux(It first, It last, P const& p, std::false_type)
+
572 {
+
573  std::uninitialized_fill(first,last,p);
+
574 }
+
575 
+
576 } // namespace detail
+
577 
+
582 template <typename View, typename Value>
+
583 void uninitialized_fill_pixels(const View& view, const Value& val) {
+
584  if (view.is_1d_traversable())
+
585  detail::uninitialized_fill_aux(view.begin().x(), view.end().x(),
+
586  val,is_planar<View>());
+
587  else {
+
588  typename View::y_coord_t y = 0;
+
589  try {
+
590  for (y=0; y<view.height(); ++y)
+
591  detail::uninitialized_fill_aux(view.row_begin(y),view.row_end(y),
+
592  val,is_planar<View>());
+
593  } catch(...) {
+
594  for (typename View::y_coord_t y0=0; y0<y; ++y0)
+
595  detail::destruct_aux(view.row_begin(y0),view.row_end(y0), is_planar<View>());
+
596  throw;
+
597  }
+
598  }
+
599 }
+
600 
+
602 // default_construct_pixels
+
604 
+
608 
+
609 namespace detail {
+
610 template <typename It> BOOST_FORCEINLINE
+
611 void default_construct_range_impl(It first, It last, std::true_type)
+
612 {
+
613  It first1 = first;
+
614  try
+
615  {
+
616  using value_t = typename std::iterator_traits<It>::value_type;
+
617  while (first != last)
+
618  {
+
619  new (first) value_t();
+
620  ++first;
+
621  }
+
622  }
+
623  catch (...)
+
624  {
+
625  destruct_range(first1, first);
+
626  throw;
+
627  }
+
628 }
+
629 
+
630 template <typename It>
+
631 BOOST_FORCEINLINE
+
632 void default_construct_range_impl(It, It, std::false_type) {}
+
633 
+
634 template <typename It>
+
635 BOOST_FORCEINLINE
+
636 void default_construct_range(It first, It last)
+
637 {
+
638  default_construct_range_impl(first, last, typename std::is_pointer<It>::type());
+
639 }
+
640 
+
642 template <typename It>
+
643 BOOST_FORCEINLINE
+
644 void default_construct_aux(It first, It last, std::true_type)
+
645 {
+
646  std::size_t channel = 0;
+
647  try
+
648  {
+
649  using pixel_t = typename std::iterator_traits<It>::value_type;
+
650  while (channel < num_channels<pixel_t>::value)
+
651  {
+
652  default_construct_range(dynamic_at_c(first, channel), dynamic_at_c(last, channel));
+
653  ++channel;
+
654  }
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(...)
+
656  catch (...)
+
657  {
+
658  for (std::size_t c = 0; c < channel; ++c)
+
659  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
+
660  throw;
+
661  }
+
662 }
+
663 
+
665 template <typename It>
+
666 BOOST_FORCEINLINE
+
667 void default_construct_aux(It first, It last, std::false_type)
+
668 {
+
669  default_construct_range(first, last);
+
670 }
+
671 
+
672 template <typename View, bool IsPlanar>
+
673 struct has_trivial_pixel_constructor
+
674  : detail::is_trivially_default_constructible<typename View::value_type>
+
675 {};
+
676 
+
677 template <typename View>
+
678 struct has_trivial_pixel_constructor<View, true>
+
679  : detail::is_trivially_default_constructible<typename channel_type<View>::type>
+
680 {};
+
681 
+
682 template<typename View, bool IsTriviallyConstructible>
+
683 BOOST_FORCEINLINE
+
684 void default_construct_pixels_impl(
+
685  View const& view,
+
686  std::enable_if<!IsTriviallyConstructible>* /*ptr*/ = nullptr)
+
687 {
+
688  if (view.is_1d_traversable())
+
689  {
+
690  detail::default_construct_aux(
+
691  view.begin().x(), view.end().x(), is_planar<View>());
+
692  }
+
693  else
+
694  {
+
695  typename View::y_coord_t y = 0;
+
696  try
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
+
698  for( y = 0; y < view.height(); ++y )
+
699  detail::default_construct_aux(
+
700  view.row_begin(y), view.row_end(y), is_planar<View>());
+
701  }
+
702  catch(...)
+
703  {
+
704  for (typename View::y_coord_t y0 = 0; y0 < y; ++y0 )
+
705  detail::destruct_aux(
+
706  view.row_begin(y0), view.row_end(y0), is_planar<View>());
+
707 
+
708  throw;
+
709  }
+
710  }
+
711 }
+
712 
+
713 } // namespace detail
+
714 
+
719 template <typename View>
+ +
721 {
+
722  detail::default_construct_pixels_impl
+
723  <
+
724  View,
+
725  detail::has_trivial_pixel_constructor
+
726  <
+
727  View,
+
728  is_planar<View>::value
+
729  >::value
+
730  >(view);
+
731 }
+
732 
+
734 // uninitialized_copy_pixels
+
736 
+
740 
+
741 namespace detail {
+
742 
+
743 enum class copy_planarity_condition
+
744 {
+
745  planar_to_planar,
+
746  interleaved_to_planar,
+
747  mixed_to_interleaved
+
748 };
+
749 
+
750 using planar_to_planar_type =
+
751  std::integral_constant
+
752  <
+
753  copy_planarity_condition, copy_planarity_condition::planar_to_planar
+
754  >;
+
755 using interleaved_to_planar_type =
+
756  std::integral_constant
+
757  <
+
758  copy_planarity_condition, copy_planarity_condition::interleaved_to_planar
+
759  >;
+
760 using mixed_to_interleaved_type =
+
761  std::integral_constant
+
762  <
+
763  copy_planarity_condition, copy_planarity_condition::mixed_to_interleaved
+
764  >;
+
765 
+
767 template <typename It1, typename It2>
+
768 BOOST_FORCEINLINE
+
769 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2, planar_to_planar_type)
+
770 {
+
771  std::size_t channel=0;
+
772  try {
+
773  using pixel_t = typename std::iterator_traits<It1>::value_type;
+
774  while (channel < num_channels<pixel_t>::value)
+
775  {
+
776  std::uninitialized_copy(
+
777  dynamic_at_c(first1, channel),
+
778  dynamic_at_c(last1, channel),
+
779  dynamic_at_c(first2, channel));
+
780  ++channel;
+
781  }
+
782  }
+
783  catch (...)
+
784  {
+
785  It2 last2 = first2;
+
786  std::advance(last2, std::distance(first1, last1));
+
787  for (std::size_t c = 0; c < channel; ++c)
+
788  destruct_range(dynamic_at_c(first2, c), dynamic_at_c(last2, c));
+
789  throw;
+
790  }
+
791 }
+
792 
+
794 template <typename It1, typename It2>
+
795 BOOST_FORCEINLINE
+
796 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2, mixed_to_interleaved_type)
+
797 {
+
798  std::uninitialized_copy(first1, last1, first2);
+
799 }
+
800 
+
802 template <typename It1, typename It2>
+
803 BOOST_FORCEINLINE
+
804 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2,
+
805 interleaved_to_planar_type)
+
806 {
+
807  default_construct_aux(first2, last2, std::true_type());
+
808 
+
809  typename It2::difference_type n = last2 - first2;
+
810  copier_n<It1,It2>()(first1, n, first2);
+
811 }
+
812 } // namespace detail
+
813 
+
818 template <typename View1, typename View2>
+
819 void uninitialized_copy_pixels(View1 const& view1, View2 const& view2)
+
820 {
+
821  using copy_planarity_condition = detail::copy_planarity_condition;
+
822  using copy_planarity_condition_type =
+
823  std::integral_constant
+
824  <
+
825  copy_planarity_condition,
+
826  !is_planar<View2>::value
+
827  ? copy_planarity_condition::mixed_to_interleaved
+
828  : (is_planar<View1>::value
+
829  ? copy_planarity_condition::planar_to_planar
+
830  : copy_planarity_condition::interleaved_to_planar)
+
831  >;
+
832  BOOST_ASSERT(view1.dimensions() == view2.dimensions());
+
833 
+
834  if (view1.is_1d_traversable() && view2.is_1d_traversable())
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;
+
836  detail::uninitialized_copy_aux(
+
837  view1.begin().x(), view1.end().x(), view2.begin().x(), view2.end().x(),
+
838  copy_planarity_condition_type());
+
839  }
+
840  else
+
841  {
+
842  typename View1::y_coord_t y = 0;
+
843  try
+
844  {
+
845  for (y = 0; y < view1.height(); ++y)
+
846  detail::uninitialized_copy_aux(
+
847  view1.row_begin(y), view1.row_end(y), view2.row_begin(y), view2.row_end(y),
+
848  copy_planarity_condition_type());
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;
+
850  catch(...)
+
851  {
+
852  for (typename View1::y_coord_t y0 = 0; y0 < y; ++y0)
+
853  detail::destruct_aux(view2.row_begin(y0), view2.row_end(y0), is_planar<View2>());
+
854  throw;
+
855  }
+
856  }
+
857 }
+
858 
+
860 // for_each_pixel
+
862 
+
871 
+
873 template <typename View, typename F>
+
874 F for_each_pixel(View const& view, F fun)
+
875 {
+
876  if (view.is_1d_traversable())
+
877  {
+
878  return std::for_each(view.begin().x(), view.end().x(), 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 {
+
880  else
+
881  {
+
882  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
+
883  std::for_each(view.row_begin(y), view.row_end(y), fun);
+
884  return fun;
+
885  }
+
886 }
+
887 
+
891 
+
893 template <typename View, typename F>
+
894 F for_each_pixel_position(View const& view, F fun)
+
895 {
+
896  typename View::xy_locator loc = view.xy_at(0, 0);
+
897  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
+
898  {
+
899  for (std::ptrdiff_t x = 0; x < view.width(); ++x, ++loc.x())
+
900  fun(loc);
+
901  loc.x() -= view.width(); ++loc.y();
+
902  }
+
903  return fun;
+
904 }
+
905 
+
907 // generate_pixels
+
909 
+
913 
+
916 template <typename View, typename F>
+
917 void generate_pixels(View const& view, F fun)
+
918 {
+
919  if (view.is_1d_traversable())
+
920  {
+
921  std::generate(view.begin().x(), view.end().x(), fun);
+
922  }
+
923  else
+
924  {
+
925  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
+
926  std::generate(view.row_begin(y), view.row_end(y), fun);
+
927  }
+
928 }
+
929 
+
931 // std::equal and gil::equal_pixels for GIL constructs
+
933 
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
+
939 BOOST_FORCEINLINE
+
940 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2);
+
941 
+
942 namespace detail {
+
943 
+
944 template <typename I1, typename I2>
+
945 struct equal_n_fn
+
946 {
+
947  BOOST_FORCEINLINE
+
948  bool operator()(I1 i1, std::ptrdiff_t n, I2 i2) const
+
949  {
+
950  return std::equal(i1, i1 + n, i2);
+
951  }
+
952 };
+
953 
+
956 template<typename T, typename CS>
+
957 struct equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
+
958 {
+
959  BOOST_FORCEINLINE
+
960  bool operator()(pixel<T, CS> const* i1, std::ptrdiff_t n, pixel<T, CS> const* i2) const
+
961  {
+
962  return memcmp(i1, i2, n * sizeof(pixel<T, CS>)) == 0;
+
963  }
+
964 };
+
965 
+
966 template<typename T, typename CS>
+
967 struct equal_n_fn<pixel<T, CS>*, pixel<T, CS>*>
+
968  : equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
+
969 {};
+
970 
+
974 template<typename IC, typename CS>
+
975 struct equal_n_fn<planar_pixel_iterator<IC, CS>, planar_pixel_iterator<IC, CS>>
+
976 {
+
977  BOOST_FORCEINLINE
+
978  bool operator()(planar_pixel_iterator<IC, CS> const i1, std::ptrdiff_t n, planar_pixel_iterator<IC, CS> const i2) const
+
979  {
+
980  // FIXME: ptrdiff_t vs size_t
+
981  constexpr std::ptrdiff_t byte_size = n * sizeof(typename std::iterator_traits<IC>::value_type);
+
982  for (std::ptrdiff_t i = 0; i < mp11::mp_size<CS>::value; ++i)
+
983  {
+
984  if (memcmp(dynamic_at_c(i1, i), dynamic_at_c(i2, i), byte_size) != 0)
+
985  return false;
+
986  }
+
987  return true;
+
988  }
+
989 };
+
990 
+
994 template <typename Loc, typename It>
+
995 struct equal_n_fn<boost::gil::iterator_from_2d<Loc>, It>
+
996 {
+
997  BOOST_FORCEINLINE
+
998  bool operator()(boost::gil::iterator_from_2d<Loc> i1, std::ptrdiff_t n, It i2) const
+
999  {
+
1000  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
+
1001  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
+
1002  while (n > 0)
+
1003  {
+
1004  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i1.width() - i1.x_pos());
+
1005  if (!equal_n(i1.x(), num, i2))
+
1006  return false;
+
1007  i1 += num;
+
1008  i2 += num;
+
1009  n -= num;
+
1010  }
+
1011  return true;
+
1012  }
+
1013 };
+
1014 
+
1018 template <typename It, typename Loc>
+
1019 struct equal_n_fn<It, boost::gil::iterator_from_2d<Loc>>
+
1020 {
+
1021  BOOST_FORCEINLINE
+
1022  bool operator()(It i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc> i2) const
+
1023  {
+
1024  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
+
1025  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
+
1026  while (n > 0)
+
1027  {
+
1028  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i2.width() - i2.x_pos());
+
1029  if (!equal_n(i1, num, i2.x()))
+
1030  return false;
+
1031  i1 += num;
+
1032  i2 += num;
+
1033  n -= num;
+
1034  }
+
1035  return true;
+
1036  }
+
1037 };
+
1038 
+
1040 template <typename Loc1, typename Loc2>
+
1041 struct equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>> {
+
1042  BOOST_FORCEINLINE bool operator()(boost::gil::iterator_from_2d<Loc1> i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc2> i2) const {
+
1043  gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
+
1044  gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
+
1045  if (i1.x_pos()!=i2.x_pos() || i1.width()!=i2.width()) {
+
1046  while(n-->0) {
+
1047  if (*i1++!=*i2++) return false;
+
1048  }
+
1049  }
+
1050  while (n>0) {
+
1051  std::ptrdiff_t num=std::min<const std::ptrdiff_t>(n,i2.width()-i2.x_pos());
+
1052  if (!equal_n(i1.x(), num, i2.x()))
+
1053  return false;
+
1054  i1+=num;
+
1055  i2+=num;
+
1056  n-=num;
+
1057  }
+
1058  return true;
+
1059  }
+
1060 };
+
1061 } // namespace detail
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 
+
1063 template <typename I1, typename I2> BOOST_FORCEINLINE
+
1064 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2) {
+
1065  return detail::equal_n_fn<I1,I2>()(i1,n,i2);
+
1066 }
+
1067 } } // namespace boost::gil
+
1068 
+
1069 namespace std {
+
1081 template <typename Loc1, typename Loc2> BOOST_FORCEINLINE
+ +
1083  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
+
1084  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
+
1085  std::ptrdiff_t n=last-first;
+
1086  if (first.is_1d_traversable()) {
+
1087  if (first2.is_1d_traversable())
+
1088  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,typename Loc2::x_iterator>()(first.x(),n, first2.x());
+
1089  else
+
1090  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,boost::gil::iterator_from_2d<Loc2>>()(first.x(),n, first2);
+
1091  } else {
+
1092  if (first2.is_1d_traversable())
+
1093  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,typename Loc2::x_iterator>()(first,n, first2.x());
+
1094  else
+
1095  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>>()(first,n,first2);
+
1096  }
+
1097 }
+
1098 } // namespace std
+
1099 
+
1100 namespace boost { namespace gil {
+
1103 template <typename View1, typename View2> BOOST_FORCEINLINE
+
1104 bool equal_pixels(const View1& v1, const View2& v2) {
+
1105  BOOST_ASSERT(v1.dimensions() == v2.dimensions());
+
1106  return std::equal(v1.begin(),v1.end(),v2.begin()); // std::equal has overloads with GIL iterators for optimal performance
+
1107 }
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
+
1114 
+
1118 
+
1121 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
+
1122 F transform_pixels(const View1& src,const View2& dst, F fun) {
+
1123  BOOST_ASSERT(src.dimensions() == dst.dimensions());
+
1124  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
+
1125  typename View1::x_iterator srcIt=src.row_begin(y);
+
1126  typename View2::x_iterator dstIt=dst.row_begin(y);
+
1127  for (std::ptrdiff_t x=0; x<src.width(); ++x)
+
1128  dstIt[x]=fun(srcIt[x]);
+
1129  }
+
1130  return fun;
+
1131 }
+
1132 
+
1135 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
+
1136 F transform_pixels(const View1& src1, const View2& src2,const View3& dst, F fun) {
+
1137  for (std::ptrdiff_t y=0; y<dst.height(); ++y) {
+
1138  typename View1::x_iterator srcIt1=src1.row_begin(y);
+
1139  typename View2::x_iterator srcIt2=src2.row_begin(y);
+
1140  typename View3::x_iterator dstIt=dst.row_begin(y);
+
1141  for (std::ptrdiff_t x=0; x<dst.width(); ++x)
+
1142  dstIt[x]=fun(srcIt1[x],srcIt2[x]);
+
1143  }
+
1144  return fun;
+
1145 }
+
1146 
+
1150 
+
1153 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
+
1154 F transform_pixel_positions(const View1& src,const View2& dst, F fun) {
+
1155  BOOST_ASSERT(src.dimensions() == dst.dimensions());
+
1156  typename View1::xy_locator loc=src.xy_at(0,0);
+
1157  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
+
1158  typename View2::x_iterator dstIt=dst.row_begin(y);
+
1159  for (std::ptrdiff_t x=0; x<src.width(); ++x, ++loc.x())
+
1160  dstIt[x]=fun(loc);
+
1161  loc.x()-=src.width(); ++loc.y();
+
1162  }
+
1163  return fun;
+
1164 }
+
1165 
+
1168 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
+
1169 F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst, F fun) {
+
1170  BOOST_ASSERT(src1.dimensions() == dst.dimensions());
+
1171  BOOST_ASSERT(src2.dimensions() == dst.dimensions());
+
1172  typename View1::xy_locator loc1=src1.xy_at(0,0);
+
1173  typename View2::xy_locator loc2=src2.xy_at(0,0);
+
1174  for (std::ptrdiff_t y=0; y<src1.height(); ++y) {
+
1175  typename View3::x_iterator dstIt=dst.row_begin(y);
+
1176  for (std::ptrdiff_t x=0; x<src1.width(); ++x, ++loc1.x(), ++loc2.x())
+
1177  dstIt[x]=fun(loc1,loc2);
+
1178  loc1.x()-=src1.width(); ++loc1.y();
+
1179  loc2.x()-=src2.width(); ++loc2.y();
+
1180  }
+
1181  return fun;
+
1182 }
+
1183 
+
1184 
+
1185 // Code below this line is moved here from <boost/gil/extension/numeric/algorithm.hpp>
+
1186 
+
1191 template <typename T>
+
1192 struct pixel_proxy : std::remove_reference<typename T::reference> {};
+
1193 
+
1195 template <typename Iterator1, typename Iterator2, typename BinaryFunction>
+
1196 BinaryFunction for_each(Iterator1 first1, Iterator1 last1, Iterator2 first2, BinaryFunction f)
+
1197 {
+
1198  while (first1 != last1)
+
1199  f(*first1++, *first2++);
+
1200  return f;
+
1201 }
+
1202 
+
1203 template <typename SrcIterator, typename DstIterator>
+
1204 inline
+
1205 auto assign_pixels(SrcIterator src, SrcIterator src_end, DstIterator dst) -> DstIterator
+
1206 {
+
1207  for_each(src, src_end, dst,
+
1208  pixel_assigns_t
+
1209  <
+
1210  typename pixel_proxy<typename std::iterator_traits<SrcIterator>::value_type>::type,
+
1211  typename pixel_proxy<typename std::iterator_traits<DstIterator>::value_type>::type
+
1212  >());
+
1213  return dst + (src_end - src);
+
1214 }
+
1215 
+
1216 namespace detail {
+
1217 
+
1218 template <std::size_t Size>
+
1219 struct inner_product_k_t
+
1220 {
+
1221  template
+
1222  <
+
1223  class InputIterator1,
+
1224  class InputIterator2,
+
1225  class T,
+
1226  class BinaryOperation1,
+
1227  class BinaryOperation2
+
1228  >
+
1229  static T apply(
+
1230  InputIterator1 first1,
+
1231  InputIterator2 first2, T init,
+
1232  BinaryOperation1 binary_op1,
+
1233  BinaryOperation2 binary_op2)
+
1234  {
+
1235  init = binary_op1(init, binary_op2(*first1, *first2));
+
1236  return inner_product_k_t<Size - 1>::template apply(
+
1237  first1 + 1, first2 + 1, init, binary_op1, binary_op2);
+
1238  }
+
1239 };
+
1240 
+
1241 template <>
+
1242 struct inner_product_k_t<0>
+
1243 {
+
1244  template
+
1245  <
+
1246  class InputIterator1,
+
1247  class InputIterator2,
+
1248  class T,
+
1249  class BinaryOperation1,
+
1250  class BinaryOperation2
+
1251  >
+
1252  static T apply(
+
1253  InputIterator1 first1,
+
1254  InputIterator2 first2,
+
1255  T init,
+
1256  BinaryOperation1 binary_op1,
+
1257  BinaryOperation2 binary_op2)
+
1258  {
+
1259  return init;
+
1260  }
+
1261 };
+
1262 
+
1263 } // namespace detail
+
1264 
+
1266 template
+
1267 <
+
1268  std::size_t Size,
+
1269  class InputIterator1,
+
1270  class InputIterator2,
+
1271  class T,
+
1272  class BinaryOperation1,
+
1273  class BinaryOperation2
+
1274 >
+
1275 BOOST_FORCEINLINE
+
1276 T inner_product_k(
+
1277  InputIterator1 first1,
+
1278  InputIterator2 first2,
+
1279  T init,
+
1280  BinaryOperation1 binary_op1,
+
1281  BinaryOperation2 binary_op2)
+
1282 {
+
1283  return detail::inner_product_k_t<Size>::template apply(
+
1284  first1, first2, init, binary_op1, binary_op2);
+
1285 }
+
1286 
+
1288 template
+
1289 <
+
1290  typename PixelAccum,
+
1291  typename SrcIterator,
+
1292  typename KernelIterator,
+
1293  typename Size,
+
1294  typename DstIterator
+
1295 >
+
1296 inline
+
1297 auto correlate_pixels_n(
+
1298  SrcIterator src_begin,
+
1299  SrcIterator src_end,
+
1300  KernelIterator kernel_begin,
+
1301  Size kernel_size,
+
1302  DstIterator dst_begin)
+
1303  -> DstIterator
+
1304 {
+
1305  using src_pixel_ref_t = typename pixel_proxy
+
1306  <
+
1307  typename std::iterator_traits<SrcIterator>::value_type
+
1308  >::type;
+
1309  using dst_pixel_ref_t = typename pixel_proxy
+
1310  <
+
1311  typename std::iterator_traits<DstIterator>::value_type
+
1312  >::type;
+
1313  using kernel_value_t = typename std::iterator_traits<KernelIterator>::value_type;
+
1314 
+
1315  PixelAccum accum_zero;
+
1316  pixel_zeros_t<PixelAccum>()(accum_zero);
+
1317  while (src_begin != src_end)
+
1318  {
+
1319  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
+
1320  std::inner_product(
+
1321  src_begin,
+
1322  src_begin + kernel_size,
+
1323  kernel_begin,
+
1324  accum_zero,
+
1325  pixel_plus_t<PixelAccum, PixelAccum, PixelAccum>(),
+
1326  pixel_multiplies_scalar_t<src_pixel_ref_t, kernel_value_t, PixelAccum>()),
+
1327  *dst_begin);
+
1328 
+
1329  ++src_begin;
+
1330  ++dst_begin;
+
1331  }
+
1332  return dst_begin;
+
1333 }
+
1334 
+
1336 template
+
1337 <
+
1338  std::size_t Size,
+
1339  typename PixelAccum,
+
1340  typename SrcIterator,
+
1341  typename KernelIterator,
+
1342  typename DstIterator
+
1343 >
+
1344 inline
+
1345 auto correlate_pixels_k(
+
1346  SrcIterator src_begin,
+
1347  SrcIterator src_end,
+
1348  KernelIterator kernel_begin,
+
1349  DstIterator dst_begin)
+
1350  -> DstIterator
+
1351 {
+
1352  using src_pixel_ref_t = typename pixel_proxy
+
1353  <
+
1354  typename std::iterator_traits<SrcIterator>::value_type
+
1355  >::type;
+
1356  using dst_pixel_ref_t = typename pixel_proxy
+
1357  <
+
1358  typename std::iterator_traits<DstIterator>::value_type
+
1359  >::type;
+
1360  using kernel_type = typename std::iterator_traits<KernelIterator>::value_type;
+
1361 
+
1362  PixelAccum accum_zero;
+
1363  pixel_zeros_t<PixelAccum>()(accum_zero);
+
1364  while (src_begin != src_end)
+
1365  {
+
1366  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
+
1367  inner_product_k<Size>(
+
1368  src_begin,
+
1369  kernel_begin,
+
1370  accum_zero,
+
1371  pixel_plus_t<PixelAccum, PixelAccum, PixelAccum>(),
+
1372  pixel_multiplies_scalar_t<src_pixel_ref_t, kernel_type, PixelAccum>()),
+
1373  *dst_begin);
+
1374 
+
1375  ++src_begin;
+
1376  ++dst_begin;
+
1377  }
+
1378  return dst_begin;
+
1379 }
+
1380 
+
1385 template <typename PixelAccum, typename SrcView, typename Scalar, typename DstView>
+
1386 inline
+
1387 void view_multiplies_scalar(SrcView const& src_view, Scalar const& scalar, DstView const& dst_view)
+
1388 {
+
1389  static_assert(std::is_scalar<Scalar>::value, "Scalar is not scalar");
+
1390  BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
+
1391  using src_pixel_ref_t = typename pixel_proxy<typename SrcView::value_type>::type;
+
1392  using dst_pixel_ref_t = typename pixel_proxy<typename DstView::value_type>::type;
+
1393  using y_coord_t = typename SrcView::y_coord_t;
+
1394 
+
1395  y_coord_t const height = src_view.height();
+
1396  for (y_coord_t y = 0; y < height; ++y)
+
1397  {
+
1398  typename SrcView::x_iterator it_src = src_view.row_begin(y);
+
1399  typename DstView::x_iterator it_dst = dst_view.row_begin(y);
+
1400  typename SrcView::x_iterator it_src_end = src_view.row_end(y);
+
1401  while (it_src != it_src_end)
+
1402  {
+
1403  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
+
1404  pixel_multiplies_scalar_t<src_pixel_ref_t, Scalar, PixelAccum>()(*it_src, scalar),
+
1405  *it_dst);
+
1406 
+
1407  ++it_src;
+
1408  ++it_dst;
+
1409  }
+
1410  }
+
1411 }
+
1412 
+
1413 
+
1416 enum class boundary_option
+
1417 {
+
1418  output_ignore,
+
1419  output_zero,
+
1420  extend_padded,
+
1421  extend_zero,
+
1422  extend_constant
+
1423 };
+
1424 
+
1425 namespace detail
+
1426 {
+
1427 
+
1428 template <typename SrcView, typename RltView>
+
1429 void extend_row_impl(
+
1430  SrcView const& src_view,
+
1431  RltView result_view,
+
1432  std::size_t extend_count,
+
1433  boundary_option option)
+
1434 {
+
1435  std::ptrdiff_t extend_count_ = static_cast<std::ptrdiff_t>(extend_count);
+
1436 
+
1437  if (option == boundary_option::extend_constant)
+
1438  {
+
1439  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
+
1440  {
+
1441  if(i >= extend_count_ && i < extend_count_ + src_view.height())
+
1442  {
+
1443  assign_pixels(
+
1444  src_view.row_begin(i - extend_count_),
+
1445  src_view.row_end(i - extend_count_),
+
1446  result_view.row_begin(i)
+
1447  );
+
1448  }
+
1449  else if(i < extend_count_)
+
1450  {
+
1451  assign_pixels(src_view.row_begin(0), src_view.row_end(0), result_view.row_begin(i));
+
1452  }
+
1453  else
+
1454  {
+
1455  assign_pixels(
+
1456  src_view.row_begin(src_view.height() - 1),
+
1457  src_view.row_end(src_view.height() - 1),
+
1458  result_view.row_begin(i)
+
1459  );
+
1460  }
+
1461 
+
1462  }
+
1463  }
+
1464  else if (option == boundary_option::extend_zero)
+
1465  {
+
1466  typename SrcView::value_type acc_zero;
+
1467  pixel_zeros_t<typename SrcView::value_type>()(acc_zero);
+
1468 
+
1469  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
+
1470  {
+
1471  if (i >= extend_count_ && i < extend_count_ + src_view.height())
+
1472  {
+
1473  assign_pixels(
+
1474  src_view.row_begin(i - extend_count_),
+
1475  src_view.row_end(i - extend_count_),
+
1476  result_view.row_begin(i)
+
1477  );
+
1478  }
+
1479  else
+
1480  {
+
1481  std::fill_n(result_view.row_begin(i), result_view.width(), acc_zero);
+
1482  }
+
1483  }
+
1484  }
+
1485  else if (option == boundary_option::extend_padded)
+
1486  {
+
1487  auto original_view = subimage_view(
+
1488  src_view,
+
1489  0,
+
1490  -extend_count,
+
1491  src_view.width(),
+
1492  src_view.height() + (2 * extend_count)
+
1493  );
+
1494  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
+
1495  {
+
1496  assign_pixels(
+
1497  original_view.row_begin(i),
+
1498  original_view.row_end(i),
+
1499  result_view.row_begin(i)
+
1500  );
+
1501  }
+
1502  }
+
1503  else
+
1504  {
+
1505  BOOST_ASSERT_MSG(false, "Invalid boundary option");
+
1506  }
+
1507 }
+
1508 
+
1509 } //namespace detail
+
1510 
+
1511 
+
1518 template <typename SrcView>
+
1519 auto extend_row(
+
1520  SrcView const& src_view,
+
1521  std::size_t extend_count,
+
1522  boundary_option option
+
1523 ) -> typename gil::image<typename SrcView::value_type>
+
1524 {
+
1525  typename gil::image<typename SrcView::value_type>
+
1526  result_img(src_view.width(), src_view.height() + (2 * extend_count));
+
1527 
+
1528  auto result_view = view(result_img);
+
1529  detail::extend_row_impl(src_view, result_view, extend_count, option);
+
1530  return result_img;
+
1531 }
+
1532 
+
1533 
+
1540 template <typename SrcView>
+
1541 auto extend_col(
+
1542  SrcView const& src_view,
+
1543  std::size_t extend_count,
+
1544  boundary_option option
+
1545 ) -> typename gil::image<typename SrcView::value_type>
+
1546 {
+
1547  auto src_view_rotate = rotated90cw_view(src_view);
+
1548 
+
1549  typename gil::image<typename SrcView::value_type>
+
1550  result_img(src_view.width() + (2 * extend_count), src_view.height());
+
1551 
+
1552  auto result_view = rotated90cw_view(view(result_img));
+
1553  detail::extend_row_impl(src_view_rotate, result_view, extend_count, option);
+
1554  return result_img;
+
1555 }
+
1556 
+
1563 template <typename SrcView>
+
1564 auto extend_boundary(
+
1565  SrcView const& src_view,
+
1566  std::size_t extend_count,
+
1567  boundary_option option
+
1568 ) -> typename gil::image<typename SrcView::value_type>
+
1569 {
+
1570  if (option == boundary_option::extend_padded)
+
1571  {
+
1572  typename gil::image<typename SrcView::value_type>
+
1573  result_img(src_view.width()+(2 * extend_count), src_view.height()+(2 * extend_count));
+
1574  typename gil::image<typename SrcView::value_type>::view_t result_view = view(result_img);
+
1575 
+
1576  auto original_view = subimage_view(
+
1577  src_view,
+
1578  -extend_count,
+
1579  -extend_count,
+
1580  src_view.width() + (2 * extend_count),
+
1581  src_view.height() + (2 * extend_count)
+
1582  );
+
1583 
+
1584  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
+
1585  {
+
1586  assign_pixels(
+
1587  original_view.row_begin(i),
+
1588  original_view.row_end(i),
+
1589  result_view.row_begin(i)
+
1590  );
+
1591  }
+
1592 
+
1593  return result_img;
+
1594  }
+
1595 
+
1596  auto auxilary_img = extend_col(src_view, extend_count, option);
+
1597  return extend_row(view(auxilary_img), extend_count, option);
+
1598 }
+
1599 
+
1600 } } // namespace boost::gil
+
1601 
+
1602 #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
+
MEMORY-BASED STEP ITERATOR.
Definition: algorithm.hpp:42
+
Definition: algorithm.hpp:189
+
BOOST_FORCEINLINE void copy_and_convert_pixels(const View1 &src, const View2 &dst)
Definition: algorithm.hpp:341
+
BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
std::fill for image views
Definition: algorithm.hpp:416
+
Reference proxy associated with a type that has a "reference" member type alias.
Definition: algorithm.hpp:1192
+
BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
std::equal for image views
Definition: algorithm.hpp:1104
+
Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
Definition: metafunctions.hpp:24
+
A generic binary operation on views.
Definition: algorithm.hpp:87
+
void generate_pixels(View const &view, F fun)
std::generate for image views
Definition: algorithm.hpp:917
+
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:819
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
+
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:365
+
BOOST_FORCEINLINE F transform_pixels(const View1 &src1, const View2 &src2, const View3 &dst, F fun)
transform_pixels with two sources
Definition: algorithm.hpp:1136
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
+
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:1169
+
BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
std::copy for image views
Definition: algorithm.hpp:288
+
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:279
+
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:549
+
BOOST_FORCEINLINE void destruct_pixels(View const &view)
Invokes the in-place destructor on every pixel of the view.
Definition: algorithm.hpp:514
+
F for_each_pixel_position(View const &view, F fun)
Definition: algorithm.hpp:894
+
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:583
+
void default_construct_pixels(View const &view)
Invokes the in-place default constructor on every pixel of the (uninitialized) view....
Definition: algorithm.hpp:720
+
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:177
+
dynamic_xy_step_transposed_type< View >::type rotated90cw_view(const View &src)
Definition: image_view_factory.hpp:221
+
struct to do std::fill
Definition: algorithm.hpp:387
+
F for_each_pixel(View const &view, F fun)
Definition: algorithm.hpp:874
+
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:1082
+
Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
Definition: algorithm.hpp:44
+
An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
Definition: algorithm.hpp:40
+
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/annotated.html b/develop/doc/html/reference/annotated.html index 1a1722230..95ebeb1ec 100644 --- a/develop/doc/html/reference/annotated.html +++ b/develop/doc/html/reference/annotated.html @@ -54,44 +54,49 @@ $(function() {  Ccopier_n< I, iterator_from_2d< OL > >Destination range is delimited by image iterators  Ccopier_n< iterator_from_2d< IL >, iterator_from_2d< OL > >Both source and destination ranges are delimited by image iterators  Ccopier_n< iterator_from_2d< IL >, O >Source range is delimited by image iterators - CdecOperator– wrapped in a function object - 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 > > - Cfile_stream_device - Cread_tagUsed to overload the constructor - 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 + Ccorrelator_kProvides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is a template parameter and must be compulsorily specified while using + Ccorrelator_nProvides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is to be provided through constructor for all instances + CdecOperator– wrapped in a function object + 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 > > + Cfile_stream_device + Cread_tagUsed to overload the constructor + 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 + Ckernel_1d_adaptorKernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),operator[], value_type,iterator,const_iterator,reference,const_reference + Ckernel_2dVariable-size kernel + Ckernel_2d_fixedStatic-size kernel + 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 @@ -111,220 +116,243 @@ $(function() {  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 + Cchannel_assigns_t + 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_divides_scalar_tArithmetic operation of dividing channel value by scalar + Cchannel_divides_tArithmetic operation of division of two channel values + Cchannel_halves_tArithmetic operation of dividing channel value by 2 + Cchannel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept + Cchannel_minus_scalar_tArithmetic operation of subtracting scalar from channel value + Cchannel_minus_tArithmetic operation of subtraction of two channel values + 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_multiplies_scalar_tArithmetic operation of channel value by a scalar + Cchannel_multiplies_tArithmetic operation of multiplication of two channel values + Cchannel_plus_scalar_tArithmetic operation of adding scalar to channel value + Cchannel_plus_tArithmetic operation of addition of two channel values + Cchannel_type + Cchannel_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept + Cchannel_zeros_tOperation of setting channel value to zero + 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 + Ckernel_1dVariable-size kernel + Ckernel_1d_fixedStatic-size kernel + 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_assigns_tCasts and assigns a pixel to another + Cpixel_divide_tPerforms channel-wise division of two pixels + Cpixel_divides_scalar_tPerforms channel-wise division of pixel elements by scalar + Cpixel_halves_tPerforms channel-wise division by 2 + Cpixel_is_referenceGiven a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value) + Cpixel_minus_tPerforms channel-wise subtraction of two pixels + Cpixel_multiplies_scalar_tPerforms channel-wise multiplication of pixel elements by scalar + Cpixel_multiply_tPerforms channel-wise multiplication of two pixels + Cpixel_plus_tPerforms channel-wise addition of two pixels + Cpixel_proxyReference proxy associated with a type that has a "reference" member type alias + 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 + Cpixel_zeros_tSets pixel elements to zero (for whatever zero means) + 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 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 e2d02b51a..a7b73d049 100644 --- a/develop/doc/html/reference/any__image__view_8hpp_source.html +++ b/develop/doc/html/reference/any__image__view_8hpp_source.html @@ -217,7 +217,7 @@ $(function() {
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
+
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:549
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
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 c94718369..2c01f5e86 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 @@ -220,10 +220,10 @@ $(function() {
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
+
BOOST_FORCEINLINE auto copy(boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
Copy when both src and dst are interleaved and of the same type can be just memmove.
Definition: algorithm.hpp:145
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
+
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:1082
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 8fcb6f819..7d8a7b0ce 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 @@ -393,11 +393,11 @@ $(function() {
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
+
Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
Definition: metafunctions.hpp:25
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 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:1082
BOOST_FORCEINLINE bool operator==(const point< T > &p1, const point< T > &p2)
Definition: point.hpp:129
diff --git a/develop/doc/html/reference/channel__numeric__operations_8hpp_source.html b/develop/doc/html/reference/channel__numeric__operations_8hpp_source.html new file mode 100644 index 000000000..d467dc22a --- /dev/null +++ b/develop/doc/html/reference/channel__numeric__operations_8hpp_source.html @@ -0,0 +1,283 @@ + + + + + + + + + Generic Image Library: channel_numeric_operations.hpp Source File + + + + + + + +
+ + + + + + +
+

Boost GIL

+

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

Boost GIL

+

+
+
+
+ + + + + + +
+
+
+
correlator_n< PixelAccum > Member List
+
+
+ +

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

+ + + +
correlator_n(std::size_t size) (defined in correlator_n< PixelAccum >)correlator_n< PixelAccum >inline
operator()(SrcIterator src_begin, SrcIterator src_end, KernelIterator kernel_begin, DstIterator dst_begin) (defined in correlator_n< PixelAccum >)correlator_n< PixelAccum >inline
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html new file mode 100644 index 000000000..235c14033 --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html @@ -0,0 +1,87 @@ + + + + + + + + + Generic Image Library: correlator_n< PixelAccum > Class Template Reference + + + + + + + +
+ + + + + + +
+

Boost GIL

+

+
+
+
+ + + + + + +
+
+ +
+
correlator_n< PixelAccum > Class Template Reference
+
+
+ +

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

+ +

#include <convolve.hpp>

+ + + + + + + +

+Public Member Functions

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

Detailed Description

+

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

+ +

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

+

The documentation for this class was generated from the following file: +
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html new file mode 100644 index 000000000..0e750280b --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html @@ -0,0 +1,72 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
+ + + + + + +
+

Boost GIL

+

+
+
+
+ + + + + + +
+
+
+
kernel_1d_adaptor< Core > Member List
+
+
+ +

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

+ + + + + + + + + + +
center() -> std::size_t & (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
center() const -> std::size_t const & (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
kernel_1d_adaptor()=default (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >
kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inlineexplicit
kernel_1d_adaptor(std::size_t size, std::size_t center) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
left_size() const (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
right_size() const (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html new file mode 100644 index 000000000..2f4d45a95 --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html @@ -0,0 +1,106 @@ + + + + + + + + + Generic Image Library: kernel_1d_adaptor< Core > Class Template Reference + + + + + + + +
+ + + + + + +
+

Boost GIL

+

+
+
+
+ + + + + + +
+
+ +
+
kernel_1d_adaptor< Core > Class Template Reference
+
+
+ +

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

+ +

#include <kernel.hpp>

+ +

Inherits Core.

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

+Public Member Functions

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

Detailed Description

+

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

+ +

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

+

The documentation for this class was generated from the following file: +
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html new file mode 100644 index 000000000..ff24de777 --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html @@ -0,0 +1,84 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
+ + + + + + +
+

Boost GIL

+

+
+
+
+ + + + + + +
+
+
+
kernel_2d< T, Allocator > Member List
+
+
+ +

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

+ + + + + + + + + + + + + + + + + + + + + + +
at(std::size_t x, std::size_t y) const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_x() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_x() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_y() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_y() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
kernel_2d()=default (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >
kernel_2d(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >inline
kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >inline
kernel_2d(kernel_2d const &other) (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >inline
kernel_2d_adaptor()=default (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >
kernel_2d_adaptor(std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inlineexplicit
kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
kernel_2d_adaptor(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
left_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
lower_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
operator=(kernel_2d const &other)=default (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >
operator=(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
right_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
square_size (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >protected
upper_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html new file mode 100644 index 000000000..ad9a989c8 --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html @@ -0,0 +1,95 @@ + + + + + + + + + Generic Image Library: kernel_2d< T, Allocator > Class Template Reference + + + + + + + +
+ + + + + + +
+

Boost GIL

+

+
+
+
+ + + + + + +
+
+ +
+
kernel_2d< T, Allocator > Class Template Reference
+
+
+ +

variable-size kernel + More...

+ +

#include <kernel.hpp>

+ +

Inherits kernel_2d_adaptor< Core >.

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

+Public Member Functions

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

Detailed Description

+

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

+ +

variable-size kernel

+

The documentation for this class was generated from the following file: +
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html new file mode 100644 index 000000000..bd0827085 --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html @@ -0,0 +1,85 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
+ + + + + + +
+

Boost GIL

+

+
+
+
+ + + + + + +
+
+
+
kernel_2d_fixed< T, Size > Member List
+
+
+ +

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

+ + + + + + + + + + + + + + + + + + + + + + + +
at(std::size_t x, std::size_t y) const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_x() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_x() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_y() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
center_y() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
kernel_2d_adaptor()=default (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >
kernel_2d_adaptor(std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inlineexplicit
kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
kernel_2d_adaptor(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
kernel_2d_fixed() (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inline
kernel_2d_fixed(std::size_t center_y, std::size_t center_x) (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inlineexplicit
kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inlineexplicit
kernel_2d_fixed(kernel_2d_fixed const &other) (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inline
left_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
lower_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
operator=(kernel_2d_fixed const &other)=default (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >
operator=(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
right_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
square_size (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >protected
static_size (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >static
upper_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html new file mode 100644 index 000000000..85697790a --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html @@ -0,0 +1,102 @@ + + + + + + + + + Generic Image Library: kernel_2d_fixed< T, Size > Class Template Reference + + + + + + + +
+ + + + + + +
+

Boost GIL

+

+
+
+
+ + + + + + +
+
+ +
+
kernel_2d_fixed< T, Size > Class Template Reference
+
+
+ +

static-size kernel + More...

+ +

#include <kernel.hpp>

+ +

Inherits kernel_2d_adaptor< Core >.

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

+Public Member Functions

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

+Static Public Attributes

+static constexpr std::size_t static_size = Size
 
+

Detailed Description

+

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

+ +

static-size kernel

+

The documentation for this class was generated from the following file: +
+ + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1image.html b/develop/doc/html/reference/classboost_1_1gil_1_1image.html index 5e14c1a61..f5e6a3e21 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1image.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1image.html @@ -176,7 +176,7 @@ view_t _view  

Detailed Description

-

template<typename Pixel, bool IsPlanar = false, typename Alloc = std::allocator<unsigned char>>
+

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

container interface over image view. Models ImageConcept, PixelBasedConcept

diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1image__view.html b/develop/doc/html/reference/classboost_1_1gil_1_1image__view.html index 2da53593a..34fbaaa62 100644 --- a/develop/doc/html/reference/classboost_1_1gil_1_1image__view.html +++ b/develop/doc/html/reference/classboost_1_1gil_1_1image__view.html @@ -410,7 +410,7 @@ 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
    +
    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:365
    diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d-members.html new file mode 100644 index 000000000..01d0f0b25 --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d-members.html @@ -0,0 +1,77 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    kernel_1d< T, Allocator > Member List
    +
    +
    + +

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

    + + + + + + + + + + + + + + + +
    center() -> std::size_t & (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
    center() const -> std::size_t const & (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
    kernel_1d()=default (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >
    kernel_1d(std::size_t size, std::size_t center) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
    kernel_1d(FwdIterator elements, std::size_t size, std::size_t center) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
    kernel_1d(kernel_1d const &other) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
    kernel_1d_adaptor()=default (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >
    kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inlineexplicit
    kernel_1d_adaptor(std::size_t size, std::size_t center) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
    kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
    left_size() const (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
    operator=(kernel_1d const &other)=default (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >
    operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
    right_size() const (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
    + + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d.html b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d.html new file mode 100644 index 000000000..aeadd8885 --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d.html @@ -0,0 +1,127 @@ + + + + + + + + + Generic Image Library: kernel_1d< T, Allocator > Class Template Reference + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    + +
    +
    kernel_1d< T, Allocator > Class Template Reference
    +
    +
    + +

    variable-size kernel + More...

    + +

    #include <kernel.hpp>

    +
    +Inheritance diagram for kernel_1d< T, Allocator >:
    +
    +
    + + +kernel_1d_adaptor< std::vector< T, std::allocator< T > > > + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Member Functions

    kernel_1d (std::size_t size, std::size_t center)
     
    +template<typename FwdIterator >
     kernel_1d (FwdIterator elements, std::size_t size, std::size_t center)
     
    kernel_1d (kernel_1d const &other)
     
    +kernel_1doperator= (kernel_1d const &other)=default
     
    - Public Member Functions inherited from kernel_1d_adaptor< std::vector< T, std::allocator< T > > >
    kernel_1d_adaptor (std::size_t center)
     
    kernel_1d_adaptor (std::size_t size, std::size_t center)
     
    kernel_1d_adaptor (kernel_1d_adaptor const &other)
     
    +kernel_1d_adaptoroperator= (kernel_1d_adaptor const &other)
     
    +std::size_t left_size () const
     
    +std::size_t right_size () const
     
    +auto center () -> std::size_t &
     
    +auto center () const -> std::size_t const &
     
    +

    Detailed Description

    +

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

    + +

    variable-size kernel

    +

    The documentation for this class was generated from the following file: +
    + + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d.png b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d.png new file mode 100644 index 0000000000000000000000000000000000000000..fb32b2fe1cddea64a68fd3d90d7de1097bd34b0f GIT binary patch literal 995 zcmeAS@N?(olHy`uVBq!ia0y~yU<_kmUv! z-TlSS{>oSShP=y|^RjUA-FXog6-)w{&&DV9TC2v~ zQXI2dW#;59Y@SvNYUa;t@7;B1^M&fx$5o%VC;pur5<7Xt>GzQkzqRd#Pxjm&t7{`mHn7jk%2UqhLZz|^EVDwbPyAtCyVUF95!|Ev2m;aA!^_paf z5+!154UfGzBC%MJVg4cU2Ihp$Y}O6WUZ38}B=I?89|SR;DO}6& zY)2SFag26@Z7>7OcV6Ygd>z15Wa*_9%_$#~E z_49td{ufi;e=YW&R)VrGN zn-AwEALr9<(qV1|Bk5L zlJnFXH{Y?kZgp<$cCWp@ueUwjEi?O))8cG{H7Z3*Oj*xwH|-Xg%XH_cY!u^~9}_O_ zYrppV=jT)Z{!B6bkhxm)0doOnn4Vi?+9EJVz{%hVfA=TX>SJEs#~2tG7(8A5T-G@y GGywoJR^~(i literal 0 HcmV?d00001 diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html new file mode 100644 index 000000000..14226b8bc --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html @@ -0,0 +1,78 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    kernel_1d_fixed< T, Size > Member List
    +
    +
    + +

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

    + + + + + + + + + + + + + + + + +
    center() -> std::size_t & (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
    center() const -> std::size_t const & (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
    kernel_1d_adaptor()=default (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >
    kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inlineexplicit
    kernel_1d_adaptor(std::size_t size, std::size_t center) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
    kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
    kernel_1d_fixed()=default (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >
    kernel_1d_fixed(std::size_t center) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inlineexplicit
    kernel_1d_fixed(FwdIterator elements, std::size_t center) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inlineexplicit
    kernel_1d_fixed(kernel_1d_fixed const &other) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inline
    left_size() const (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
    operator=(kernel_1d_fixed const &other)=default (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >
    operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
    right_size() const (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
    static_size (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >static
    + + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html new file mode 100644 index 000000000..a5389131c --- /dev/null +++ b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html @@ -0,0 +1,134 @@ + + + + + + + + + Generic Image Library: kernel_1d_fixed< T, Size > Class Template Reference + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    + +
    +
    kernel_1d_fixed< T, Size > Class Template Reference
    +
    +
    + +

    static-size kernel + More...

    + +

    #include <kernel.hpp>

    +
    +Inheritance diagram for kernel_1d_fixed< T, Size >:
    +
    +
    + + +kernel_1d_adaptor< std::array< T, Size > > + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Member Functions

    kernel_1d_fixed (std::size_t center)
     
    +template<typename FwdIterator >
     kernel_1d_fixed (FwdIterator elements, std::size_t center)
     
    kernel_1d_fixed (kernel_1d_fixed const &other)
     
    +kernel_1d_fixedoperator= (kernel_1d_fixed const &other)=default
     
    - Public Member Functions inherited from kernel_1d_adaptor< std::array< T, Size > >
    kernel_1d_adaptor (std::size_t center)
     
    kernel_1d_adaptor (std::size_t size, std::size_t center)
     
    kernel_1d_adaptor (kernel_1d_adaptor const &other)
     
    +kernel_1d_adaptoroperator= (kernel_1d_adaptor const &other)
     
    +std::size_t left_size () const
     
    +std::size_t right_size () const
     
    +auto center () -> std::size_t &
     
    +auto center () const -> std::size_t const &
     
    + + + +

    +Static Public Attributes

    +static constexpr std::size_t static_size = Size
     
    +

    Detailed Description

    +

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

    + +

    static-size kernel

    +

    The documentation for this class was generated from the following file: +
    + + + + + + diff --git a/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.png b/develop/doc/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.png new file mode 100644 index 0000000000000000000000000000000000000000..55f572d95b12a8cd6fe94ffb9f9e0eae05f205a8 GIT binary patch literal 837 zcmeAS@N?(olHy`uVBq!ia0y~yU}R=sUL$tBm#UwT>t<7&%nU&;?396 z{zDTO7#P6#z<~p-opR~YTm6|7ALhk| zy_NN6b3bLLJzdDB`|PI3|EH#J1pM*~dETBlljC}%Aw4o|>d6ub9orLIzAQJq$^2V4 zKCN+nUH-S@f5JEEoPEIbx_yOTyrg+S7N9$I;ja@_ld|2<^M38y zEt16+5>#Z6yzZTW#@=ZxG06{tjn9VZU(H|gBU|PRpZ)Lb?6k}8=CpPtEKewv*y3qC zh26Kk>YJ5rH2dFKHNHwb8nRck5{6^I(Ey?vpd`0w+7vN ze7k7#j_QMFek|nc(cV9`=iPm-Jy%~z$nFoxeGW+qY)J}iM-pZ&dwG+o;ruIB2L9<1555Yq7*;4(*svG| z_=eC0_Fcdg!H(ua7L6E^J>y7A?i7Oc&%s6K}gIUP@N7<*(op05GHlCe0 z|F_Qj_hC|&M-=)OvN9Z~oSQbGOe%bn#%w7zZ+@ev|GrErT&v>t>cOK2^~?>;R;Lw~ zr!M7XyBg{7Vb#Ps{oJG!cbku_--ew4J}o9DgxZ;`@8n^9lds9&opw zyVL%jmEni=-91NcOPqPSsxRm|2gB@L)?V=w*%=BJLj&XhC
      a  
    -equal_n_fn< pixel< T, CS > const *, pixel< T, CS > const * > (boost::gil::detail)    +element_type (boost::gil)    MutablePixelConcept (boost::gil)    -equal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > > (boost::gil::detail)    +equal_n_fn< boost::gil::iterator_from_2d< Loc >, It > (boost::gil::detail)    MutablePixelIteratorConcept (boost::gil)    alpha_t (boost::gil)    -EqualityComparable (boost::gil)    +equal_n_fn< boost::gil::iterator_from_2d< Loc1 >, boost::gil::iterator_from_2d< Loc2 > > (boost::gil::detail)    MutablePixelLocatorConcept (boost::gil)    any_image (boost::gil)    -
      f  
    - +equal_n_fn< It, boost::gil::iterator_from_2d< Loc > > (boost::gil::detail)    MutableRandomAccess2DImageViewConcept (boost::gil)    any_image_view (boost::gil)    +equal_n_fn< pixel< T, CS > const *, pixel< T, CS > const * > (boost::gil::detail)    MutableRandomAccess2DLocatorConcept (boost::gil)    Assignable (boost::gil)    -file_stream_device (boost::gil::detail)    +equal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > > (boost::gil::detail)    MutableRandomAccessNDImageViewConcept (boost::gil)   
      b  
    -filler (boost::gil::detail)    +EqualityComparable (boost::gil)    MutableRandomAccessNDLocatorConcept (boost::gil)    -filler< 1 > (boost::gil::detail)    +
      f  
    + MutableStepIteratorConcept (boost::gil)    binary_operation_obj (boost::gil)    -ForwardCollectionImageViewConcept (boost::gil)   
      n  
    bit_aligned_image1_type (boost::gil)    -
      g  
    - +file_stream_device (boost::gil::detail)    bit_aligned_image2_type (boost::gil)    +filler (boost::gil::detail)    nth_channel_deref_fn (boost::gil::detail)    bit_aligned_image3_type (boost::gil)    -get_dynamic_image_reader (boost::gil)    +filler< 1 > (boost::gil::detail)    nth_channel_view_type (boost::gil)    bit_aligned_image4_type (boost::gil)    -get_dynamic_image_writer (boost::gil)    +ForwardCollectionImageViewConcept (boost::gil)    nth_channel_view_type< any_image_view< Views... > > (boost::gil)    bit_aligned_image5_type (boost::gil)    -get_reader (boost::gil)    +
      g  
    + 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)    +get_dynamic_image_reader (boost::gil)    bit_range (boost::gil)    -get_writer (boost::gil)    +get_dynamic_image_writer (boost::gil)    ostream_device (boost::gil::detail)    black_t (boost::gil)    -gray_color_t (boost::gil)    +get_reader (boost::gil)   
      p  
    blue_t (boost::gil)    -green_t (boost::gil)    +get_reader_backend (boost::gil)    byte_to_memunit (boost::gil)    -
      h  
    - +get_scanline_reader (boost::gil)    packed_dynamic_channel_reference< BitField, NumBits, false > (boost::gil)   
      c  
    +get_writer (boost::gil)    packed_dynamic_channel_reference< BitField, NumBits, true > (boost::gil)    -HasDynamicXStepTypeConcept (boost::gil)    +gray_color_t (boost::gil)    packed_image1_type (boost::gil)    -channel_converter (boost::gil)    -HasDynamicYStepTypeConcept (boost::gil)    +channel_assigns_t (boost::gil)    +green_t (boost::gil)    packed_image2_type (boost::gil)    -channel_converter_unsigned< float32_t, DstChannelV > (boost::gil)    -hash_tuple (boost::gil::detail)    +channel_converter (boost::gil)    +
      h  
    + packed_image3_type (boost::gil)    -channel_converter_unsigned< float32_t, uint32_t > (boost::gil)    -HasTransposedTypeConcept (boost::gil)    +channel_converter_unsigned< float32_t, DstChannelV > (boost::gil)    packed_image4_type (boost::gil)    -channel_converter_unsigned< T, T > (boost::gil)    -histogram (boost::gil)    +channel_converter_unsigned< float32_t, uint32_t > (boost::gil)    +HasDynamicXStepTypeConcept (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)    +channel_converter_unsigned< T, T > (boost::gil)    +HasDynamicYStepTypeConcept (boost::gil)    packed_image_type (boost::gil)    -channel_converter_unsigned_impl (boost::gil::detail)    -homogeneous_color_base< Element, Layout, 2 > (boost::gil::detail)    +channel_converter_unsigned< uint32_t, float32_t > (boost::gil)    +hash_tuple (boost::gil::detail)    packed_pixel (boost::gil)    +channel_converter_unsigned_impl (boost::gil::detail)    +HasTransposedTypeConcept (boost::gil)    +packed_pixel_type (boost::gil)    + +channel_divides_scalar_t (boost::gil)    +histogram (boost::gil)    +pixel (boost::gil)    + +channel_divides_t (boost::gil)    +homogeneous_color_base< Element, Layout, 1 > (boost::gil::detail)    +pixel_2d_locator_base (boost::gil)    + +channel_halves_t (boost::gil)    +homogeneous_color_base< Element, Layout, 2 > (boost::gil::detail)    +pixel_assigns_t (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)    +pixel_divide_t (boost::gil)    + +channel_minus_scalar_t (boost::gil)    +homogeneous_color_base< Element, Layout, 4 > (boost::gil::detail)    +pixel_divides_scalar_t (boost::gil)    + +channel_minus_t (boost::gil)    +homogeneous_color_base< Element, Layout, 5 > (boost::gil::detail)    +pixel_halves_t (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)    +channel_multiplier_unsigned (boost::gil)    HomogeneousColorBaseValueConcept (boost::gil)    -pixel_reference_is_basic (boost::gil)    +pixel_minus_t (boost::gil)    + +channel_multiplier_unsigned< float32_t > (boost::gil)    +HomogeneousPixelBasedConcept (boost::gil)    +pixel_multiplies_scalar_t (boost::gil)    + +channel_multiplier_unsigned< uint16_t > (boost::gil)    +HomogeneousPixelConcept (boost::gil)    +pixel_multiply_t (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)    +pixel_plus_t (boost::gil)    -ChannelConcept (boost::gil)    +channel_multiplies_scalar_t (boost::gil)    hough_parameter (boost::gil)    -pixel_value_type (boost::gil)    +pixel_proxy (boost::gil)    -ChannelConvertibleConcept (boost::gil)    +channel_multiplies_t (boost::gil)   
      i  
    +pixel_reference_is_basic (boost::gil)    + +channel_plus_scalar_t (boost::gil)    +pixel_reference_is_mutable (boost::gil)    + +channel_plus_t (boost::gil)    +identity (boost::gil::detail)    +pixel_reference_is_proxy (boost::gil)    + +channel_type (boost::gil)    +image (boost::gil)    +pixel_reference_type (boost::gil)    + +channel_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)    +image_is_basic (boost::gil)    +pixel_value_type (boost::gil)    + +channel_zeros_t (boost::gil)    +image_type (boost::gil)    +pixel_zeros_t (boost::gil)    + +ChannelConcept (boost::gil)    +image_view (boost::gil)    PixelBasedConcept (boost::gil)    -ChannelIsMutableConcept (boost::gil::detail)    +ChannelConvertibleConcept (boost::gil)    +ImageConcept (boost::gil)    PixelConcept (boost::gil)    -ChannelMappingConcept (boost::gil)    -identity (boost::gil::detail)    +ChannelIsMutableConcept (boost::gil::detail)    +ImageViewConcept (boost::gil)    PixelConvertibleConcept (boost::gil)    -channels_are_compatible (boost::gil)    -image (boost::gil)    +ChannelMappingConcept (boost::gil)    +inc (boost::gil::detail)    PixelDereferenceAdaptorConcept (boost::gil)    -ChannelsCompatibleConcept (boost::gil)    -image_is_basic (boost::gil)    +channels_are_compatible (boost::gil)    +is_input_device (boost::gil::detail)    PixelImageViewIsMutableConcept (boost::gil::detail)    -ChannelValueConcept (boost::gil)    -image_type (boost::gil)    +ChannelsCompatibleConcept (boost::gil)    +is_iterator_adaptor (boost::gil)    PixelIteratorConcept (boost::gil)    -CollectionImageViewConcept (boost::gil)    -image_view (boost::gil)    +ChannelValueConcept (boost::gil)    +is_output_device (boost::gil::detail)    PixelIteratorIsMutableConcept (boost::gil::detail)    -color_convert_deref_fn (boost::gil)    -ImageConcept (boost::gil)    +CollectionImageViewConcept (boost::gil)    +is_pixel< bit_aligned_pixel_reference< B, C, L, M > > (boost::gil)    PixelLocatorConcept (boost::gil)    -color_converted_view_type (boost::gil)    -ImageViewConcept (boost::gil)    +color_convert_deref_fn (boost::gil)    +is_pixel< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)    pixels_are_compatible (boost::gil)    -color_converted_view_type< any_image_view< Views... >, DstP > (boost::gil)    -inc (boost::gil::detail)    +color_converted_view_type (boost::gil)    +is_planar< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)    PixelsCompatibleConcept (boost::gil)    -color_converted_view_type< any_image_view< Views... >, DstP, CC > (boost::gil)    -is_input_device (boost::gil::detail)    +color_converted_view_type< any_image_view< Views... >, DstP > (boost::gil)    +is_read_device (boost::gil::detail)    PixelValueConcept (boost::gil)    -color_element_const_reference_type (boost::gil)    -is_iterator_adaptor (boost::gil)    +color_converted_view_type< any_image_view< Views... >, DstP, CC > (boost::gil)    +is_read_only (boost::gil::detail)    planar_pixel_iterator (boost::gil)    -color_element_reference_type (boost::gil)    -is_output_device (boost::gil::detail)    +color_element_const_reference_type (boost::gil)    +is_read_supported (boost::gil)    planar_pixel_reference (boost::gil)    -color_element_type (boost::gil)    -is_pixel< bit_aligned_pixel_reference< B, C, L, M > > (boost::gil)    +color_element_reference_type (boost::gil)    +is_write_device (boost::gil::detail)    plus_asymmetric (boost::gil::detail)    -color_space_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)    -is_pixel< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)    +color_element_type (boost::gil)    +istream_device (boost::gil::detail)    point (boost::gil)    -ColorBaseConcept (boost::gil)    -is_planar< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)    +color_space_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)    +iterator_adaptor_get_base (boost::gil)    Point2DConcept (boost::gil)    -ColorBasesCompatibleConcept (boost::gil)    -is_read_device (boost::gil::detail)    +ColorBaseConcept (boost::gil)    +iterator_adaptor_rebind (boost::gil)    PointNDConcept (boost::gil)    -ColorBaseValueConcept (boost::gil)    -is_read_only (boost::gil::detail)    +ColorBasesCompatibleConcept (boost::gil)    +iterator_add_deref (boost::gil)    position_iterator (boost::gil)    -ColorSpaceConcept (boost::gil)    -is_read_supported (boost::gil)    +ColorBaseValueConcept (boost::gil)    +iterator_add_deref< dereference_iterator_adaptor< Iterator, PREV_DEREF >, Deref > (boost::gil)    promote_integral (boost::gil)    -ColorSpacesCompatibleConcept (boost::gil)    -is_write_device (boost::gil::detail)    +ColorSpaceConcept (boost::gil)    +iterator_from_2d (boost::gil)   
      r  
    -const_iterator_type (boost::gil)    -istream_device (boost::gil::detail)    +ColorSpacesCompatibleConcept (boost::gil)    +iterator_is_basic (boost::gil)    -contains_color (boost::gil)    -iterator_adaptor_get_base (boost::gil)    +const_iterator_type (boost::gil)    +iterator_is_basic< memory_based_step_iterator< pixel< T, L > * > > (boost::gil)    RandomAccess2DImageConcept (boost::gil)    -copier_n (boost::gil::detail)    -iterator_adaptor_rebind (boost::gil)    +contains_color (boost::gil)    +iterator_is_basic< memory_based_step_iterator< pixel< T, L > const * > > (boost::gil)    RandomAccess2DImageViewConcept (boost::gil)    -copier_n< I, iterator_from_2d< OL > > (boost::gil::detail)    -iterator_add_deref (boost::gil)    +copier_n (boost::gil::detail)    +iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T *, CS > > > (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)    +copier_n< I, iterator_from_2d< OL > > (boost::gil::detail)    +iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T const *, CS > > > (boost::gil)    RandomAccess2DLocatorConcept (boost::gil)    -copier_n< iterator_from_2d< IL >, O > (boost::gil::detail)    -iterator_from_2d (boost::gil)    +copier_n< iterator_from_2d< IL >, iterator_from_2d< OL > > (boost::gil::detail)    +iterator_is_basic< pixel< T, L > * > (boost::gil)    RandomAccessNDImageConcept (boost::gil)    -CopyConstructible (boost::gil)    -iterator_is_basic (boost::gil)    +copier_n< iterator_from_2d< IL >, O > (boost::gil::detail)    +iterator_is_basic< pixel< T, L > const * > (boost::gil)    RandomAccessNDImageViewConcept (boost::gil)    -cyan_t (boost::gil)    -iterator_is_basic< memory_based_step_iterator< pixel< T, L > * > > (boost::gil)    +CopyConstructible (boost::gil)    +iterator_is_basic< planar_pixel_iterator< T *, CS > > (boost::gil)    RandomAccessNDImageViewIsMutableConcept (boost::gil::detail)    +correlator_k (boost::gil::detail)    +iterator_is_basic< planar_pixel_iterator< T const *, CS > > (boost::gil)    +RandomAccessNDLocatorConcept (boost::gil)    + +correlator_n (boost::gil::detail)    +iterator_is_mutable (boost::gil)    +RandomAccessNDLocatorIsMutableConcept (boost::gil::detail)    + +cyan_t (boost::gil)    +iterator_is_step (boost::gil)    +file_stream_device::read_tag (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)    +iterator_type (boost::gil)    reader_base (boost::gil)    -default_color_converter (boost::gil)    -iterator_is_basic< pixel< T, L > const * > (boost::gil)    +iterator_type_from_pixel (boost::gil)    red_t (boost::gil)    -default_color_converter_impl (boost::gil)    -iterator_is_basic< planar_pixel_iterator< T *, CS > > (boost::gil)    +dec (boost::gil::detail)    +IteratorAdaptorConcept (boost::gil)    Regular (boost::gil)    -default_color_converter_impl< C, C > (boost::gil)    -iterator_is_basic< planar_pixel_iterator< T const *, CS > > (boost::gil)    +default_channel_converter (boost::gil)    +
      k  
    + ReversibleCollectionImageViewConcept (boost::gil)    -default_color_converter_impl< C1, rgba_t > (boost::gil)    -iterator_is_mutable (boost::gil)    +default_color_converter (boost::gil)    rgb_to_luminance_fn (boost::gil::detail)    -default_color_converter_impl< cmyk_t, gray_t > (boost::gil)    -iterator_is_step (boost::gil)    +default_color_converter_impl (boost::gil)    +kernel_1d (boost::gil)   
      s  
    -default_color_converter_impl< cmyk_t, rgb_t > (boost::gil)    -iterator_type (boost::gil)    +default_color_converter_impl< C, C > (boost::gil)    +kernel_1d_adaptor (boost::gil::detail)    -default_color_converter_impl< gray_t, cmyk_t > (boost::gil)    -iterator_type_from_pixel (boost::gil)    +default_color_converter_impl< C1, rgba_t > (boost::gil)    +kernel_1d_fixed (boost::gil)    SameType (boost::gil)    -default_color_converter_impl< gray_t, rgb_t > (boost::gil)    -IteratorAdaptorConcept (boost::gil)    +default_color_converter_impl< cmyk_t, gray_t > (boost::gil)    +kernel_2d (boost::gil::detail)    scanline_read_iterator (boost::gil)    -default_color_converter_impl< rgb_t, cmyk_t > (boost::gil)    -
      k  
    - +default_color_converter_impl< cmyk_t, rgb_t > (boost::gil)    +kernel_2d_fixed (boost::gil::detail)    size (boost::gil)    -default_color_converter_impl< rgb_t, gray_t > (boost::gil)    +default_color_converter_impl< gray_t, cmyk_t > (boost::gil)    +kth_channel_deref_fn (boost::gil::detail)    std_fill_t (boost::gil::detail)    -default_color_converter_impl< rgba_t, C2 > (boost::gil)    -kth_channel_deref_fn (boost::gil::detail)    +default_color_converter_impl< gray_t, rgb_t > (boost::gil)    +kth_channel_view_type (boost::gil)    stencil_5points (boost::gil::laplace_function)    -default_color_converter_impl< rgba_t, rgba_t > (boost::gil)    -kth_channel_view_type (boost::gil)    +default_color_converter_impl< rgb_t, cmyk_t > (boost::gil)    +kth_semantic_element_const_reference_type (boost::gil)    stencil_9points_standard (boost::gil::laplace_function)    -DefaultConstructible (boost::gil)    -kth_semantic_element_const_reference_type (boost::gil)    +default_color_converter_impl< rgb_t, gray_t > (boost::gil)    +kth_semantic_element_reference_type (boost::gil)    step_iterator_adaptor (boost::gil::detail)    -deref_base (boost::gil)    -kth_semantic_element_reference_type (boost::gil)    +default_color_converter_impl< rgba_t, C2 > (boost::gil)    +kth_semantic_element_type (boost::gil)    StepIteratorConcept (boost::gil)    -deref_compose (boost::gil)    -kth_semantic_element_type (boost::gil)    -Swappable (boost::gil)    - -dereference_iterator_adaptor (boost::gil)    +default_color_converter_impl< rgba_t, rgba_t > (boost::gil)   
      l  
    +Swappable (boost::gil)    + +DefaultConstructible (boost::gil)   
      t  
    -derived_image_type (boost::gil)    - -derived_iterator_type (boost::gil)    +deref_base (boost::gil)    layout (boost::gil)    + +deref_compose (boost::gil)    +locator_is_basic (boost::gil)    transposed_type (boost::gil)    -derived_pixel_reference_type (boost::gil)    -locator_is_basic (boost::gil)    +dereference_iterator_adaptor (boost::gil)    +locator_is_mutable (boost::gil)    tuple_limit (boost::gil::detail)    -derived_view_type (boost::gil)    -locator_is_mutable (boost::gil)    +derived_image_type (boost::gil)    +locator_is_step_in_x (boost::gil)    type_from_x_iterator (boost::gil)    -devicen_color_t (boost::gil)    -locator_is_step_in_x (boost::gil)    +derived_iterator_type (boost::gil)    +locator_is_step_in_y (boost::gil)    type_to_index (boost::gil::detail)    -devicen_layout_t (boost::gil)    -locator_is_step_in_y (boost::gil)    +derived_pixel_reference_type (boost::gil)    +locator_type (boost::gil)   
      v  
    -devicen_t (boost::gil)    -locator_type (boost::gil)    - -dynamic_x_step_type (boost::gil)    +derived_view_type (boost::gil)   
      m  
    + +devicen_color_t (boost::gil)    view_is_basic (boost::gil)    -dynamic_x_step_type< const Pixel * > (boost::gil)    +devicen_layout_t (boost::gil)    +magenta_t (boost::gil)    view_is_mutable (boost::gil)    -dynamic_x_step_type< Pixel * > (boost::gil)    -magenta_t (boost::gil)    +devicen_t (boost::gil)    +memory_based_2d_locator (boost::gil)    view_is_step_in_x (boost::gil)    -dynamic_xy_step_transposed_type (boost::gil)    -memory_based_2d_locator (boost::gil)    +dynamic_x_step_type (boost::gil)    +memory_based_step_iterator (boost::gil)    view_is_step_in_y (boost::gil)    -dynamic_xy_step_type (boost::gil)    -memory_based_step_iterator (boost::gil)    +dynamic_x_step_type< const Pixel * > (boost::gil)    +MemoryBasedIteratorConcept (boost::gil)    view_type (boost::gil)    -dynamic_y_step_type (boost::gil)    -MemoryBasedIteratorConcept (boost::gil)    +dynamic_x_step_type< Pixel * > (boost::gil)    +memunit_step_fn (boost::gil)    view_type_from_pixel (boost::gil)    +dynamic_xy_step_transposed_type (boost::gil)    +Metafunction (boost::gil)    +views_are_compatible (boost::gil)    + +dynamic_xy_step_type (boost::gil)    +MutableChannelConcept (boost::gil)    +ViewsCompatibleConcept (boost::gil)    + +dynamic_y_step_type (boost::gil)    +MutableColorBaseConcept (boost::gil)    +virtual_2d_locator (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)    +MutableHomogeneousColorBaseConcept (boost::gil)   
      y  
    -element_type (boost::gil)    -MutableHomogeneousColorBaseConcept (boost::gil)    +MutableHomogeneousPixelConcept (boost::gil)    -equal_n_fn< boost::gil::iterator_from_2d< Loc >, It > (boost::gil::detail)    -MutableHomogeneousPixelConcept (boost::gil)    +element_const_reference_type (boost::gil)    +MutableImageViewConcept (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)    +element_reference_type (boost::gil)    MutableIteratorAdaptorConcept (boost::gil)    diff --git a/develop/doc/html/reference/cmyk_8hpp_source.html b/develop/doc/html/reference/cmyk_8hpp_source.html index 893016ab9..f2d0f6cd5 100644 --- a/develop/doc/html/reference/cmyk_8hpp_source.html +++ b/develop/doc/html/reference/cmyk_8hpp_source.html @@ -92,12 +92,12 @@ $(function() {
    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
    +
    Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
    Definition: metafunctions.hpp:302
    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
    +
    An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
    Definition: algorithm.hpp:40
    diff --git a/develop/doc/html/reference/color__convert_8hpp_source.html b/develop/doc/html/reference/color__convert_8hpp_source.html index 1355b3f75..b59a3ae05 100644 --- a/develop/doc/html/reference/color__convert_8hpp_source.html +++ b/develop/doc/html/reference/color__convert_8hpp_source.html @@ -334,7 +334,7 @@ $(function() {
    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
    +
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
    Definition: metafunctions.hpp:24
    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
    diff --git a/develop/doc/html/reference/concepts_2image_8hpp_source.html b/develop/doc/html/reference/concepts_2image_8hpp_source.html index 61e7c7bd8..9aa5c38f6 100644 --- a/develop/doc/html/reference/concepts_2image_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2image_8hpp_source.html @@ -166,11 +166,11 @@ $(function() {
    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
    +
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:42
    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 >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:549
    -
    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
    +
    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:553
    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_2pixel__iterator_8hpp_source.html b/develop/doc/html/reference/concepts_2pixel__iterator_8hpp_source.html index 466f99360..942a98801 100644 --- a/develop/doc/html/reference/concepts_2pixel__iterator_8hpp_source.html +++ b/develop/doc/html/reference/concepts_2pixel__iterator_8hpp_source.html @@ -301,12 +301,12 @@ $(function() {
    360 
    361 #endif
    -
    returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
    Definition: metafunctions.hpp:35
    +
    returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
    Definition: metafunctions.hpp:36
    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
    +
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:35
    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
    diff --git a/develop/doc/html/reference/conversion__policies_8hpp_source.html b/develop/doc/html/reference/conversion__policies_8hpp_source.html index e8da1204d..237f3a4d2 100644 --- a/develop/doc/html/reference/conversion__policies_8hpp_source.html +++ b/develop/doc/html/reference/conversion__policies_8hpp_source.html @@ -152,7 +152,7 @@ $(function() {
    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
    +
    BOOST_FORCEINLINE auto copy(boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
    Copy when both src and dst are interleaved and of the same type can be just memmove.
    Definition: algorithm.hpp:145
    Determines if reader type is read only ( no conversion ).
    Definition: conversion_policies.hpp:97
    diff --git a/develop/doc/html/reference/convolve_8hpp_source.html b/develop/doc/html/reference/convolve_8hpp_source.html new file mode 100644 index 000000000..00a691917 --- /dev/null +++ b/develop/doc/html/reference/convolve_8hpp_source.html @@ -0,0 +1,413 @@ + + + + + + + + + Generic Image Library: convolve.hpp Source File + + + + + + + +
    + + + + + + +
    +

    Boost GIL

    +

    +
    +
    +
    + + + + + + +
    +
    +
    +
    convolve.hpp
    +
    +
    +
    1 //
    +
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    +
    3 // Copyright 2019 Miral Shah <miralshah2211@gmail.com>
    +
    4 // Copyright 2019-2021 Pranam Lashkari <plashkari628@gmail.com>
    +
    5 //
    +
    6 // Distributed under the Boost Software License, Version 1.0
    +
    7 // See accompanying file LICENSE_1_0.txt or copy at
    +
    8 // http://www.boost.org/LICENSE_1_0.txt
    +
    9 //
    +
    10 #ifndef BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP
    +
    11 #define BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP
    +
    12 
    +
    13 #include <boost/gil/image_processing/kernel.hpp>
    +
    14 
    +
    15 #include <boost/gil/algorithm.hpp>
    +
    16 #include <boost/gil/image_view_factory.hpp>
    +
    17 #include <boost/gil/metafunctions.hpp>
    +
    18 #include <boost/gil/pixel_numeric_operations.hpp>
    +
    19 
    +
    20 #include <boost/assert.hpp>
    +
    21 
    +
    22 #include <algorithm>
    +
    23 #include <cstddef>
    +
    24 #include <functional>
    +
    25 #include <type_traits>
    +
    26 #include <vector>
    +
    27 
    +
    28 namespace boost { namespace gil {
    +
    29 
    +
    30 // 2D spatial seperable convolutions and cross-correlations
    +
    31 
    +
    32 namespace detail {
    +
    33 
    +
    50 template
    +
    51 <
    +
    52  typename PixelAccum,
    +
    53  typename SrcView,
    +
    54  typename Kernel,
    +
    55  typename DstView,
    +
    56  typename Correlator
    +
    57 >
    +
    58 void correlate_rows_impl(
    +
    59  SrcView const& src_view,
    +
    60  Kernel const& kernel,
    +
    61  DstView const& dst_view,
    +
    62  boundary_option option,
    +
    63  Correlator correlator)
    +
    64 {
    +
    65  BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
    +
    66  BOOST_ASSERT(kernel.size() != 0);
    +
    67 
    +
    68  if(kernel.size() == 1)
    +
    69  {
    +
    70  // Reduces to a multiplication
    +
    71  view_multiplies_scalar<PixelAccum>(src_view, *kernel.begin(), dst_view);
    +
    72  return;
    +
    73  }
    +
    74 
    +
    75  using src_pixel_ref_t = typename pixel_proxy<typename SrcView::value_type>::type;
    +
    76  using dst_pixel_ref_t = typename pixel_proxy<typename DstView::value_type>::type;
    +
    77  using x_coord_t = typename SrcView::x_coord_t;
    +
    78  using y_coord_t = typename SrcView::y_coord_t;
    +
    79 
    +
    80  x_coord_t const width = src_view.width();
    +
    81  y_coord_t const height = src_view.height();
    +
    82  if (width == 0)
    +
    83  return;
    +
    84 
    +
    85  PixelAccum acc_zero;
    +
    86  pixel_zeros_t<PixelAccum>()(acc_zero);
    +
    87  if (option == boundary_option::output_ignore || option == boundary_option::output_zero)
    +
    88  {
    +
    89  typename DstView::value_type dst_zero;
    +
    90  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(acc_zero, dst_zero);
    +
    91  if (width < static_cast<x_coord_t>(kernel.size()))
    +
    92  {
    +
    93  if (option == boundary_option::output_zero)
    +
    94  fill_pixels(dst_view, dst_zero);
    +
    95  }
    +
    96  else
    +
    97  {
    +
    98  std::vector<PixelAccum> buffer(width);
    +
    99  for (y_coord_t y = 0; y < height; ++y)
    +
    100  {
    +
    101  assign_pixels(src_view.row_begin(y), src_view.row_end(y), &buffer.front());
    +
    102  typename DstView::x_iterator it_dst = dst_view.row_begin(y);
    +
    103  if (option == boundary_option::output_zero)
    +
    104  std::fill_n(it_dst, kernel.left_size(), dst_zero);
    +
    105  it_dst += kernel.left_size();
    +
    106  correlator(&buffer.front(), &buffer.front() + width + 1 - kernel.size(),
    +
    107  kernel.begin(), it_dst);
    +
    108  it_dst += width + 1 - kernel.size();
    +
    109  if (option == boundary_option::output_zero)
    +
    110  std::fill_n(it_dst, kernel.right_size(), dst_zero);
    +
    111  }
    +
    112  }
    +
    113  }
    +
    114  else
    +
    115  {
    +
    116  std::vector<PixelAccum> buffer(width + kernel.size() - 1);
    +
    117  for (y_coord_t y = 0; y < height; ++y)
    +
    118  {
    +
    119  PixelAccum *it_buffer = &buffer.front();
    +
    120  if (option == boundary_option::extend_padded)
    +
    121  {
    +
    122  assign_pixels(
    +
    123  src_view.row_begin(y) - kernel.left_size(),
    +
    124  src_view.row_end(y) + kernel.right_size(),
    +
    125  it_buffer);
    +
    126  }
    +
    127  else if (option == boundary_option::extend_zero)
    +
    128  {
    +
    129  std::fill_n(it_buffer, kernel.left_size(), acc_zero);
    +
    130  it_buffer += kernel.left_size();
    +
    131  assign_pixels(src_view.row_begin(y), src_view.row_end(y), it_buffer);
    +
    132  it_buffer += width;
    +
    133  std::fill_n(it_buffer, kernel.right_size(), acc_zero);
    +
    134  }
    +
    135  else if (option == boundary_option::extend_constant)
    +
    136  {
    +
    137  PixelAccum filler;
    +
    138  pixel_assigns_t<src_pixel_ref_t, PixelAccum>()(*src_view.row_begin(y), filler);
    +
    139  std::fill_n(it_buffer, kernel.left_size(), filler);
    +
    140  it_buffer += kernel.left_size();
    +
    141  assign_pixels(src_view.row_begin(y), src_view.row_end(y), it_buffer);
    +
    142  it_buffer += width;
    +
    143  pixel_assigns_t<src_pixel_ref_t, PixelAccum>()(src_view.row_end(y)[-1], filler);
    +
    144  std::fill_n(it_buffer, kernel.right_size(), filler);
    +
    145  }
    +
    146 
    +
    147  correlator(
    +
    148  &buffer.front(), &buffer.front() + width,
    +
    149  kernel.begin(),
    +
    150  dst_view.row_begin(y));
    +
    151  }
    +
    152  }
    +
    153 }
    +
    154 
    +
    158 template <typename PixelAccum>
    + +
    160 {
    +
    161 public:
    +
    162  correlator_n(std::size_t size) : size_(size) {}
    +
    163 
    +
    164  template <typename SrcIterator, typename KernelIterator, typename DstIterator>
    +
    165  void operator()(
    +
    166  SrcIterator src_begin,
    +
    167  SrcIterator src_end,
    +
    168  KernelIterator kernel_begin,
    +
    169  DstIterator dst_begin)
    +
    170  {
    +
    171  correlate_pixels_n<PixelAccum>(src_begin, src_end, kernel_begin, size_, dst_begin);
    +
    172  }
    +
    173 
    +
    174 private:
    +
    175  std::size_t size_{0};
    +
    176 };
    +
    177 
    +
    181 template <std::size_t Size, typename PixelAccum>
    + +
    183 {
    +
    184  template <typename SrcIterator, typename KernelIterator, typename DstIterator>
    +
    185  void operator()(
    +
    186  SrcIterator src_begin,
    +
    187  SrcIterator src_end,
    +
    188  KernelIterator kernel_begin,
    +
    189  DstIterator dst_begin)
    +
    190  {
    +
    191  correlate_pixels_k<Size, PixelAccum>(src_begin, src_end, kernel_begin, dst_begin);
    +
    192  }
    +
    193 };
    +
    194 
    +
    195 } // namespace detail
    +
    196 
    +
    205 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    206 BOOST_FORCEINLINE
    +
    207 void correlate_rows(
    +
    208  SrcView const& src_view,
    +
    209  Kernel const& kernel,
    +
    210  DstView const& dst_view,
    +
    211  boundary_option option = boundary_option::extend_zero)
    +
    212 {
    +
    213  detail::correlate_rows_impl<PixelAccum>(
    +
    214  src_view, kernel, dst_view, option, detail::correlator_n<PixelAccum>(kernel.size()));
    +
    215 }
    +
    216 
    +
    225 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    226 BOOST_FORCEINLINE
    +
    227 void correlate_cols(
    +
    228  SrcView const& src_view,
    +
    229  Kernel const& kernel,
    +
    230  DstView const& dst_view,
    +
    231  boundary_option option = boundary_option::extend_zero)
    +
    232 {
    +
    233  correlate_rows<PixelAccum>(
    +
    234  transposed_view(src_view), kernel, transposed_view(dst_view), option);
    +
    235 }
    +
    236 
    +
    244 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    245 BOOST_FORCEINLINE
    +
    246 void convolve_rows(
    +
    247  SrcView const& src_view,
    +
    248  Kernel const& kernel,
    +
    249  DstView const& dst_view,
    +
    250  boundary_option option = boundary_option::extend_zero)
    +
    251 {
    +
    252  correlate_rows<PixelAccum>(src_view, reverse_kernel(kernel), dst_view, option);
    +
    253 }
    +
    254 
    +
    263 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    264 BOOST_FORCEINLINE
    +
    265 void convolve_cols(
    +
    266  SrcView const& src_view,
    +
    267  Kernel const& kernel,
    +
    268  DstView const& dst_view,
    +
    269  boundary_option option = boundary_option::extend_zero)
    +
    270 {
    +
    271  convolve_rows<PixelAccum>(
    +
    272  transposed_view(src_view), kernel, transposed_view(dst_view), option);
    +
    273 }
    +
    274 
    +
    282 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    283 BOOST_FORCEINLINE
    +
    284 void correlate_rows_fixed(
    +
    285  SrcView const& src_view,
    +
    286  Kernel const& kernel,
    +
    287  DstView const& dst_view,
    +
    288  boundary_option option = boundary_option::extend_zero)
    +
    289 {
    +
    290  using correlator = detail::correlator_k<Kernel::static_size, PixelAccum>;
    +
    291  detail::correlate_rows_impl<PixelAccum>(src_view, kernel, dst_view, option, correlator{});
    +
    292 }
    +
    293 
    +
    302 template <typename PixelAccum,typename SrcView,typename Kernel,typename DstView>
    +
    303 BOOST_FORCEINLINE
    +
    304 void correlate_cols_fixed(
    +
    305  SrcView const& src_view,
    +
    306  Kernel const& kernel,
    +
    307  DstView const& dst_view,
    +
    308  boundary_option option = boundary_option::extend_zero)
    +
    309 {
    +
    310  correlate_rows_fixed<PixelAccum>(
    +
    311  transposed_view(src_view), kernel, transposed_view(dst_view), option);
    +
    312 }
    +
    313 
    +
    321 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    322 BOOST_FORCEINLINE
    +
    323 void convolve_rows_fixed(
    +
    324  SrcView const& src_view,
    +
    325  Kernel const& kernel,
    +
    326  DstView const& dst_view,
    +
    327  boundary_option option = boundary_option::extend_zero)
    +
    328 {
    +
    329  correlate_rows_fixed<PixelAccum>(src_view, reverse_kernel(kernel), dst_view, option);
    +
    330 }
    +
    331 
    +
    340 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    341 BOOST_FORCEINLINE
    +
    342 void convolve_cols_fixed(
    +
    343  SrcView const& src_view,
    +
    344  Kernel const& kernel,
    +
    345  DstView const& dst_view,
    +
    346  boundary_option option = boundary_option::extend_zero)
    +
    347 {
    +
    348  convolve_rows_fixed<PixelAccum>(
    +
    349  transposed_view(src_view), kernel, transposed_view(dst_view), option);
    +
    350 }
    +
    351 
    +
    352 namespace detail
    +
    353 {
    +
    354 
    +
    363 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
    +
    364 BOOST_FORCEINLINE
    +
    365 void convolve_1d(
    +
    366  SrcView const& src_view,
    +
    367  Kernel const& kernel,
    +
    368  DstView const& dst_view,
    +
    369  boundary_option option = boundary_option::extend_zero)
    +
    370 {
    +
    371  convolve_rows<PixelAccum>(src_view, kernel, dst_view, option);
    +
    372  convolve_cols<PixelAccum>(dst_view, kernel, dst_view, option);
    +
    373 }
    +
    374 
    +
    375 template <typename SrcView, typename DstView, typename Kernel>
    +
    376 void convolve_2d_impl(SrcView const& src_view, DstView const& dst_view, Kernel const& kernel)
    +
    377 {
    +
    378  int flip_ker_row, flip_ker_col, row_boundary, col_boundary;
    +
    379  float aux_total;
    +
    380  for (std::ptrdiff_t view_row = 0; view_row < src_view.height(); ++view_row)
    +
    381  {
    +
    382  for (std::ptrdiff_t view_col = 0; view_col < src_view.width(); ++view_col)
    +
    383  {
    +
    384  aux_total = 0.0f;
    +
    385  for (std::size_t kernel_row = 0; kernel_row < kernel.size(); ++kernel_row)
    +
    386  {
    +
    387  flip_ker_row = kernel.size() - 1 - kernel_row; // row index of flipped kernel
    +
    388 
    +
    389  for (std::size_t kernel_col = 0; kernel_col < kernel.size(); ++kernel_col)
    +
    390  {
    +
    391  flip_ker_col = kernel.size() - 1 - kernel_col; // column index of flipped kernel
    +
    392 
    +
    393  // index of input signal, used for checking boundary
    +
    394  row_boundary = view_row + (kernel.center_y() - flip_ker_row);
    +
    395  col_boundary = view_col + (kernel.center_x() - flip_ker_col);
    +
    396 
    +
    397  // ignore input samples which are out of bound
    +
    398  if (row_boundary >= 0 && row_boundary < src_view.height() &&
    +
    399  col_boundary >= 0 && col_boundary < src_view.width())
    +
    400  {
    +
    401  aux_total +=
    +
    402  src_view(col_boundary, row_boundary)[0] *
    +
    403  kernel.at(flip_ker_row, flip_ker_col);
    +
    404  }
    +
    405  }
    +
    406  }
    +
    407  dst_view(view_col, view_row) = aux_total;
    +
    408  }
    +
    409  }
    +
    410 }
    +
    411 
    +
    419 template <typename SrcView, typename DstView, typename Kernel>
    +
    420 void convolve_2d(SrcView const& src_view, Kernel const& kernel, DstView const& dst_view)
    +
    421 {
    +
    422  BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
    +
    423  BOOST_ASSERT(kernel.size() != 0);
    +
    424 
    +
    425  gil_function_requires<ImageViewConcept<SrcView>>();
    +
    426  gil_function_requires<MutableImageViewConcept<DstView>>();
    +
    427  static_assert(color_spaces_are_compatible
    +
    428  <
    +
    429  typename color_space_type<SrcView>::type,
    +
    430  typename color_space_type<DstView>::type
    +
    431  >::value, "Source and destination views must have pixels with the same color space");
    +
    432 
    +
    433  for (std::size_t i = 0; i < src_view.num_channels(); i++)
    +
    434  {
    +
    435  detail::convolve_2d_impl(
    +
    436  nth_channel_view(src_view, i),
    +
    437  nth_channel_view(dst_view, i),
    +
    438  kernel
    +
    439  );
    +
    440  }
    +
    441 }
    +
    442 
    +
    443 }}} // namespace boost::gil::detail
    +
    444 
    +
    445 #endif
    +
    +
    BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
    std::fill for image views
    Definition: algorithm.hpp:416
    +
    nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
    Definition: image_view_factory.hpp:418
    +
    Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixe...
    Definition: convolve.hpp:159
    +
    dynamic_xy_step_transposed_type< View >::type transposed_view(const View &src)
    Definition: image_view_factory.hpp:210
    +
    Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixe...
    Definition: convolve.hpp:182
    +
    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/device__n_8hpp_source.html b/develop/doc/html/reference/device__n_8hpp_source.html index 71a2f0bd1..d39de118d 100644 --- a/develop/doc/html/reference/device__n_8hpp_source.html +++ b/develop/doc/html/reference/device__n_8hpp_source.html @@ -137,7 +137,7 @@ $(function() {
    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
    +
    Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
    Definition: metafunctions.hpp:302
    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
    diff --git a/develop/doc/html/reference/diffusion_8hpp_source.html b/develop/doc/html/reference/diffusion_8hpp_source.html index ddf5296fb..fbcb2a21b 100644 --- a/develop/doc/html/reference/diffusion_8hpp_source.html +++ b/develop/doc/html/reference/diffusion_8hpp_source.html @@ -446,9 +446,9 @@ $(function() {
    9 point stencil approximation of Laplacian
    Definition: diffusion.hpp:185
    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
    +
    BOOST_FORCEINLINE F transform_pixels(const View1 &src, const View2 &dst, F fun)
    std::transform for image views
    Definition: algorithm.hpp:1122
    +
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:288
    +
    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:549
    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
    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 06c591d0b..2c5ab500a 100644 --- a/develop/doc/html/reference/dynamic__io__new_8hpp_source.html +++ b/develop/doc/html/reference/dynamic__io__new_8hpp_source.html @@ -150,7 +150,7 @@ $(function() {
    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
    +
    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:549
    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 48944cbc7..a2a809d33 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 @@ -237,7 +237,7 @@ $(function() {
    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
    +
    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:549
    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:75
    diff --git a/develop/doc/html/reference/files.html b/develop/doc/html/reference/files.html index b09ceaac2..0b578e46f 100644 --- a/develop/doc/html/reference/files.html +++ b/develop/doc/html/reference/files.html @@ -60,98 +60,102 @@ $(function() {  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 + channel_numeric_operations.hpp + cmyk.hpp + color.hpp + color_base.hpp + concepts/color_base.hpp + color_base_algorithm.hpp + color_convert.hpp + concept_check.hpp + concepts.hpp + conversion_policies.hpp + convolve.hpp + 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 + kernel.hpp + locator.hpp + make_backend.hpp + make_dynamic_image_reader.hpp + make_dynamic_image_writer.hpp + make_reader.hpp + make_scanline_reader.hpp + make_writer.hpp + metafunctions.hpp + morphology.hpp + numeric.hpp + packed_pixel.hpp + path_spec.hpp + pixel.hpp + concepts/pixel.hpp + pixel_based.hpp + pixel_dereference.hpp + pixel_iterator.hpp + concepts/pixel_iterator.hpp + pixel_iterator_adaptor.hpp + pixel_locator.hpp + pixel_numeric_operations.hpp + planar_pixel_iterator.hpp + planar_pixel_reference.hpp + png.hpp + pnm.hpp + point.hpp + concepts/point.hpp + position_iterator.hpp + premultiply.hpp + promote_integral.hpp + raw.hpp + read_and_convert_image.hpp + read_and_convert_view.hpp + read_image.hpp + read_image_info.hpp + read_view.hpp + reader_base.hpp + rgb.hpp + rgba.hpp + row_buffer_helper.hpp + scaling.hpp + scanline_read_iterator.hpp + step_iterator.hpp + targa.hpp + threshold.hpp + tiff.hpp + typedefs.hpp + io/typedefs.hpp + utilities.hpp + virtual_locator.hpp + write_view.hpp diff --git a/develop/doc/html/reference/filter_8hpp_source.html b/develop/doc/html/reference/filter_8hpp_source.html index f0095fa80..7dac6eec2 100644 --- a/develop/doc/html/reference/filter_8hpp_source.html +++ b/develop/doc/html/reference/filter_8hpp_source.html @@ -49,147 +49,149 @@ $(function() {
    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 
    +
    3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
    +
    4 //
    +
    5 // Use, modification and distribution are subject to the Boost Software License,
    +
    6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    +
    7 // http://www.boost.org/LICENSE_1_0.txt)
    +
    8 //
    +
    9 
    +
    10 #ifndef BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    +
    11 #define BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    +
    12 
    +
    13 #include <boost/gil/image_processing/kernel.hpp>
    +
    14 
    +
    15 #include <boost/gil/image_processing/convolve.hpp>
    +
    16 
    +
    17 #include <boost/gil/image.hpp>
    +
    18 #include <boost/gil/image_view.hpp>
    +
    19 #include <boost/gil/algorithm.hpp>
    +
    20 
    +
    21 #include <cstddef>
    +
    22 #include <vector>
    23 
    24 
    -
    25 namespace boost { namespace gil {
    +
    25 
    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
    +
    27 namespace boost { namespace gil {
    +
    28 
    +
    29 template <typename SrcView, typename DstView>
    +
    30 void box_filter(
    +
    31  SrcView const& src_view,
    +
    32  DstView const& dst_view,
    +
    33  std::size_t kernel_size,
    +
    34  long int anchor = -1,
    +
    35  bool normalize=true,
    +
    36  boundary_option option = boundary_option::extend_zero
    +
    37 )
    +
    38 {
    +
    39  gil_function_requires<ImageViewConcept<SrcView>>();
    +
    40  gil_function_requires<MutableImageViewConcept<DstView>>();
    +
    41  static_assert(color_spaces_are_compatible
    +
    42  <
    +
    43  typename color_space_type<SrcView>::type,
    +
    44  typename color_space_type<DstView>::type
    +
    45  >::value, "Source and destination views must have pixels with the same color space");
    +
    46 
    +
    47  std::vector<float> kernel_values;
    +
    48  if (normalize) { kernel_values.resize(kernel_size, 1.0f / float(kernel_size)); }
    +
    49  else { kernel_values.resize(kernel_size, 1.0f); }
    +
    50 
    +
    51  if (anchor == -1) anchor = static_cast<int>(kernel_size / 2);
    +
    52  kernel_1d<float> kernel(kernel_values.begin(), kernel_size, anchor);
    +
    53 
    +
    54  detail::convolve_1d
    +
    55  <
    +
    56  pixel<float, typename SrcView::value_type::layout_t>
    +
    57  >(src_view, kernel, dst_view, option);
    +
    58 }
    +
    59 
    +
    60 template <typename SrcView, typename DstView>
    +
    61 void blur(
    +
    62  SrcView const& src_view,
    +
    63  DstView const& dst_view,
    +
    64  std::size_t kernel_size,
    +
    65  long int anchor = -1,
    +
    66  boundary_option option = boundary_option::extend_zero
    +
    67 )
    +
    68 {
    +
    69  box_filter(src_view, dst_view, kernel_size, anchor, true, option);
    +
    70 }
    +
    71 
    +
    72 
    +
    73 namespace detail
    +
    74 {
    +
    75 template <typename SrcView, typename DstView>
    +
    76 void filter_median_impl(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    +
    77 {
    +
    78  std::size_t half_kernel_size = kernel_size / 2;
    +
    79 
    +
    80  // deciding output channel type and creating functor
    +
    81  using src_channel_t = typename channel_type<SrcView>::type;
    +
    82 
    +
    83  std::vector<src_channel_t> values;
    +
    84  values.reserve(kernel_size * kernel_size);
    +
    85 
    +
    86  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
    +
    87  {
    +
    88  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
    +
    89 
    +
    90  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
    +
    91  {
    +
    92  auto sub_view = subimage_view(
    +
    93  src_view,
    +
    94  x - half_kernel_size, y - half_kernel_size,
    +
    95  kernel_size,
    +
    96  kernel_size
    +
    97  );
    +
    98  values.assign(sub_view.begin(), sub_view.end());
    +
    99 
    +
    100  std::nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
    +
    101  dst_it[x] = values[values.size() / 2];
    +
    102  }
    +
    103  }
    +
    104 }
    +
    105 } // namespace detail
    +
    106 
    +
    107 template <typename SrcView, typename DstView>
    +
    108 void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    +
    109 {
    +
    110  static_assert(color_spaces_are_compatible
    +
    111  <
    +
    112  typename color_space_type<SrcView>::type,
    +
    113  typename color_space_type<DstView>::type
    +
    114  >::value, "Source and destination views must have pixels with the same color space");
    +
    115 
    +
    116  std::size_t half_kernel_size = kernel_size / 2;
    +
    117  auto extended_img = extend_boundary(
    +
    118  src_view,
    +
    119  half_kernel_size,
    +
    120  boundary_option::extend_constant
    +
    121  );
    +
    122  auto extended_view = subimage_view(
    +
    123  view(extended_img),
    +
    124  half_kernel_size,
    +
    125  half_kernel_size,
    +
    126  src_view.width(),
    +
    127  src_view.height()
    +
    128  );
    +
    129 
    +
    130  for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++)
    +
    131  {
    +
    132  detail::filter_median_impl(
    +
    133  nth_channel_view(extended_view, channel),
    +
    134  nth_channel_view(dst_view, channel),
    +
    135  kernel_size
    +
    136  );
    +
    137  }
    +
    138 }
    139 
    -
    140 #endif // !BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    +
    140 }} //namespace boost::gil
    +
    141 
    +
    142 #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
    +
    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:549
    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 73924bb74..d3519666e 100644 --- a/develop/doc/html/reference/functions.html +++ b/develop/doc/html/reference/functions.html @@ -132,7 +132,15 @@ $(function() {

    - o -

    • operator()() -: histogram< T > +: channel_assigns_t< Channel1, Channel2 > +, channel_divides_scalar_t< Channel, Scalar, ChannelResult > +, channel_divides_t< Channel1, Channel2, ChannelResult > +, channel_minus_scalar_t< Channel, Scalar, ChannelResult > +, channel_minus_t< Channel1, Channel2, ChannelResult > +, channel_multiplies_scalar_t< Channel, Scalar, ChannelResult > +, channel_multiplies_t< Channel1, Channel2, ChannelResult > +, channel_plus_t< Channel1, Channel2, ChannelResult > +, histogram< T >
    • operator[]() : bit_aligned_pixel_iterator< NonAlignedPixelReference > diff --git a/develop/doc/html/reference/functions_func.html b/develop/doc/html/reference/functions_func.html index 39e35a61b..7998e6d4b 100644 --- a/develop/doc/html/reference/functions_func.html +++ b/develop/doc/html/reference/functions_func.html @@ -132,7 +132,15 @@ $(function() {

      - o -

      • operator()() -: histogram< T > +: channel_assigns_t< Channel1, Channel2 > +, channel_divides_scalar_t< Channel, Scalar, ChannelResult > +, channel_divides_t< Channel1, Channel2, ChannelResult > +, channel_minus_scalar_t< Channel, Scalar, ChannelResult > +, channel_minus_t< Channel1, Channel2, ChannelResult > +, channel_multiplies_scalar_t< Channel, Scalar, ChannelResult > +, channel_multiplies_t< Channel1, Channel2, ChannelResult > +, channel_plus_t< Channel1, Channel2, ChannelResult > +, histogram< T >
      • operator[]() : bit_aligned_pixel_iterator< NonAlignedPixelReference > diff --git a/develop/doc/html/reference/group___corner_detection_algorithms.html b/develop/doc/html/reference/group___corner_detection_algorithms.html index 0ae0450f7..3fc640915 100644 --- a/develop/doc/html/reference/group___corner_detection_algorithms.html +++ b/develop/doc/html/reference/group___corner_detection_algorithms.html @@ -52,7 +52,7 @@ $(function() {

        Functions

        template<typename T , typename Allocator > -void compute_harris_responses (boost::gil::gray32f_view_t m11, boost::gil::gray32f_view_t m12_21, boost::gil::gray32f_view_t m22, boost::gil::detail::kernel_2d< T, Allocator > weights, float k, boost::gil::gray32f_view_t harris_response) +void compute_harris_responses (boost::gil::gray32f_view_t m11, boost::gil::gray32f_view_t m12_21, boost::gil::gray32f_view_t m22, boost::gil::detail::kernel_2d< T, Allocator > weights, float k, boost::gil::gray32f_view_t harris_response)  function to record Harris responses More...
          @@ -87,7 +87,7 @@ Functions - boost::gil::detail::kernel_2d< T, Allocator >  + boost::gil::detail::kernel_2d< T, Allocator >  weights, diff --git a/develop/doc/html/reference/group___image_processing_math.html b/develop/doc/html/reference/group___image_processing_math.html index 2bb4e7639..5b9a3b005 100644 --- a/develop/doc/html/reference/group___image_processing_math.html +++ b/develop/doc/html/reference/group___image_processing_math.html @@ -55,31 +55,31 @@ Functions  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) +detail::kernel_2d< T, Allocator > generate_normalized_mean (std::size_t side_length)  Generate mean kernel. More...
          template<typename T = float, typename Allocator = std::allocator<T>> -detail::kernel_2d< T, Allocator > generate_unnormalized_mean (std::size_t side_length) +detail::kernel_2d< T, Allocator > generate_unnormalized_mean (std::size_t side_length)  Generate kernel with all 1s. More...
          template<typename T = float, typename Allocator = std::allocator<T>> -detail::kernel_2d< T, Allocator > generate_gaussian_kernel (std::size_t side_length, double sigma) +detail::kernel_2d< T, Allocator > generate_gaussian_kernel (std::size_t side_length, double sigma)  Generate Gaussian kernel. More...
          template<typename T = float, typename Allocator = std::allocator<T>> -detail::kernel_2d< T, Allocator > generate_dx_sobel (unsigned int degree=1) +detail::kernel_2d< T, Allocator > generate_dx_sobel (unsigned int degree=1)  Generates Sobel operator in horizontal direction. More...
          template<typename T = float, typename Allocator = std::allocator<T>> -detail::kernel_2d< T, Allocator > generate_dx_scharr (unsigned int degree=1) +detail::kernel_2d< T, Allocator > generate_dx_scharr (unsigned int degree=1)  Generate Scharr operator in horizontal direction. More...
          template<typename T = float, typename Allocator = std::allocator<T>> -detail::kernel_2d< T, Allocator > generate_dy_sobel (unsigned int degree=1) +detail::kernel_2d< T, Allocator > generate_dy_sobel (unsigned int degree=1)  Generates Sobel operator in vertical direction. More...
          template<typename T = float, typename Allocator = std::allocator<T>> -detail::kernel_2d< T, Allocator > generate_dy_scharr (unsigned int degree=1) +detail::kernel_2d< T, Allocator > generate_dy_scharr (unsigned int degree=1)  Generate Scharr operator in vertical direction. More...
          template<typename GradientView , typename OutputView > @@ -160,7 +160,7 @@ Functions - + @@ -189,7 +189,7 @@ Functions
        detail::kernel_2d<T, Allocator> boost::gil::generate_dx_scharr detail::kernel_2d<T, Allocator> boost::gil::generate_dx_scharr ( unsigned int  degree = 1)
        - + @@ -218,7 +218,7 @@ Functions
        detail::kernel_2d<T, Allocator> boost::gil::generate_dx_sobel detail::kernel_2d<T, Allocator> boost::gil::generate_dx_sobel ( unsigned int  degree = 1)
        - + @@ -247,7 +247,7 @@ Functions
        detail::kernel_2d<T, Allocator> boost::gil::generate_dy_scharr detail::kernel_2d<T, Allocator> boost::gil::generate_dy_scharr ( unsigned int  degree = 1)
        - + @@ -276,7 +276,7 @@ Functions
        detail::kernel_2d<T, Allocator> boost::gil::generate_dy_sobel detail::kernel_2d<T, Allocator> boost::gil::generate_dy_sobel ( unsigned int  degree = 1)
        - + @@ -315,7 +315,7 @@ Functions
        detail::kernel_2d<T, Allocator> boost::gil::generate_gaussian_kernel detail::kernel_2d<T, Allocator> boost::gil::generate_gaussian_kernel ( std::size_t  side_length,
        - + @@ -344,7 +344,7 @@ Functions
        detail::kernel_2d<T, Allocator> boost::gil::generate_normalized_mean detail::kernel_2d<T, Allocator> boost::gil::generate_normalized_mean ( std::size_t  side_length)
        - + diff --git a/develop/doc/html/reference/harris_8hpp_source.html b/develop/doc/html/reference/harris_8hpp_source.html index 716015a9f..bd3afecf2 100644 --- a/develop/doc/html/reference/harris_8hpp_source.html +++ b/develop/doc/html/reference/harris_8hpp_source.html @@ -59,7 +59,7 @@ $(function() {
        10 
        11 #include <boost/gil/image_view.hpp>
        12 #include <boost/gil/typedefs.hpp>
        -
        13 #include <boost/gil/extension/numeric/kernel.hpp>
        +
        13 #include <boost/gil/image_processing/kernel.hpp>
        14 
        15 namespace boost { namespace gil {
        21 
        @@ -69,7 +69,7 @@ $(function() {
        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 {
        @@ -116,6 +116,7 @@ $(function() {
        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
        +
        variable-size kernel
        Definition: kernel.hpp:272
        diff --git a/develop/doc/html/reference/hessian_8hpp_source.html b/develop/doc/html/reference/hessian_8hpp_source.html index 00ac6ed1b..3aa8bdca4 100644 --- a/develop/doc/html/reference/hessian_8hpp_source.html +++ b/develop/doc/html/reference/hessian_8hpp_source.html @@ -59,7 +59,7 @@ $(function() {
        10 
        11 #include <boost/gil/image_view.hpp>
        12 #include <boost/gil/typedefs.hpp>
        -
        13 #include <boost/gil/extension/numeric/kernel.hpp>
        +
        13 #include <boost/gil/image_processing/kernel.hpp>
        14 #include <stdexcept>
        15 
        16 namespace boost { namespace gil {
        diff --git a/develop/doc/html/reference/hierarchy.html b/develop/doc/html/reference/hierarchy.html index 4aec708eb..7f321db98 100644 --- a/develop/doc/html/reference/hierarchy.html +++ b/develop/doc/html/reference/hierarchy.html @@ -71,311 +71,342 @@ $(function() { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        detail::kernel_2d<T, Allocator> boost::gil::generate_unnormalized_mean detail::kernel_2d<T, Allocator> boost::gil::generate_unnormalized_mean ( std::size_t  side_length)
         Cblue_tBlue
         Cbyte_to_memunit< T >
         Cbyte_to_memunit< Iterator >
         Cchannel_converter< SrcChannelV, DstChannelV >A unary function object converting between channel types
         Cchannel_converter_unsigned< float32_t, DstChannelV >Float32_t conversion
         Cchannel_converter_unsigned< float32_t, uint32_t >32 bit <-> float channel conversion
         Cchannel_converter_unsigned< uint32_t, float32_t >32 bit <-> float channel conversion
         Cchannel_converter_unsigned_impl< SrcChannelV, DstChannelV, SrcIsIntegral, DstIsIntegral >This is the default implementation. Performance specializatons are provided
         Cchannel_converter_unsigned_impl< SrcChannelV, DstChannelV, detail::is_channel_integral< SrcChannelV >::value, detail::is_channel_integral< DstChannelV >::value >
         Cchannel_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_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< P >
         Cchannel_type< Deref::value_type >
         Cchannel_type< DFn::value_type >
         Cchannel_type< Iterator >
         Cchannel_type< L >
         Cchannel_type< Loc >
         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< 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
         CChannelConvertibleConcept< SrcChannel, DstChannel >A channel is convertible to another one if the channel_convert algorithm is defined for the two channels
         CChannelIsMutableConcept< T >
         CChannelMappingConcept< CM >Channel mapping concept
         Cchannels_are_compatible< T1, T2 >Predicate metafunction returning whether two channels are compatible
         CChannelsCompatibleConcept< Channel1, Channel2 >Channels are compatible if their associated value types (ignoring constness and references) are the same
         CChannelValueConcept< T >A channel that supports default construction
         CCollectionImageViewConcept< View >GIL view as Collection
         Ccolor_converted_view_type< SrcView, DstP, CC >Returns the type of a view that does color conversion upon dereferencing its pixels
         Ccolor_converted_view_type< any_image_view< Views... >, DstP >Returns the type of a runtime-specified view, color-converted to a given pixel type with the default coor converter
         Ccolor_converted_view_type< any_image_view< Views... >, DstP, 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
         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
         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
         Ccontains_color< ColorBase, Color >A predicate metafunction determining whether a given color base contains a given color
         Ccopier_n< I, O >
         Ccopier_n< I, iterator_from_2d< OL > >Destination range is delimited by image iterators
         Ccopier_n< iterator_from_2d< IL >, iterator_from_2d< OL > >Both source and destination ranges are delimited by image iterators
         Ccopier_n< iterator_from_2d< IL >, O >Source range is delimited by image iterators
         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_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< 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
         CDefaultConstructible< T >Concept of default construction requirement
         Cderef_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >Helper base class for pixel dereference adaptors
         Cderef_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
         Cderef_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
         Cdereference_iterator_adaptor< Iterator, DFn >An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept
         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_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
         Cchannel_assigns_t< Channel1, Channel2 >
         Cchannel_converter< SrcChannelV, DstChannelV >A unary function object converting between channel types
         Cchannel_converter_unsigned< float32_t, DstChannelV >Float32_t conversion
         Cchannel_converter_unsigned< float32_t, uint32_t >32 bit <-> float channel conversion
         Cchannel_converter_unsigned< uint32_t, float32_t >32 bit <-> float channel conversion
         Cchannel_converter_unsigned_impl< SrcChannelV, DstChannelV, SrcIsIntegral, DstIsIntegral >This is the default implementation. Performance specializatons are provided
         Cchannel_converter_unsigned_impl< SrcChannelV, DstChannelV, detail::is_channel_integral< SrcChannelV >::value, detail::is_channel_integral< DstChannelV >::value >
         Cchannel_divides_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of dividing channel value by scalar
         Cchannel_divides_t< Channel1, Channel2, ChannelResult >Arithmetic operation of division of two channel values
         Cchannel_halves_t< Channel >Arithmetic operation of dividing channel value by 2
         Cchannel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept
         Cchannel_minus_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of subtracting scalar from channel value
         Cchannel_minus_t< Channel1, Channel2, ChannelResult >Arithmetic operation of subtraction of two channel values
         Cchannel_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_multiplier_unsigned< uint16_t >Specialization of channel_multiply for 16-bit unsigned channels
         Cchannel_multiplier_unsigned< uint8_t >Specialization of channel_multiply for 8-bit unsigned channels
         Cchannel_multiplies_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of channel value by a scalar
         Cchannel_multiplies_t< Channel1, Channel2, ChannelResult >Arithmetic operation of multiplication of two channel values
         Cchannel_plus_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of adding scalar to channel value
         Cchannel_plus_t< Channel1, Channel2, ChannelResult >Arithmetic operation of addition of two channel values
         Cchannel_type< P >
         Cchannel_type< Deref::value_type >
         Cchannel_type< DFn::value_type >
         Cchannel_type< Iterator >
         Cchannel_type< L >
         Cchannel_type< Loc >
         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< virtual_2d_locator< D, TR >::parent_t >
         Cchannel_type< XIt >
         Cchannel_zeros_t< Channel >Operation of setting channel value to zero
         CChannelConcept< T >A channel is the building block of a color. Color is defined as a mixture of primary colors and a channel defines the degree to which each primary color is used in the mixture
         CChannelConvertibleConcept< SrcChannel, DstChannel >A channel is convertible to another one if the channel_convert algorithm is defined for the two channels
         CChannelIsMutableConcept< T >
         CChannelMappingConcept< CM >Channel mapping concept
         Cchannels_are_compatible< T1, T2 >Predicate metafunction returning whether two channels are compatible
         CChannelsCompatibleConcept< Channel1, Channel2 >Channels are compatible if their associated value types (ignoring constness and references) are the same
         CChannelValueConcept< T >A channel that supports default construction
         CCollectionImageViewConcept< View >GIL view as Collection
         Ccolor_converted_view_type< SrcView, DstP, CC >Returns the type of a view that does color conversion upon dereferencing its pixels
         Ccolor_converted_view_type< any_image_view< Views... >, DstP >Returns the type of a runtime-specified view, color-converted to a given pixel type with the default coor converter
         Ccolor_converted_view_type< any_image_view< Views... >, DstP, 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
         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
         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
         Ccontains_color< ColorBase, Color >A predicate metafunction determining whether a given color base contains a given color
         Ccopier_n< I, O >
         Ccopier_n< I, iterator_from_2d< OL > >Destination range is delimited by image iterators
         Ccopier_n< iterator_from_2d< IL >, iterator_from_2d< OL > >Both source and destination ranges are delimited by image iterators
         Ccopier_n< iterator_from_2d< IL >, O >Source range is delimited by image iterators
         CCopyConstructible< T >Concept of copy construction requirement
         Ccorrelator_k< Size, PixelAccum >Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is a template parameter and must be compulsorily specified while using
         Ccorrelator_n< PixelAccum >Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is to be provided through constructor for all instances
         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_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< 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
         CDefaultConstructible< T >Concept of default construction requirement
         Cderef_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >Helper base class for pixel dereference adaptors
         Cderef_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
         Cderef_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
         Cdereference_iterator_adaptor< Iterator, DFn >An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept
         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_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
         Ckernel_1d_adaptor< Core >Kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),operator[], value_type,iterator,const_iterator,reference,const_reference
         Ckernel_1d_adaptor< std::array< T, Size > >
         Ckernel_1d_adaptor< std::vector< T, std::allocator< T > > >
         Ckernel_2d< T, Allocator >Variable-size kernel
         Ckernel_2d_fixed< T, Size >Static-size kernel
         Ckth_channel_deref_fn< K, SrcP >Function object that returns a grayscale reference of the K-th channel (specified as a template parameter) of a given reference. Models: PixelDereferenceAdaptorConcept
         Ckth_channel_view_type< K, View >Given a source image view type View, returns the type of an image view over a given channel of View
         Ckth_semantic_element_const_reference_type< ColorBase, K >Specifies the return type of the constant semantic_at_c<K>(color_base);
         Ckth_semantic_element_const_reference_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Ckth_semantic_element_reference_type< ColorBase, K >Specifies the return type of the mutable semantic_at_c<K>(color_base);
         Ckth_semantic_element_reference_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Ckth_semantic_element_type< ColorBase, K >Specifies the type of the K-th semantic element of a color base
         Ckth_semantic_element_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Clayout< ColorSpace, ChannelMapping >Represents a color space and ordering of channels in memory
         Clayout< devicen_t< N >::type >
         Clocator_is_basic< Loc >Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator
         Clocator_type< T, L, IsPlanar, IsStepX, IsMutable >Returns the type of a homogeneous locator given the channel type, layout, whether it operates on planar data and whether it has a step horizontally
         Cmagenta_tMagenta
         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_assigns_t< PixelRef, PixelResult >Casts and assigns a pixel to another
         Cpixel_divide_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise division of two pixels
         Cpixel_divides_scalar_t< PixelRef, Scalar, PixelResult >Performs channel-wise division of pixel elements by scalar
         Cpixel_halves_t< PixelRef >Performs channel-wise division by 2
         Cpixel_is_reference< Pixel >Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value)
         Cpixel_minus_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise subtraction of two pixels
         Cpixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult >Performs channel-wise multiplication of pixel elements by scalar
         Cpixel_multiply_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise multiplication of two pixels
         Cpixel_plus_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise addition of two pixels
         Cpixel_proxy< T >Reference proxy associated with a type that has a "reference" member type alias
         Cpixel_reference_is_basic< PixelRef >Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved), gil::planar_pixel_reference (if planar). They must use the standard constness rules
         Cpixel_reference_is_mutable< R >Determines if the given pixel reference is mutable (i.e. its channels can be changed)
         Cpixel_reference_is_proxy< PixelReference >Determines whether the given pixel reference is a proxy class or a native C++ reference
         Cpixel_reference_type< T, L, IsPlanar, IsMutable >Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates on planar data and whether it is mutable
         Cpixel_value_type< Channel, Layout >Returns the type of a homogeneous pixel given the channel type and layout
         Cpixel_zeros_t< PixelRef >Sets pixel elements to zero (for whatever zero means)
         CPixelBasedConcept< P >Concept for all pixel-based GIL constructs
         CPixelConcept< P >Pixel concept - A color base whose elements are channels
         CPixelConvertibleConcept< SrcP, DstP >Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted to another, approximating the color. Conversion is explicit and sometimes lossy
         CPixelDereferenceAdaptorConcept< D >Represents a unary function object that can be invoked upon dereferencing a pixel iterator
         CPixelImageViewIsMutableConcept< View >
         CPixelIteratorConcept< Iterator >An STL random access traversal iterator over a model of PixelConcept
         CPixelIteratorIsMutableConcept< Iterator >
         CPixelLocatorConcept< Loc >GIL's 2-dimensional locator over immutable GIL pixels
         Cpixels_are_compatible< P1, P2 >Returns whether two pixels are compatible Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another
         Cpixels_are_compatible< V1::value_type, V2::value_type >
         CPixelsCompatibleConcept< P1, P2 >Concept for pixel compatibility Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another
         CPixelValueConcept< P >Pixel concept that is a Regular type
         Cplanar_pixel_iterator< ChannelPtr, ColorSpace >An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
         Cplanar_pixel_reference< ChannelReference, ColorSpace >A reference proxy to a planar pixel
         Cplus_asymmetric< T1, T2 >Plus function object whose arguments may be of different type
         Cpoint< T >2D point both axes of which have the same dimension type
         CPoint2DConcept< P >2-dimensional point concept
         Cpoint< std::ptrdiff_t >
         Cpoint< std::size_t >
         CPointNDConcept< P >N-dimensional point concept
         Cposition_iterator< Deref, Dim >An iterator that remembers its current X,Y position and invokes a function object with it upon dereferencing. Used to create virtual image views. Models: StepIteratorConcept, PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept
         Cpromote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >Meta-function to define an integral type with size than is (roughly) twice the bit size of T
         CRandomAccess2DImageConcept< Image >2-dimensional container of values
         CRandomAccess2DImageViewConcept< View >2-dimensional view over immutable values
         CRandomAccess2DImageViewIsMutableConcept< View >
         CRandomAccess2DLocatorConcept< Loc >2-dimensional locator over immutable values
         CRandomAccessNDImageConcept< Image >N-dimensional container of values
         CRandomAccessNDImageViewConcept< View >N-dimensional view over immutable values
         CRandomAccessNDImageViewIsMutableConcept< View >
         CRandomAccessNDLocatorConcept< Loc >N-dimensional locator over immutable values
         CRandomAccessNDLocatorIsMutableConcept< Loc >
         Cfile_stream_device< FormatTag >::read_tagUsed to overload the constructor
         Creader_base< FormatTag, ConversionPolicy >
         Cred_tRed
         CRegular< T >Concept for type regularity requirement
         CReversibleCollectionImageViewConcept< View >GIL view as ReversibleCollection
         Crgb_to_luminance_fn< RedChannel, GreenChannel, BlueChannel, GrayChannelValue >Red * .3 + green * .59 + blue * .11 + .5
         CSameType< T, U >Concept of types equivalence requirement
         Cscanline_read_iterator< Reader >Input iterator to read images
         Csize< ColorBase >Returns an integral constant type specifying the number of elements in a color base
         Cstd_fill_tStruct to do std::fill
         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, IsPlanar >
         CViewsCompatibleConcept< V1, V2 >Views are compatible if they have the same color spaces and compatible channel values
         Cyellow_tYellow
        diff --git a/develop/doc/html/reference/histogram_8hpp_source.html b/develop/doc/html/reference/histogram_8hpp_source.html index 845cba47c..edf0f1f19 100644 --- a/develop/doc/html/reference/histogram_8hpp_source.html +++ b/develop/doc/html/reference/histogram_8hpp_source.html @@ -650,7 +650,7 @@ $(function() {
        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
        +
        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:365
        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
        diff --git a/develop/doc/html/reference/image_8hpp_source.html b/develop/doc/html/reference/image_8hpp_source.html index b02cbd6a5..92be00b26 100644 --- a/develop/doc/html/reference/image_8hpp_source.html +++ b/develop/doc/html/reference/image_8hpp_source.html @@ -49,570 +49,572 @@ $(function() {
        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
        +
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4 //
        +
        5 // Distributed under the Boost Software License, Version 1.0
        +
        6 // See accompanying file LICENSE_1_0.txt or copy at
        +
        7 // http://www.boost.org/LICENSE_1_0.txt
        +
        8 //
        +
        9 #ifndef BOOST_GIL_IMAGE_HPP
        +
        10 #define BOOST_GIL_IMAGE_HPP
        +
        11 
        +
        12 #include <boost/gil/algorithm.hpp>
        +
        13 #include <boost/gil/image_view.hpp>
        +
        14 #include <boost/gil/metafunctions.hpp>
        +
        15 #include <boost/gil/detail/mp11.hpp>
        +
        16 
        +
        17 #include <boost/assert.hpp>
        +
        18 #include <boost/core/exchange.hpp>
        +
        19 
        +
        20 #include <cstddef>
        +
        21 #include <memory>
        +
        22 #include <utility>
        +
        23 #include <type_traits>
        +
        24 
        +
        25 namespace boost { namespace gil {
        +
        26 
        +
        40 
        +
        41 template< typename Pixel, bool IsPlanar, typename Alloc>
        +
        42 class image
        +
        43 {
        +
        44 public:
        +
        45 #if defined(BOOST_NO_CXX11_ALLOCATOR)
        +
        46  using allocator_type = typename Alloc::template rebind<unsigned char>::other;
        +
        47 #else
        +
        48  using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
        +
        49 #endif
        +
        50  using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
        +
        51  using const_view_t = typename view_t::const_t;
        +
        52  using point_t = typename view_t::point_t;
        +
        53  using coord_t = typename view_t::coord_t;
        +
        54  using value_type = typename view_t::value_type;
        +
        55  using x_coord_t = coord_t;
        +
        56  using y_coord_t = coord_t;
        +
        57 
        +
        58  const point_t& dimensions() const { return _view.dimensions(); }
        +
        59  x_coord_t width() const { return _view.width(); }
        +
        60  y_coord_t height() const { return _view.height(); }
        +
        61 
        +
        62  explicit image(std::size_t alignment=0,
        +
        63  const Alloc alloc_in = Alloc()) :
        +
        64  _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}
        +
        65 
        +
        66  // Create with dimensions and optional initial value and alignment
        +
        67  image(const point_t& dimensions,
        +
        68  std::size_t alignment=0,
        +
        69  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        70  , _allocated_bytes( 0 )
        +
        71  {
        +
        72  allocate_and_default_construct(dimensions);
        +
        73  }
        +
        74 
        +
        75  image(x_coord_t width, y_coord_t height,
        +
        76  std::size_t alignment=0,
        +
        77  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        78  , _allocated_bytes( 0 )
        +
        79  {
        +
        80  allocate_and_default_construct(point_t(width,height));
        +
        81  }
        +
        82 
        +
        83  image(const point_t& dimensions,
        +
        84  const Pixel& p_in,
        +
        85  std::size_t alignment = 0,
        +
        86  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        87  , _allocated_bytes( 0 )
        +
        88  {
        +
        89  allocate_and_fill(dimensions, p_in);
        +
        90  }
        +
        91 
        +
        92  image(x_coord_t width, y_coord_t height,
        +
        93  const Pixel& p_in,
        +
        94  std::size_t alignment = 0,
        +
        95  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        96  , _allocated_bytes ( 0 )
        +
        97  {
        +
        98  allocate_and_fill(point_t(width,height),p_in);
        +
        99  }
        +
        100 
        +
        101  image(const image& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
        +
        102  , _allocated_bytes( img._allocated_bytes )
        +
        103  {
        +
        104  allocate_and_copy(img.dimensions(),img._view);
        +
        105  }
        +
        106 
        +
        107  template <typename P2, bool IP2, typename Alloc2>
        +
        108  image(const image<P2,IP2,Alloc2>& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
        +
        109  , _allocated_bytes( img._allocated_bytes )
        +
        110  {
        +
        111  allocate_and_copy(img.dimensions(),img._view);
        +
        112  }
        +
        113 
        +
        114  template <typename Loc,
        +
        115  typename std::enable_if<pixels_are_compatible<typename Loc::value_type, Pixel>::value, int>::type = 0>
        +
        116  image(const image_view<Loc>& view,
        +
        117  std::size_t alignment = 0,
        +
        118  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        119  , _allocated_bytes( 0 )
        +
        120  {
        +
        121  allocate_and_copy(view.dimensions(),view);
        +
        122  }
        +
        123 
        +
        124  // TODO Optimization: use noexcept (requires _view to be nothrow copy constructible)
        +
        125  image(image&& img) :
        +
        126  _view(img._view),
        +
        127  _memory(img._memory),
        +
        128  _align_in_bytes(img._align_in_bytes),
        +
        129  _alloc(std::move(img._alloc)),
        +
        130  _allocated_bytes(img._allocated_bytes)
        +
        131  {
        +
        132  img._view = view_t();
        +
        133  img._memory = nullptr;
        +
        134  img._align_in_bytes = 0;
        +
        135  img._allocated_bytes = 0;
        +
        136  }
        +
        137 
        +
        138  image& operator=(const image& img)
        +
        139  {
        +
        140  if (dimensions() == img.dimensions())
        +
        141  copy_pixels(img._view,_view);
        +
        142  else
        +
        143  {
        +
        144  image tmp(img);
        +
        145  swap(tmp);
        +
        146  }
        +
        147  return *this;
        +
        148  }
        +
        149 
        +
        150  template <typename Img>
        +
        151  image& operator=(const Img& img)
        +
        152  {
        +
        153  if (dimensions() == img.dimensions())
        +
        154  copy_pixels(img._view,_view);
        +
        155  else
        +
        156  {
        +
        157  image tmp(img);
        +
        158  swap(tmp);
        +
        159  }
        +
        160  return *this;
        +
        161  }
        +
        162 
        +
        163  private:
        +
        164  using propagate_allocators = std::true_type;
        +
        165  using no_propagate_allocators = std::false_type;
        +
        166 
        +
        167  template <class Alloc2>
        +
        168  using choose_pocma = typename std::conditional<
        +
        169  // TODO: Use std::allocator_traits<Allocator>::is_always_equal if available
        +
        170  std::is_empty<Alloc2>::value,
        +
        171  std::true_type,
        +
        172  typename std::allocator_traits<Alloc2>::propagate_on_container_move_assignment::type
        +
        173  >::type;
        +
        174 
        +
        175  static void exchange_memory(image& lhs, image& rhs)
        +
        176  {
        +
        177  lhs._memory = boost::exchange(rhs._memory, nullptr);
        +
        178  lhs._align_in_bytes = boost::exchange(rhs._align_in_bytes, 0);
        +
        179  lhs._allocated_bytes = boost::exchange(rhs._allocated_bytes, 0);
        +
        180  lhs._view = boost::exchange(rhs._view, image::view_t{});
        +
        181  };
        +
        182 
        +
        183  void move_assign(image& img, propagate_allocators) noexcept {
        +
        184  // non-sticky allocator, can adopt the memory, fast
        +
        185  destruct_pixels(_view);
        +
        186  this->deallocate();
        +
        187  this->_alloc = img._alloc;
        +
        188  exchange_memory(*this, img);
        +
        189  }
        +
        190 
        +
        191  void move_assign(image& img, no_propagate_allocators) {
        +
        192  if (_alloc == img._alloc) {
        +
        193  // allocator stuck to the rhs, but it's equivalent of ours, we can still adopt the memory
        +
        194  destruct_pixels(_view);
        +
        195  this->deallocate();
        +
        196  exchange_memory(*this, img);
        +
        197  } else {
        +
        198  // cannot propagate the allocator and cannot adopt the memory
        +
        199  if (img._memory)
        +
        200  {
        +
        201  allocate_and_copy(img.dimensions(), img._view);
        +
        202  destruct_pixels(img._view);
        +
        203  img.deallocate();
        +
        204  img._view = image::view_t{};
        +
        205  }
        +
        206  else
        +
        207  {
        +
        208  destruct_pixels(this->_view);
        +
        209  this->deallocate();
        +
        210  this->_view = view_t{};
        +
        211  }
        +
        212  }
        +
        213  }
        +
        214 
        +
        215  public:
        +
        216  // TODO: Use noexcept(noexcept(move_assign(img, choose_pocma<allocator_type>{})))
        +
        217  // But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 prevents it (fixed in GCC > 9)
        +
        218  image& operator=(image&& img) {
        +
        219  if (this != std::addressof(img))
        +
        220  // Use rebinded alloc to choose pocma
        +
        221  move_assign(img, choose_pocma<allocator_type>{});
        +
        222 
        +
        223  return *this;
        +
        224  }
        +
        225 
        +
        226  ~image()
        +
        227  {
        +
        228  destruct_pixels(_view);
        +
        229  deallocate();
        +
        230  }
        +
        231 
        +
        232  Alloc& allocator() { return _alloc; }
        +
        233  Alloc const& allocator() const { return _alloc; }
        +
        234 
        +
        235  void swap(image& img) // required by MutableContainerConcept
        +
        236  {
        +
        237  using std::swap;
        +
        238  swap(_align_in_bytes, img._align_in_bytes);
        +
        239  swap(_memory, img._memory);
        +
        240  swap(_view, img._view);
        +
        241  swap(_alloc, img._alloc);
        +
        242  swap(_allocated_bytes, img._allocated_bytes );
        +
        243  }
        +
        244 
        +
        246  // recreate
        +
        248 
        +
        249  // without Allocator
        +
        250  void recreate(const point_t& dims, std::size_t alignment = 0)
        +
        251  {
        +
        252  if (dims == _view.dimensions() && _align_in_bytes == alignment)
        +
        253  return;
        +
        254 
        +
        255  _align_in_bytes = alignment;
        +
        256 
        +
        257  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        258  {
        +
        259  destruct_pixels(_view);
        +
        260  create_view(dims, std::integral_constant<bool, IsPlanar>());
        + +
        262  }
        +
        263  else
        +
        264  {
        +
        265  image tmp(dims, alignment);
        +
        266  swap(tmp);
        +
        267  }
        +
        268  }
        +
        269 
        +
        270  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment = 0)
        +
        271  {
        +
        272  recreate(point_t(width, height), alignment);
        +
        273  }
        +
        274 
        +
        275  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment = 0)
        +
        276  {
        +
        277  if (dims == _view.dimensions() && _align_in_bytes == alignment)
        +
        278  return;
        +
        279 
        +
        280  _align_in_bytes = alignment;
        +
        281 
        +
        282  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        283  {
        +
        284  destruct_pixels(_view);
        +
        285  create_view(dims, typename std::integral_constant<bool, IsPlanar>());
        +
        286  uninitialized_fill_pixels(_view, p_in);
        +
        287  }
        +
        288  else
        +
        289  {
        +
        290  image tmp(dims, p_in, alignment);
        +
        291  swap(tmp);
        +
        292  }
        +
        293  }
        +
        294 
        +
        295  void recreate( x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment = 0 )
        +
        296  {
        +
        297  recreate( point_t( width, height ), p_in, alignment );
        +
        298  }
        +
        299 
        +
        300  // with Allocator
        +
        301  void recreate(const point_t& dims, std::size_t alignment, const Alloc alloc_in)
        +
        302  {
        +
        303  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
        +
        304  return;
        +
        305 
        +
        306  _align_in_bytes = alignment;
        +
        307 
        +
        308  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        309  {
        +
        310  destruct_pixels(_view);
        +
        311  create_view(dims, std::integral_constant<bool, IsPlanar>());
        + +
        313  }
        +
        314  else
        +
        315  {
        +
        316  image tmp(dims, alignment, alloc_in);
        +
        317  swap(tmp);
        +
        318  }
        +
        319  }
        +
        320 
        +
        321  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
        +
        322  {
        +
        323  recreate(point_t(width, height), alignment, alloc_in);
        +
        324  }
        +
        325 
        +
        326  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in)
        +
        327  {
        +
        328  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
        +
        329  return;
        +
        330 
        +
        331  _align_in_bytes = alignment;
        +
        332 
        +
        333  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        334  {
        +
        335  destruct_pixels(_view);
        +
        336  create_view(dims, std::integral_constant<bool, IsPlanar>());
        +
        337  uninitialized_fill_pixels(_view, p_in);
        +
        338  }
        +
        339  else
        +
        340  {
        +
        341  image tmp(dims, p_in, alignment, alloc_in);
        +
        342  swap(tmp);
        +
        343  }
        +
        344  }
        +
        345 
        +
        346  void recreate(x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in )
        +
        347  {
        +
        348  recreate(point_t(width, height), p_in, alignment, alloc_in);
        +
        349  }
        +
        350 
        +
        351  view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels
        +
        352 
        +
        353  // for construction from other type
        +
        354  template <typename P2, bool IP2, typename Alloc2> friend class image;
        +
        355 private:
        +
        356  unsigned char* _memory;
        +
        357  std::size_t _align_in_bytes;
        +
        358  allocator_type _alloc;
        +
        359 
        +
        360  std::size_t _allocated_bytes;
        +
        361 
        +
        362  void allocate_and_default_construct(point_t const& dimensions)
        +
        363  {
        +
        364  try
        +
        365  {
        +
        366  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        + +
        368  }
        +
        369  catch (...) { deallocate(); throw; }
        +
        370  }
        +
        371 
        +
        372  void allocate_and_fill(const point_t& dimensions, Pixel const& p_in)
        +
        373  {
        +
        374  try
        +
        375  {
        +
        376  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        +
        377  uninitialized_fill_pixels(_view, p_in);
        +
        378  }
        +
        379  catch(...) { deallocate(); throw; }
        +
        380  }
        +
        381 
        +
        382  template <typename View>
        +
        383  void allocate_and_copy(const point_t& dimensions, View const& v)
        +
        384  {
        +
        385  try
        +
        386  {
        +
        387  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        +
        388  uninitialized_copy_pixels(v, _view);
        +
        389  }
        +
        390  catch(...) { deallocate(); throw; }
        +
        391  }
        +
        392 
        +
        393  void deallocate()
        +
        394  {
        +
        395  if (_memory && _allocated_bytes > 0)
        +
        396  _alloc.deallocate(_memory, _allocated_bytes);
        +
        397  }
        +
        398 
        +
        399  std::size_t is_planar_impl(
        +
        400  std::size_t const size_in_units,
        +
        401  std::size_t const channels_in_image,
        +
        402  std::true_type) const
        +
        403  {
        +
        404  return size_in_units * channels_in_image;
        +
        405  }
        +
        406 
        +
        407  std::size_t is_planar_impl(
        +
        408  std::size_t const size_in_units,
        +
        409  std::size_t const,
        +
        410  std::false_type) const
        +
        411  {
        +
        412  return size_in_units;
        +
        413  }
        +
        414 
        +
        415  std::size_t total_allocated_size_in_bytes(point_t const& dimensions) const
        +
        416  {
        +
        417  using x_iterator = typename view_t::x_iterator;
        +
        418 
        +
        419  // when value_type is a non-pixel, like int or float, num_channels< ... > doesn't work.
        +
        420  constexpr std::size_t _channels_in_image =
        +
        421  std::conditional
        +
        422  <
        +
        423  is_pixel<value_type>::value,
        + +
        425  std::integral_constant<std::size_t, 1>
        +
        426  >::type::value;
        +
        427 
        +
        428  std::size_t size_in_units = is_planar_impl(
        +
        429  get_row_size_in_memunits(dimensions.x) * dimensions.y,
        +
        430  _channels_in_image,
        +
        431  std::integral_constant<bool, IsPlanar>());
        +
        432 
        +
        433  // return the size rounded up to the nearest byte
        +
        434  return ( size_in_units + byte_to_memunit< x_iterator >::value - 1 )
        + +
        436  + ( _align_in_bytes > 0 ? _align_in_bytes - 1 : 0 ); // add extra padding in case we need to align the first image pixel
        +
        437  }
        +
        438 
        +
        439  std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row
        +
        440  std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
        +
        441  if (_align_in_bytes>0) {
        +
        442  std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
        +
        443  return align(size_in_memunits, alignment_in_memunits);
        +
        444  }
        +
        445  return size_in_memunits;
        +
        446  }
        +
        447 
        +
        448  void allocate_(point_t const& dimensions, std::false_type)
        +
        449  {
        +
        450  // if it throws and _memory!=0 the client must deallocate _memory
        +
        451  _allocated_bytes = total_allocated_size_in_bytes(dimensions);
        +
        452  _memory=_alloc.allocate( _allocated_bytes );
        +
        453 
        +
        454  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
        +
        455  _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp), get_row_size_in_memunits(dimensions.x)));
        +
        456 
        +
        457  BOOST_ASSERT(_view.width() == dimensions.x);
        +
        458  BOOST_ASSERT(_view.height() == dimensions.y);
        +
        459  }
        +
        460 
        +
        461  void allocate_(point_t const& dimensions, std::true_type)
        +
        462  {
        +
        463  // if it throws and _memory!=0 the client must deallocate _memory
        +
        464  std::size_t row_size=get_row_size_in_memunits(dimensions.x);
        +
        465  std::size_t plane_size=row_size*dimensions.y;
        +
        466 
        +
        467  _allocated_bytes = total_allocated_size_in_bytes( dimensions );
        +
        468 
        +
        469  _memory = _alloc.allocate( _allocated_bytes );
        +
        470 
        +
        471  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
        +
        472  typename view_t::x_iterator first;
        +
        473  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
        +
        474  {
        +
        475  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
        +
        476  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
        +
        477  }
        +
        478  _view=view_t(dimensions, typename view_t::locator(first, row_size));
        +
        479 
        +
        480  BOOST_ASSERT(_view.width() == dimensions.x);
        +
        481  BOOST_ASSERT(_view.height() == dimensions.y);
        +
        482  }
        +
        483 
        +
        484  void create_view(point_t const& dims, std::true_type) // is planar
        +
        485  {
        +
        486  std::size_t row_size=get_row_size_in_memunits(dims.x);
        +
        487  std::size_t plane_size=row_size*dims.y;
        +
        488 
        +
        489  unsigned char* tmp = ( _align_in_bytes > 0 ) ? (unsigned char*) align( (std::size_t) _memory
        +
        490  ,_align_in_bytes
        +
        491  )
        +
        492  : _memory;
        +
        493  typename view_t::x_iterator first;
        +
        494 
        +
        495  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
        +
        496  {
        +
        497  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
        +
        498  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
        +
        499  }
        +
        500 
        +
        501  _view = view_t(dims, typename view_t::locator(first, row_size));
        +
        502 
        +
        503  BOOST_ASSERT(_view.width() == dims.x);
        +
        504  BOOST_ASSERT(_view.height() == dims.y);
        +
        505  }
        +
        506 
        +
        507  void create_view(point_t const& dims, std::false_type) // is planar
        +
        508  {
        +
        509  unsigned char* tmp = ( _align_in_bytes > 0 ) ? ( unsigned char* ) align( (std::size_t) _memory
        +
        510  , _align_in_bytes
        +
        511  )
        +
        512  : _memory;
        +
        513 
        +
        514  _view = view_t( dims
        +
        515  , typename view_t::locator( typename view_t::x_iterator( tmp )
        +
        516  , get_row_size_in_memunits( dims.x )
        +
        517  )
        +
        518  );
        +
        519 
        +
        520  BOOST_ASSERT(_view.width() == dims.x);
        +
        521  BOOST_ASSERT(_view.height() == dims.y);
        +
        522  }
        +
        523 };
        +
        524 
        +
        525 template <typename Pixel, bool IsPlanar, typename Alloc>
        + +
        527 {
        +
        528  im1.swap(im2);
        +
        529 }
        +
        530 
        +
        531 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
        +
        532 bool operator==(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2)
        +
        533 {
        +
        534  if ((void*)(&im1)==(void*)(&im2)) return true;
        +
        535  if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
        +
        536  return equal_pixels(const_view(im1),const_view(im2));
        +
        537 }
        +
        538 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
        +
        539 bool operator!=(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {return !(im1==im2);}
        +
        540 
        +
        544 
        +
        546 
        +
        548 template <typename Pixel, bool IsPlanar, typename Alloc> inline
        +
        549 const typename image<Pixel,IsPlanar,Alloc>::view_t& view(image<Pixel,IsPlanar,Alloc>& img) { return img._view; }
        +
        550 
        +
        552 template <typename Pixel, bool IsPlanar, typename Alloc> inline
        +
        553 const typename image<Pixel,IsPlanar,Alloc>::const_view_t const_view(const image<Pixel,IsPlanar,Alloc>& img)
        +
        554 {
        +
        555  return static_cast<const typename image<Pixel,IsPlanar,Alloc>::const_view_t>(img._view);
        +
        556 }
        +
        558 
        +
        560 // PixelBasedConcept
        +
        562 
        +
        563 template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        564 struct channel_type<image<Pixel, IsPlanar, Alloc>> : channel_type<Pixel> {};
        +
        565 
        +
        566 template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        567 struct color_space_type<image<Pixel, IsPlanar, Alloc>> : color_space_type<Pixel> {};
        +
        568 
        +
        569 template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        570 struct channel_mapping_type<image<Pixel, IsPlanar, Alloc>> : channel_mapping_type<Pixel> {};
        +
        571 
        +
        572 template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        573 struct is_planar<image<Pixel, IsPlanar, Alloc>> : std::integral_constant<bool, IsPlanar> {};
        +
        574 
        +
        575 }} // namespace boost::gil
        +
        576 
        +
        577 #endif
        +
        Returns the type of a view the pixel type, whether it operates on planar data and whether it has a st...
        Definition: metafunctions.hpp:557
        Definition: pixel_iterator.hpp:124
        -
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:41
        +
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:42
        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
        +
        BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
        std::equal for image views
        Definition: algorithm.hpp:1104
        +
        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:819
        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
        +
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition: algorithm.hpp:288
        +
        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:549
        +
        BOOST_FORCEINLINE void destruct_pixels(View const &view)
        Invokes the in-place destructor on every pixel of the view.
        Definition: algorithm.hpp:514
        +
        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:583
        +
        void default_construct_pixels(View const &view)
        Invokes the in-place default constructor on every pixel of the (uninitialized) view....
        Definition: algorithm.hpp:720
        +
        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:553
        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 86a6ea7b5..359578b51 100644 --- a/develop/doc/html/reference/image__view_8hpp_source.html +++ b/develop/doc/html/reference/image__view_8hpp_source.html @@ -424,7 +424,7 @@ $(function() {
        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
        +
        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:549
        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
        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 e2691a5cd..6cc40b892 100644 --- a/develop/doc/html/reference/image__view__factory_8hpp_source.html +++ b/develop/doc/html/reference/image__view__factory_8hpp_source.html @@ -518,12 +518,12 @@ $(function() {
        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
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: metafunctions.hpp:24
        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
        +
        Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
        Definition: metafunctions.hpp:267
        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
        +
        Determines if the given pixel reference is mutable (i.e. its channels can be changed)
        Definition: metafunctions.hpp:229
        +
        Basic views must be over basic locators.
        Definition: metafunctions.hpp:130
        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
        @@ -532,9 +532,9 @@ $(function() {
        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
        +
        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:549
        -
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition: metafunctions.hpp:216
        +
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition: metafunctions.hpp:217
        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
        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 af3b78068..cc91e60ec 100644 --- a/develop/doc/html/reference/iterator__from__2d_8hpp_source.html +++ b/develop/doc/html/reference/iterator__from__2d_8hpp_source.html @@ -197,7 +197,7 @@ $(function() {
        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
        +
        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:1082
        reference operator[](difference_type d) const
        Definition: iterator_from_2d.hpp:65
        diff --git a/develop/doc/html/reference/kernel_8hpp_source.html b/develop/doc/html/reference/kernel_8hpp_source.html new file mode 100644 index 000000000..6c93d967c --- /dev/null +++ b/develop/doc/html/reference/kernel_8hpp_source.html @@ -0,0 +1,418 @@ + + + + + + + + + Generic Image Library: kernel.hpp Source File + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        kernel.hpp
        +
        +
        +
        1 //
        +
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        +
        3 // Copyright 2019 Miral Shah <miralshah2211@gmail.com>
        +
        4 // Copyright 2022 Pranam Lashkari <plashkari628@gmail.com>
        +
        5 //
        +
        6 // Distributed under the Boost Software License, Version 1.0
        +
        7 // See accompanying file LICENSE_1_0.txt or copy at
        +
        8 // http://www.boost.org/LICENSE_1_0.txt
        +
        9 //
        +
        10 
        +
        11 #ifndef BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP
        +
        12 #define BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP
        +
        13 
        +
        14 #include <boost/gil/utilities.hpp>
        +
        15 #include <boost/gil/point.hpp>
        +
        16 
        +
        17 #include <boost/assert.hpp>
        +
        18 
        +
        19 #include <algorithm>
        +
        20 #include <array>
        +
        21 #include <cstddef>
        +
        22 #include <memory>
        +
        23 #include <vector>
        +
        24 #include <cmath>
        +
        25 #include <stdexcept>
        +
        26 
        +
        27 namespace boost { namespace gil {
        +
        28 
        +
        29 // Definitions of 1D fixed-size and variable-size kernels and related operations
        +
        30 
        +
        31 namespace detail {
        +
        32 
        +
        36 template <typename Core>
        +
        37 class kernel_1d_adaptor : public Core
        +
        38 {
        +
        39 public:
        +
        40  kernel_1d_adaptor() = default;
        +
        41 
        +
        42  explicit kernel_1d_adaptor(std::size_t center)
        +
        43  : center_(center)
        +
        44  {
        +
        45  BOOST_ASSERT(center_ < this->size());
        +
        46  }
        +
        47 
        +
        48  kernel_1d_adaptor(std::size_t size, std::size_t center)
        +
        49  : Core(size) , center_(center)
        +
        50  {
        +
        51  BOOST_ASSERT(this->size() > 0);
        +
        52  BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0`
        +
        53  }
        +
        54 
        + +
        56  : Core(other), center_(other.center_)
        +
        57  {
        +
        58  BOOST_ASSERT(this->size() > 0);
        +
        59  BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0`
        +
        60  }
        +
        61 
        +
        62  kernel_1d_adaptor& operator=(kernel_1d_adaptor const& other)
        +
        63  {
        +
        64  Core::operator=(other);
        +
        65  center_ = other.center_;
        +
        66  return *this;
        +
        67  }
        +
        68 
        +
        69  std::size_t left_size() const
        +
        70  {
        +
        71  BOOST_ASSERT(center_ < this->size());
        +
        72  return center_;
        +
        73  }
        +
        74 
        +
        75  std::size_t right_size() const
        +
        76  {
        +
        77  BOOST_ASSERT(center_ < this->size());
        +
        78  return this->size() - center_ - 1;
        +
        79  }
        +
        80 
        +
        81  auto center() -> std::size_t&
        +
        82  {
        +
        83  BOOST_ASSERT(center_ < this->size());
        +
        84  return center_;
        +
        85  }
        +
        86 
        +
        87  auto center() const -> std::size_t const&
        +
        88  {
        +
        89  BOOST_ASSERT(center_ < this->size());
        +
        90  return center_;
        +
        91  }
        +
        92 
        +
        93 private:
        +
        94  std::size_t center_{0};
        +
        95 };
        +
        96 
        +
        97 } // namespace detail
        +
        98 
        +
        100 template <typename T, typename Allocator = std::allocator<T> >
        +
        101 class kernel_1d : public detail::kernel_1d_adaptor<std::vector<T, Allocator>>
        +
        102 {
        + +
        104 public:
        +
        105 
        +
        106  kernel_1d() = default;
        +
        107  kernel_1d(std::size_t size, std::size_t center) : parent_t(size, center) {}
        +
        108 
        +
        109  template <typename FwdIterator>
        +
        110  kernel_1d(FwdIterator elements, std::size_t size, std::size_t center)
        +
        111  : parent_t(size, center)
        +
        112  {
        +
        113  detail::copy_n(elements, size, this->begin());
        +
        114  }
        +
        115 
        +
        116  kernel_1d(kernel_1d const& other) : parent_t(other) {}
        +
        117  kernel_1d& operator=(kernel_1d const& other) = default;
        +
        118 };
        +
        119 
        +
        121 template <typename T,std::size_t Size>
        +
        122 class kernel_1d_fixed : public detail::kernel_1d_adaptor<std::array<T, Size>>
        +
        123 {
        + +
        125 public:
        +
        126  static constexpr std::size_t static_size = Size;
        +
        127  static_assert(static_size > 0, "kernel must have size greater than 0");
        +
        128  static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center");
        +
        129 
        +
        130  kernel_1d_fixed() = default;
        +
        131  explicit kernel_1d_fixed(std::size_t center) : parent_t(center) {}
        +
        132 
        +
        133  template <typename FwdIterator>
        +
        134  explicit kernel_1d_fixed(FwdIterator elements, std::size_t center)
        +
        135  : parent_t(center)
        +
        136  {
        +
        137  detail::copy_n(elements, Size, this->begin());
        +
        138  }
        +
        139 
        +
        140  kernel_1d_fixed(kernel_1d_fixed const& other) : parent_t(other) {}
        +
        141  kernel_1d_fixed& operator=(kernel_1d_fixed const& other) = default;
        +
        142 };
        +
        143 
        +
        144 // TODO: This data member is odr-used and definition at namespace scope
        +
        145 // is required by C++11. Redundant and deprecated in C++17.
        +
        146 template <typename T,std::size_t Size>
        +
        147 constexpr std::size_t kernel_1d_fixed<T, Size>::static_size;
        +
        148 
        +
        150 template <typename Kernel>
        +
        151 inline Kernel reverse_kernel(Kernel const& kernel)
        +
        152 {
        +
        153  Kernel result(kernel);
        +
        154  result.center() = kernel.right_size();
        +
        155  std::reverse(result.begin(), result.end());
        +
        156  return result;
        +
        157 }
        +
        158 
        +
        159 
        +
        160 namespace detail {
        +
        161 
        +
        162 template <typename Core>
        +
        163 class kernel_2d_adaptor : public Core
        +
        164 {
        +
        165 public:
        +
        166  kernel_2d_adaptor() = default;
        +
        167 
        +
        168  explicit kernel_2d_adaptor(std::size_t center_y, std::size_t center_x)
        +
        169  : center_(center_x, center_y)
        +
        170  {
        +
        171  BOOST_ASSERT(center_.y < this->size() && center_.x < this->size());
        +
        172  }
        +
        173 
        +
        174  kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x)
        +
        175  : Core(size * size), square_size(size), center_(center_x, center_y)
        +
        176  {
        +
        177  BOOST_ASSERT(this->size() > 0);
        +
        178  BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0`
        +
        179  }
        +
        180 
        +
        181  kernel_2d_adaptor(kernel_2d_adaptor const& other)
        +
        182  : Core(other), square_size(other.square_size), center_(other.center_.x, other.center_.y)
        +
        183  {
        +
        184  BOOST_ASSERT(this->size() > 0);
        +
        185  BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0`
        +
        186  }
        +
        187 
        +
        188  kernel_2d_adaptor& operator=(kernel_2d_adaptor const& other)
        +
        189  {
        +
        190  Core::operator=(other);
        +
        191  center_.y = other.center_.y;
        +
        192  center_.x = other.center_.x;
        +
        193  square_size = other.square_size;
        +
        194  return *this;
        +
        195  }
        +
        196 
        +
        197  std::size_t upper_size() const
        +
        198  {
        +
        199  BOOST_ASSERT(center_.y < this->size());
        +
        200  return center_.y;
        +
        201  }
        +
        202 
        +
        203  std::size_t lower_size() const
        +
        204  {
        +
        205  BOOST_ASSERT(center_.y < this->size());
        +
        206  return this->size() - center_.y - 1;
        +
        207  }
        +
        208 
        +
        209  std::size_t left_size() const
        +
        210  {
        +
        211  BOOST_ASSERT(center_.x < this->size());
        +
        212  return center_.x;
        +
        213  }
        +
        214 
        +
        215  std::size_t right_size() const
        +
        216  {
        +
        217  BOOST_ASSERT(center_.x < this->size());
        +
        218  return this->size() - center_.x - 1;
        +
        219  }
        +
        220 
        +
        221  auto center_y() -> std::size_t&
        +
        222  {
        +
        223  BOOST_ASSERT(center_.y < this->size());
        +
        224  return center_.y;
        +
        225  }
        +
        226 
        +
        227  auto center_y() const -> std::size_t const&
        +
        228  {
        +
        229  BOOST_ASSERT(center_.y < this->size());
        +
        230  return center_.y;
        +
        231  }
        +
        232 
        +
        233  auto center_x() -> std::size_t&
        +
        234  {
        +
        235  BOOST_ASSERT(center_.x < this->size());
        +
        236  return center_.x;
        +
        237  }
        +
        238 
        +
        239  auto center_x() const -> std::size_t const&
        +
        240  {
        +
        241  BOOST_ASSERT(center_.x < this->size());
        +
        242  return center_.x;
        +
        243  }
        +
        244 
        +
        245  std::size_t size() const
        +
        246  {
        +
        247  return square_size;
        +
        248  }
        +
        249 
        +
        250  typename Core::value_type at(std::size_t x, std::size_t y) const
        +
        251  {
        +
        252  if (x >= this->size() || y >= this->size())
        +
        253  {
        +
        254  throw std::out_of_range("Index out of range");
        +
        255  }
        +
        256  return this->begin()[y * this->size() + x];
        +
        257  }
        +
        258 
        +
        259 protected:
        +
        260  std::size_t square_size{0};
        +
        261 
        +
        262 private:
        +
        263  point<std::size_t> center_{0, 0};
        +
        264 };
        +
        265 
        +
        267 template
        +
        268 <
        +
        269  typename T,
        +
        270  typename Allocator = std::allocator<T>
        +
        271 >
        +
        272 class kernel_2d : public detail::kernel_2d_adaptor<std::vector<T, Allocator>>
        +
        273 {
        +
        274  using parent_t = detail::kernel_2d_adaptor<std::vector<T, Allocator>>;
        +
        275 
        +
        276 public:
        +
        277 
        +
        278  kernel_2d() = default;
        +
        279  kernel_2d(std::size_t size,std::size_t center_y, std::size_t center_x)
        +
        280  : parent_t(size, center_y, center_x)
        +
        281  {}
        +
        282 
        +
        283  template <typename FwdIterator>
        +
        284  kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x)
        +
        285  : parent_t(static_cast<int>(std::sqrt(size)), center_y, center_x)
        +
        286  {
        +
        287  detail::copy_n(elements, size, this->begin());
        +
        288  }
        +
        289 
        +
        290  kernel_2d(kernel_2d const& other) : parent_t(other) {}
        +
        291  kernel_2d& operator=(kernel_2d const& other) = default;
        +
        292 };
        +
        293 
        +
        295 template <typename T, std::size_t Size>
        + +
        297  public detail::kernel_2d_adaptor<std::array<T, Size * Size>>
        +
        298 {
        +
        299  using parent_t = detail::kernel_2d_adaptor<std::array<T, Size * Size>>;
        +
        300 public:
        +
        301  static constexpr std::size_t static_size = Size;
        +
        302  static_assert(static_size > 0, "kernel must have size greater than 0");
        +
        303  static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center");
        +
        304 
        + +
        306  {
        +
        307  this->square_size = Size;
        +
        308  }
        +
        309 
        +
        310  explicit kernel_2d_fixed(std::size_t center_y, std::size_t center_x) :
        +
        311  parent_t(center_y, center_x)
        +
        312  {
        +
        313  this->square_size = Size;
        +
        314  }
        +
        315 
        +
        316  template <typename FwdIterator>
        +
        317  explicit kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x)
        +
        318  : parent_t(center_y, center_x)
        +
        319  {
        +
        320  this->square_size = Size;
        +
        321  detail::copy_n(elements, Size * Size, this->begin());
        +
        322  }
        +
        323 
        +
        324  kernel_2d_fixed(kernel_2d_fixed const& other) : parent_t(other) {}
        +
        325  kernel_2d_fixed& operator=(kernel_2d_fixed const& other) = default;
        +
        326 };
        +
        327 
        +
        328 // TODO: This data member is odr-used and definition at namespace scope
        +
        329 // is required by C++11. Redundant and deprecated in C++17.
        +
        330 template <typename T, std::size_t Size>
        +
        331 constexpr std::size_t kernel_2d_fixed<T, Size>::static_size;
        +
        332 
        +
        333 template <typename Kernel>
        +
        334 inline Kernel reverse_kernel_2d(Kernel const& kernel)
        +
        335 {
        +
        336  Kernel result(kernel);
        +
        337  result.center_x() = kernel.lower_size();
        +
        338  result.center_y() = kernel.right_size();
        +
        339  std::reverse(result.begin(), result.end());
        +
        340  return result;
        +
        341 }
        +
        342 
        +
        343 
        +
        345 template<typename T, typename Allocator>
        +
        346 inline kernel_2d<T, Allocator> reverse_kernel(kernel_2d<T, Allocator> const& kernel)
        +
        347 {
        +
        348  return reverse_kernel_2d(kernel);
        +
        349 }
        +
        350 
        +
        352 template<typename T, std::size_t Size>
        +
        353 inline kernel_2d_fixed<T, Size> reverse_kernel(kernel_2d_fixed<T, Size> const& kernel)
        +
        354 {
        +
        355  return reverse_kernel_2d(kernel);
        +
        356 }
        +
        357 
        +
        358 } //namespace detail
        +
        359 
        +
        360 }} // namespace boost::gil
        +
        361 
        +
        362 #endif
        +
        +
        static-size kernel
        Definition: kernel.hpp:122
        +
        variable-size kernel
        Definition: kernel.hpp:101
        +
        static-size kernel
        Definition: kernel.hpp:296
        +
        kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),...
        Definition: kernel.hpp:37
        +
        Returns an integral constant type specifying the number of elements in a color base.
        Definition: color_base_algorithm.hpp:42
        +
        variable-size kernel
        Definition: kernel.hpp:272
        + + + + + + diff --git a/develop/doc/html/reference/metafunctions_8hpp_source.html b/develop/doc/html/reference/metafunctions_8hpp_source.html index 033fefde7..70ed1db03 100644 --- a/develop/doc/html/reference/metafunctions_8hpp_source.html +++ b/develop/doc/html/reference/metafunctions_8hpp_source.html @@ -49,663 +49,664 @@ $(function() {
        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_METAFUNCTIONS_HPP
        -
        9 #define BOOST_GIL_METAFUNCTIONS_HPP
        -
        10 
        -
        11 #include <boost/gil/channel.hpp>
        -
        12 #include <boost/gil/dynamic_step.hpp>
        -
        13 #include <boost/gil/concepts.hpp>
        -
        14 #include <boost/gil/concepts/detail/type_traits.hpp>
        -
        15 #include <boost/gil/detail/mp11.hpp>
        -
        16 
        -
        17 #include <iterator>
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        22 // forward declarations
        -
        23 template <typename T, typename L> struct pixel;
        -
        24 template <typename BitField,typename ChannelRefs,typename Layout> struct packed_pixel;
        -
        25 template <typename T, typename C> struct planar_pixel_reference;
        -
        26 template <typename IC, typename C> struct planar_pixel_iterator;
        -
        27 template <typename I> class memory_based_step_iterator;
        -
        28 template <typename I> class memory_based_2d_locator;
        -
        29 template <typename L> class image_view;
        -
        30 template <typename Pixel, bool IsPlanar, typename Alloc> class image;
        -
        31 template <typename T> struct channel_type;
        -
        32 template <typename T> struct color_space_type;
        -
        33 template <typename T> struct channel_mapping_type;
        -
        34 template <typename It> struct is_iterator_adaptor;
        -
        35 template <typename It> struct iterator_adaptor_get_base;
        -
        36 template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable> struct bit_aligned_pixel_reference;
        -
        37 
        -
        44 
        +
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4 //
        +
        5 // Distributed under the Boost Software License, Version 1.0
        +
        6 // See accompanying file LICENSE_1_0.txt or copy at
        +
        7 // http://www.boost.org/LICENSE_1_0.txt
        +
        8 //
        +
        9 #ifndef BOOST_GIL_METAFUNCTIONS_HPP
        +
        10 #define BOOST_GIL_METAFUNCTIONS_HPP
        +
        11 
        +
        12 #include <boost/gil/channel.hpp>
        +
        13 #include <boost/gil/dynamic_step.hpp>
        +
        14 #include <boost/gil/concepts.hpp>
        +
        15 #include <boost/gil/concepts/detail/type_traits.hpp>
        +
        16 #include <boost/gil/detail/mp11.hpp>
        +
        17 
        +
        18 #include <iterator>
        +
        19 #include <type_traits>
        +
        20 
        +
        21 namespace boost { namespace gil {
        +
        22 
        +
        23 // forward declarations
        +
        24 template <typename T, typename L> struct pixel;
        +
        25 template <typename BitField,typename ChannelRefs,typename Layout> struct packed_pixel;
        +
        26 template <typename T, typename C> struct planar_pixel_reference;
        +
        27 template <typename IC, typename C> struct planar_pixel_iterator;
        +
        28 template <typename I> class memory_based_step_iterator;
        +
        29 template <typename I> class memory_based_2d_locator;
        +
        30 template <typename L> class image_view;
        +
        31 template <typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> > class image;
        +
        32 template <typename T> struct channel_type;
        +
        33 template <typename T> struct color_space_type;
        +
        34 template <typename T> struct channel_mapping_type;
        +
        35 template <typename It> struct is_iterator_adaptor;
        +
        36 template <typename It> struct iterator_adaptor_get_base;
        +
        37 template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable> struct bit_aligned_pixel_reference;
        +
        38 
        45 
        -
        52 
        -
        56 template <typename PixelRef>
        -
        57 struct pixel_reference_is_basic : public std::false_type {};
        -
        58 
        -
        59 template <typename T, typename L>
        -
        60 struct pixel_reference_is_basic<pixel<T, L>&> : std::true_type {};
        -
        61 
        -
        62 template <typename T, typename L>
        -
        63 struct pixel_reference_is_basic<const pixel<T, L>&> : std::true_type {};
        -
        64 
        -
        65 template <typename TR, typename CS>
        -
        66 struct pixel_reference_is_basic<planar_pixel_reference<TR, CS>> : std::true_type {};
        -
        67 
        -
        68 template <typename TR, typename CS>
        -
        69 struct pixel_reference_is_basic<const planar_pixel_reference<TR, CS>> : std::true_type {};
        -
        70 
        -
        74 template <typename Iterator>
        -
        75 struct iterator_is_basic : std::false_type {};
        -
        76 
        -
        78 template <typename T, typename L>
        -
        79 struct iterator_is_basic<pixel<T, L>*> : std::true_type {};
        -
        80 
        -
        82 template <typename T, typename L>
        -
        83 struct iterator_is_basic<pixel<T, L> const*> : std::true_type {};
        -
        84 
        -
        86 template <typename T, typename CS>
        -
        87 struct iterator_is_basic<planar_pixel_iterator<T*, CS>> : std::true_type {};
        -
        88 
        -
        90 template <typename T, typename CS>
        -
        91 struct iterator_is_basic<planar_pixel_iterator<T const*, CS>> : std::true_type {};
        -
        92 
        -
        94 template <typename T, typename L>
        -
        95 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L>*>> : std::true_type {};
        -
        96 
        -
        98 template <typename T, typename L>
        -
        99 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L> const*>> : std::true_type {};
        -
        100 
        -
        102 template <typename T, typename CS>
        - -
        104  : std::true_type
        -
        105 {};
        -
        106 
        -
        108 template <typename T, typename CS>
        - -
        110  : std::true_type
        -
        111 {};
        -
        112 
        +
        46 
        +
        53 
        +
        57 template <typename PixelRef>
        +
        58 struct pixel_reference_is_basic : public std::false_type {};
        +
        59 
        +
        60 template <typename T, typename L>
        +
        61 struct pixel_reference_is_basic<pixel<T, L>&> : std::true_type {};
        +
        62 
        +
        63 template <typename T, typename L>
        +
        64 struct pixel_reference_is_basic<const pixel<T, L>&> : std::true_type {};
        +
        65 
        +
        66 template <typename TR, typename CS>
        +
        67 struct pixel_reference_is_basic<planar_pixel_reference<TR, CS>> : std::true_type {};
        +
        68 
        +
        69 template <typename TR, typename CS>
        +
        70 struct pixel_reference_is_basic<const planar_pixel_reference<TR, CS>> : std::true_type {};
        +
        71 
        +
        75 template <typename Iterator>
        +
        76 struct iterator_is_basic : std::false_type {};
        +
        77 
        +
        79 template <typename T, typename L>
        +
        80 struct iterator_is_basic<pixel<T, L>*> : std::true_type {};
        +
        81 
        +
        83 template <typename T, typename L>
        +
        84 struct iterator_is_basic<pixel<T, L> const*> : std::true_type {};
        +
        85 
        +
        87 template <typename T, typename CS>
        +
        88 struct iterator_is_basic<planar_pixel_iterator<T*, CS>> : std::true_type {};
        +
        89 
        +
        91 template <typename T, typename CS>
        +
        92 struct iterator_is_basic<planar_pixel_iterator<T const*, CS>> : std::true_type {};
        +
        93 
        +
        95 template <typename T, typename L>
        +
        96 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L>*>> : std::true_type {};
        +
        97 
        +
        99 template <typename T, typename L>
        +
        100 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L> const*>> : std::true_type {};
        +
        101 
        +
        103 template <typename T, typename CS>
        + +
        105  : std::true_type
        +
        106 {};
        +
        107 
        +
        109 template <typename T, typename CS>
        + +
        111  : std::true_type
        +
        112 {};
        113 
        -
        116 template <typename Loc>
        -
        117 struct locator_is_basic : std::false_type {};
        -
        118 
        -
        119 template <typename Iterator>
        -
        120 struct locator_is_basic
        -
        121  <
        - -
        123  > : iterator_is_basic<Iterator>
        -
        124 {};
        -
        125 
        -
        128 template <typename View>
        -
        129 struct view_is_basic : std::false_type {};
        -
        130 
        -
        131 template <typename Loc>
        -
        132 struct view_is_basic<image_view<Loc>> : locator_is_basic<Loc> {};
        -
        133 
        -
        136 template <typename Img>
        -
        137 struct image_is_basic : std::false_type {};
        -
        138 
        -
        139 template <typename Pixel, bool IsPlanar, typename Alloc>
        -
        140 struct image_is_basic<image<Pixel, IsPlanar, Alloc>> : std::true_type {};
        -
        141 
        +
        114 
        +
        117 template <typename Loc>
        +
        118 struct locator_is_basic : std::false_type {};
        +
        119 
        +
        120 template <typename Iterator>
        +
        121 struct locator_is_basic
        +
        122  <
        + +
        124  > : iterator_is_basic<Iterator>
        +
        125 {};
        +
        126 
        +
        129 template <typename View>
        +
        130 struct view_is_basic : std::false_type {};
        +
        131 
        +
        132 template <typename Loc>
        +
        133 struct view_is_basic<image_view<Loc>> : locator_is_basic<Loc> {};
        +
        134 
        +
        137 template <typename Img>
        +
        138 struct image_is_basic : std::false_type {};
        +
        139 
        +
        140 template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        141 struct image_is_basic<image<Pixel, IsPlanar, Alloc>> : std::true_type {};
        142 
        -
        146 
        -
        147 template <typename I>
        - -
        149 
        -
        150 namespace detail {
        -
        151 
        -
        152 template <typename It, bool IsBase, bool EqualsStepType>
        -
        153 struct iterator_is_step_impl;
        -
        154 
        -
        155 // iterator that has the same type as its dynamic_x_step_type must be a step iterator
        -
        156 template <typename It, bool IsBase>
        -
        157 struct iterator_is_step_impl<It, IsBase, true> : std::true_type {};
        -
        158 
        -
        159 // base iterator can never be a step iterator
        -
        160 template <typename It>
        -
        161 struct iterator_is_step_impl<It, true, false> : std::false_type {};
        -
        162 
        -
        163 // for an iterator adaptor, see if its base is step
        -
        164 template <typename It>
        -
        165 struct iterator_is_step_impl<It, false, false>
        -
        166  : public iterator_is_step<typename iterator_adaptor_get_base<It>::type> {};
        -
        167 
        -
        168 } // namespace detail
        -
        169 
        -
        172 template <typename I>
        -
        173 struct iterator_is_step
        -
        174  : detail::iterator_is_step_impl
        -
        175  <
        -
        176  I,
        -
        177  !is_iterator_adaptor<I>::value,
        -
        178  std::is_same<I, typename dynamic_x_step_type<I>::type
        -
        179  >::value
        -
        180 >
        -
        181 {};
        -
        182 
        -
        185 template <typename L> struct locator_is_step_in_x : public iterator_is_step<typename L::x_iterator> {};
        -
        186 
        -
        189 template <typename L> struct locator_is_step_in_y : public iterator_is_step<typename L::y_iterator> {};
        -
        190 
        -
        193 template <typename V> struct view_is_step_in_x : public locator_is_step_in_x<typename V::xy_locator> {};
        -
        194 
        -
        197 template <typename V> struct view_is_step_in_y : public locator_is_step_in_y<typename V::xy_locator> {};
        -
        198 
        -
        201 template <typename PixelReference>
        - -
        203  : mp11::mp_not
        -
        204  <
        -
        205  std::is_same
        -
        206  <
        -
        207  typename detail::remove_const_and_reference<PixelReference>::type,
        -
        208  typename detail::remove_const_and_reference<PixelReference>::type::value_type
        -
        209  >
        -
        210  >
        -
        211 {};
        -
        212 
        -
        215 template <typename Pixel>
        - -
        217  : mp11::mp_or<is_reference<Pixel>, pixel_reference_is_proxy<Pixel>> {};
        -
        218 
        -
        222 
        -
        227 template <typename R>
        - -
        229  : std::integral_constant<bool, std::remove_reference<R>::type::is_mutable>
        -
        230 {};
        -
        231 
        -
        232 template <typename R>
        -
        233 struct pixel_reference_is_mutable<R const&>
        -
        234  : mp11::mp_and<pixel_reference_is_proxy<R>, pixel_reference_is_mutable<R>>
        -
        235 {};
        -
        236 
        -
        239 template <typename L> struct locator_is_mutable : public iterator_is_mutable<typename L::x_iterator> {};
        -
        242 template <typename V> struct view_is_mutable : public iterator_is_mutable<typename V::x_iterator> {};
        -
        243 
        +
        143 
        +
        147 
        +
        148 template <typename I>
        + +
        150 
        +
        151 namespace detail {
        +
        152 
        +
        153 template <typename It, bool IsBase, bool EqualsStepType>
        +
        154 struct iterator_is_step_impl;
        +
        155 
        +
        156 // iterator that has the same type as its dynamic_x_step_type must be a step iterator
        +
        157 template <typename It, bool IsBase>
        +
        158 struct iterator_is_step_impl<It, IsBase, true> : std::true_type {};
        +
        159 
        +
        160 // base iterator can never be a step iterator
        +
        161 template <typename It>
        +
        162 struct iterator_is_step_impl<It, true, false> : std::false_type {};
        +
        163 
        +
        164 // for an iterator adaptor, see if its base is step
        +
        165 template <typename It>
        +
        166 struct iterator_is_step_impl<It, false, false>
        +
        167  : public iterator_is_step<typename iterator_adaptor_get_base<It>::type> {};
        +
        168 
        +
        169 } // namespace detail
        +
        170 
        +
        173 template <typename I>
        +
        174 struct iterator_is_step
        +
        175  : detail::iterator_is_step_impl
        +
        176  <
        +
        177  I,
        +
        178  !is_iterator_adaptor<I>::value,
        +
        179  std::is_same<I, typename dynamic_x_step_type<I>::type
        +
        180  >::value
        +
        181 >
        +
        182 {};
        +
        183 
        +
        186 template <typename L> struct locator_is_step_in_x : public iterator_is_step<typename L::x_iterator> {};
        +
        187 
        +
        190 template <typename L> struct locator_is_step_in_y : public iterator_is_step<typename L::y_iterator> {};
        +
        191 
        +
        194 template <typename V> struct view_is_step_in_x : public locator_is_step_in_x<typename V::xy_locator> {};
        +
        195 
        +
        198 template <typename V> struct view_is_step_in_y : public locator_is_step_in_y<typename V::xy_locator> {};
        +
        199 
        +
        202 template <typename PixelReference>
        + +
        204  : mp11::mp_not
        +
        205  <
        +
        206  std::is_same
        +
        207  <
        +
        208  typename detail::remove_const_and_reference<PixelReference>::type,
        +
        209  typename detail::remove_const_and_reference<PixelReference>::type::value_type
        +
        210  >
        +
        211  >
        +
        212 {};
        +
        213 
        +
        216 template <typename Pixel>
        + +
        218  : mp11::mp_or<is_reference<Pixel>, pixel_reference_is_proxy<Pixel>> {};
        +
        219 
        +
        223 
        +
        228 template <typename R>
        + +
        230  : std::integral_constant<bool, std::remove_reference<R>::type::is_mutable>
        +
        231 {};
        +
        232 
        +
        233 template <typename R>
        +
        234 struct pixel_reference_is_mutable<R const&>
        +
        235  : mp11::mp_and<pixel_reference_is_proxy<R>, pixel_reference_is_mutable<R>>
        +
        236 {};
        +
        237 
        +
        240 template <typename L> struct locator_is_mutable : public iterator_is_mutable<typename L::x_iterator> {};
        +
        243 template <typename V> struct view_is_mutable : public iterator_is_mutable<typename V::x_iterator> {};
        244 
        -
        251 
        -
        255 
        -
        259 
        -
        263 
        -
        266 template <typename T, typename L, bool IsPlanar=false, bool IsMutable=true> struct pixel_reference_type{};
        -
        267 template <typename T, typename L> struct pixel_reference_type<T,L,false,true > { using type = pixel<T,L>&; };
        -
        268 template <typename T, typename L> struct pixel_reference_type<T,L,false,false> { using type = pixel<T,L> const&; };
        -
        269 template <typename T, typename L> struct pixel_reference_type<T,L,true,true> { using type = planar_pixel_reference<typename channel_traits<T>::reference,typename color_space_type<L>::type> const; }; // TODO: Assert M=identity
        -
        270 template <typename T, typename L> struct pixel_reference_type<T,L,true,false> { using type = planar_pixel_reference<typename channel_traits<T>::const_reference,typename color_space_type<L>::type> const; };// TODO: Assert M=identity
        -
        271 
        -
        274 template <typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type_from_pixel{};
        -
        275 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,true > { using type = Pixel *; };
        -
        276 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,false> { using type = const Pixel *; };
        -
        277 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,true> {
        -
        278  using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::pointer,typename color_space_type<Pixel>::type>;
        -
        279 };
        -
        280 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,false> {
        -
        281  using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::const_pointer,typename color_space_type<Pixel>::type>;
        -
        282 };
        -
        283 template <typename Pixel, bool IsPlanar, bool IsMutable> struct iterator_type_from_pixel<Pixel,IsPlanar,true,IsMutable> {
        -
        284  using type = memory_based_step_iterator<typename iterator_type_from_pixel<Pixel,IsPlanar,false,IsMutable>::type>;
        -
        285 };
        -
        286 
        -
        289 template <typename T, typename L, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type{};
        -
        290 template <typename T, typename L> struct iterator_type<T,L,false,false,true > { using type = pixel<T,L>*; };
        -
        291 template <typename T, typename L> struct iterator_type<T,L,false,false,false> { using type = pixel<T,L> const*; };
        -
        292 template <typename T, typename L> struct iterator_type<T,L,true,false,true> { using type = planar_pixel_iterator<T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        -
        293 template <typename T, typename L> struct iterator_type<T,L,true,false,false> { using type = planar_pixel_iterator<const T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        -
        294 template <typename T, typename L, bool IsPlanar, bool IsMutable> struct iterator_type<T,L,IsPlanar,true,IsMutable> {
        -
        295  using type = memory_based_step_iterator<typename iterator_type<T,L,IsPlanar,false,IsMutable>::type>;
        -
        296 };
        -
        297 
        -
        300 template <typename XIterator>
        - -
        302 {
        - - - -
        306 };
        -
        307 
        -
        308 namespace detail {
        -
        309 
        -
        310 template <typename BitField, typename FirstBit, typename NumBits>
        -
        311 struct packed_channel_reference_type
        -
        312 {
        -
        313  using type = packed_channel_reference
        -
        314  <
        -
        315  BitField, FirstBit::value, NumBits::value, true
        -
        316  > const;
        -
        317 };
        -
        318 
        -
        319 template <typename BitField, typename ChannelBitSizes>
        -
        320 class packed_channel_references_vector_type
        -
        321 {
        -
        322  template <typename FirstBit, typename NumBits>
        -
        323  using reference_type = typename packed_channel_reference_type<BitField, FirstBit, NumBits>::type;
        -
        324 
        -
        325  // If ChannelBitSizesVector is mp11::mp_list_c<int,7,7,2>
        -
        326  // Then first_bits_vector will be mp11::mp_list_c<int,0,7,14,16>
        -
        327  using first_bit_list = mp11::mp_fold_q
        -
        328  <
        -
        329  ChannelBitSizes,
        -
        330  mp11::mp_list<std::integral_constant<int, 0>>,
        -
        331  mp11::mp_bind
        -
        332  <
        -
        333  mp11::mp_push_back,
        -
        334  mp11::_1,
        -
        335  mp11::mp_bind
        -
        336  <
        -
        337  mp11::mp_plus,
        -
        338  mp11::mp_bind<mp_back, mp11::_1>,
        -
        339  mp11::_2
        -
        340  >
        -
        341  >
        -
        342  >;
        -
        343 
        -
        344  static_assert(mp11::mp_at_c<first_bit_list, 0>::value == 0, "packed channel first bit must be 0");
        -
        345 
        -
        346 public:
        -
        347  using type = mp11::mp_transform
        -
        348  <
        -
        349  reference_type,
        -
        350  mp_pop_back<first_bit_list>,
        -
        351  ChannelBitSizes
        -
        352  >;
        -
        353 };
        -
        354 
        -
        355 } // namespace detail
        -
        356 
        -
        365 template <typename BitField, typename ChannelBitSizes, typename Layout>
        - -
        367 {
        -
        368  using type = packed_pixel
        -
        369  <
        -
        370  BitField,
        -
        371  typename detail::packed_channel_references_vector_type
        -
        372  <
        -
        373  BitField,
        -
        374  ChannelBitSizes
        -
        375  >::type,
        -
        376  Layout>;
        -
        377 };
        -
        378 
        -
        387 
        -
        390 template <typename BitField, typename ChannelBitSizes, typename Layout, typename Alloc=std::allocator<unsigned char>>
        - -
        392 {
        - -
        394 };
        -
        395 
        -
        398 template <typename BitField, unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        400  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1>, Layout, Alloc>
        -
        401 {};
        -
        402 
        -
        405 template <typename BitField, unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        407  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc>
        -
        408 {};
        -
        409 
        -
        412 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        414  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc>
        -
        415 {};
        -
        416 
        -
        419 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        421  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc>
        -
        422 {};
        -
        423 
        -
        426 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        428  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        -
        429 
        +
        245 
        +
        252 
        +
        256 
        +
        260 
        +
        264 
        +
        267 template <typename T, typename L, bool IsPlanar=false, bool IsMutable=true> struct pixel_reference_type{};
        +
        268 template <typename T, typename L> struct pixel_reference_type<T,L,false,true > { using type = pixel<T,L>&; };
        +
        269 template <typename T, typename L> struct pixel_reference_type<T,L,false,false> { using type = pixel<T,L> const&; };
        +
        270 template <typename T, typename L> struct pixel_reference_type<T,L,true,true> { using type = planar_pixel_reference<typename channel_traits<T>::reference,typename color_space_type<L>::type> const; }; // TODO: Assert M=identity
        +
        271 template <typename T, typename L> struct pixel_reference_type<T,L,true,false> { using type = planar_pixel_reference<typename channel_traits<T>::const_reference,typename color_space_type<L>::type> const; };// TODO: Assert M=identity
        +
        272 
        +
        275 template <typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type_from_pixel{};
        +
        276 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,true > { using type = Pixel *; };
        +
        277 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,false> { using type = const Pixel *; };
        +
        278 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,true> {
        +
        279  using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::pointer,typename color_space_type<Pixel>::type>;
        +
        280 };
        +
        281 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,false> {
        +
        282  using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::const_pointer,typename color_space_type<Pixel>::type>;
        +
        283 };
        +
        284 template <typename Pixel, bool IsPlanar, bool IsMutable> struct iterator_type_from_pixel<Pixel,IsPlanar,true,IsMutable> {
        +
        285  using type = memory_based_step_iterator<typename iterator_type_from_pixel<Pixel,IsPlanar,false,IsMutable>::type>;
        +
        286 };
        +
        287 
        +
        290 template <typename T, typename L, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type{};
        +
        291 template <typename T, typename L> struct iterator_type<T,L,false,false,true > { using type = pixel<T,L>*; };
        +
        292 template <typename T, typename L> struct iterator_type<T,L,false,false,false> { using type = pixel<T,L> const*; };
        +
        293 template <typename T, typename L> struct iterator_type<T,L,true,false,true> { using type = planar_pixel_iterator<T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        +
        294 template <typename T, typename L> struct iterator_type<T,L,true,false,false> { using type = planar_pixel_iterator<const T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        +
        295 template <typename T, typename L, bool IsPlanar, bool IsMutable> struct iterator_type<T,L,IsPlanar,true,IsMutable> {
        +
        296  using type = memory_based_step_iterator<typename iterator_type<T,L,IsPlanar,false,IsMutable>::type>;
        +
        297 };
        +
        298 
        +
        301 template <typename XIterator>
        + +
        303 {
        + + + +
        307 };
        +
        308 
        +
        309 namespace detail {
        +
        310 
        +
        311 template <typename BitField, typename FirstBit, typename NumBits>
        +
        312 struct packed_channel_reference_type
        +
        313 {
        +
        314  using type = packed_channel_reference
        +
        315  <
        +
        316  BitField, FirstBit::value, NumBits::value, true
        +
        317  > const;
        +
        318 };
        +
        319 
        +
        320 template <typename BitField, typename ChannelBitSizes>
        +
        321 class packed_channel_references_vector_type
        +
        322 {
        +
        323  template <typename FirstBit, typename NumBits>
        +
        324  using reference_type = typename packed_channel_reference_type<BitField, FirstBit, NumBits>::type;
        +
        325 
        +
        326  // If ChannelBitSizesVector is mp11::mp_list_c<int,7,7,2>
        +
        327  // Then first_bits_vector will be mp11::mp_list_c<int,0,7,14,16>
        +
        328  using first_bit_list = mp11::mp_fold_q
        +
        329  <
        +
        330  ChannelBitSizes,
        +
        331  mp11::mp_list<std::integral_constant<int, 0>>,
        +
        332  mp11::mp_bind
        +
        333  <
        +
        334  mp11::mp_push_back,
        +
        335  mp11::_1,
        +
        336  mp11::mp_bind
        +
        337  <
        +
        338  mp11::mp_plus,
        +
        339  mp11::mp_bind<mp_back, mp11::_1>,
        +
        340  mp11::_2
        +
        341  >
        +
        342  >
        +
        343  >;
        +
        344 
        +
        345  static_assert(mp11::mp_at_c<first_bit_list, 0>::value == 0, "packed channel first bit must be 0");
        +
        346 
        +
        347 public:
        +
        348  using type = mp11::mp_transform
        +
        349  <
        +
        350  reference_type,
        +
        351  mp_pop_back<first_bit_list>,
        +
        352  ChannelBitSizes
        +
        353  >;
        +
        354 };
        +
        355 
        +
        356 } // namespace detail
        +
        357 
        +
        366 template <typename BitField, typename ChannelBitSizes, typename Layout>
        + +
        368 {
        +
        369  using type = packed_pixel
        +
        370  <
        +
        371  BitField,
        +
        372  typename detail::packed_channel_references_vector_type
        +
        373  <
        +
        374  BitField,
        +
        375  ChannelBitSizes
        +
        376  >::type,
        +
        377  Layout>;
        +
        378 };
        +
        379 
        +
        388 
        +
        391 template <typename BitField, typename ChannelBitSizes, typename Layout, typename Alloc=std::allocator<unsigned char>>
        + +
        393 {
        + +
        395 };
        +
        396 
        +
        399 template <typename BitField, unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        + +
        401  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1>, Layout, Alloc>
        +
        402 {};
        +
        403 
        +
        406 template <typename BitField, unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        + +
        408  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc>
        +
        409 {};
        +
        410 
        +
        413 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        + +
        415  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc>
        +
        416 {};
        +
        417 
        +
        420 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        + +
        422  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc>
        +
        423 {};
        +
        424 
        +
        427 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        + +
        429  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        430 
        -
        437 template
        -
        438 <
        -
        439  typename ChannelBitSizes,
        -
        440  typename Layout,
        -
        441  typename Alloc = std::allocator<unsigned char>
        -
        442 >
        - -
        444 {
        -
        445 private:
        -
        446 
        -
        447  static constexpr int bit_size =
        -
        448  mp11::mp_fold
        -
        449  <
        -
        450  ChannelBitSizes,
        -
        451  std::integral_constant<int, 0>,
        -
        452  mp11::mp_plus
        -
        453  >::value;
        -
        454 
        -
        455  using bitfield_t = typename detail::min_fast_uint<bit_size + 7>::type;
        -
        456  using bit_alignedref_t = bit_aligned_pixel_reference<bitfield_t, ChannelBitSizes, Layout, true> const;
        -
        457 
        -
        458 public:
        - -
        460 };
        -
        461 
        -
        464 template <unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        465 struct bit_aligned_image1_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1>, Layout, Alloc> {};
        -
        466 
        -
        469 template <unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        470 struct bit_aligned_image2_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc> {};
        -
        471 
        -
        474 template <unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        475 struct bit_aligned_image3_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc> {};
        -
        476 
        -
        479 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        480 struct bit_aligned_image4_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc> {};
        -
        481 
        -
        484 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        485 struct bit_aligned_image5_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        -
        486 
        +
        431 
        +
        438 template
        +
        439 <
        +
        440  typename ChannelBitSizes,
        +
        441  typename Layout,
        +
        442  typename Alloc = std::allocator<unsigned char>
        +
        443 >
        + +
        445 {
        +
        446 private:
        +
        447 
        +
        448  static constexpr int bit_size =
        +
        449  mp11::mp_fold
        +
        450  <
        +
        451  ChannelBitSizes,
        +
        452  std::integral_constant<int, 0>,
        +
        453  mp11::mp_plus
        +
        454  >::value;
        +
        455 
        +
        456  using bitfield_t = typename detail::min_fast_uint<bit_size + 7>::type;
        +
        457  using bit_alignedref_t = bit_aligned_pixel_reference<bitfield_t, ChannelBitSizes, Layout, true> const;
        +
        458 
        +
        459 public:
        + +
        461 };
        +
        462 
        +
        465 template <unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        466 struct bit_aligned_image1_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1>, Layout, Alloc> {};
        +
        467 
        +
        470 template <unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        471 struct bit_aligned_image2_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc> {};
        +
        472 
        +
        475 template <unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        476 struct bit_aligned_image3_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc> {};
        +
        477 
        +
        480 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        481 struct bit_aligned_image4_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc> {};
        +
        482 
        +
        485 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        486 struct bit_aligned_image5_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        487 
        -
        490 template <typename Channel, typename Layout>
        - -
        492 {
        -
        493  // by default use gil::pixel. Specializations are provided for
        - -
        495 };
        -
        496 
        -
        497 // Specializations for packed channels
        -
        498 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        -
        499 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable>, Layout>
        -
        500  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        501 {};
        -
        502 
        -
        503 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        -
        504 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable> const, Layout>
        -
        505  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        506 {};
        -
        507 
        -
        508 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        -
        509 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable>, Layout>
        -
        510  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        511 {};
        -
        512 
        -
        513 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        -
        514 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable> const, Layout>
        -
        515  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        516 {};
        -
        517 
        -
        518 template <int NumBits, typename Layout>
        -
        519 struct pixel_value_type<packed_channel_value<NumBits>, Layout>
        -
        520  : packed_pixel_type<typename detail::min_fast_uint<NumBits>::type, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        521 {};
        -
        522 
        -
        525 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        - -
        527 {
        -
        528  using type = typename type_from_x_iterator
        -
        529  <
        - -
        531  >::xy_locator_type;
        -
        532 };
        -
        533 
        -
        536 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        -
        537 struct view_type
        -
        538 {
        -
        539  using type = typename type_from_x_iterator
        -
        540  <
        - -
        542  >::view_t;
        -
        543 };
        -
        544 
        -
        547 template <typename T, typename L, bool IsPlanar = false, typename Alloc = std::allocator<unsigned char>>
        - -
        549 {
        -
        550  using type = image<pixel<T, L>, IsPlanar, Alloc>;
        -
        551 };
        -
        552 
        -
        555 template <typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true>
        - - -
        558 };
        -
        559 
        +
        488 
        +
        491 template <typename Channel, typename Layout>
        + +
        493 {
        +
        494  // by default use gil::pixel. Specializations are provided for
        + +
        496 };
        +
        497 
        +
        498 // Specializations for packed channels
        +
        499 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        +
        500 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable>, Layout>
        +
        501  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        502 {};
        +
        503 
        +
        504 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        +
        505 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable> const, Layout>
        +
        506  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        507 {};
        +
        508 
        +
        509 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        +
        510 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable>, Layout>
        +
        511  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        512 {};
        +
        513 
        +
        514 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        +
        515 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable> const, Layout>
        +
        516  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        517 {};
        +
        518 
        +
        519 template <int NumBits, typename Layout>
        +
        520 struct pixel_value_type<packed_channel_value<NumBits>, Layout>
        +
        521  : packed_pixel_type<typename detail::min_fast_uint<NumBits>::type, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        522 {};
        +
        523 
        +
        526 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        + +
        528 {
        +
        529  using type = typename type_from_x_iterator
        +
        530  <
        + +
        532  >::xy_locator_type;
        +
        533 };
        +
        534 
        +
        537 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        +
        538 struct view_type
        +
        539 {
        +
        540  using type = typename type_from_x_iterator
        +
        541  <
        + +
        543  >::view_t;
        +
        544 };
        +
        545 
        +
        548 template <typename T, typename L, bool IsPlanar = false, typename Alloc = std::allocator<unsigned char>>
        + +
        550 {
        +
        551  using type = image<pixel<T, L>, IsPlanar, Alloc>;
        +
        552 };
        +
        553 
        +
        556 template <typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true>
        + + +
        559 };
        560 
        -
        564 template
        -
        565 <
        -
        566  typename Ref,
        -
        567  typename T = use_default,
        -
        568  typename L = use_default,
        -
        569  typename IsPlanar = use_default,
        -
        570  typename IsMutable = use_default>
        - -
        572 {
        -
        573  using pixel_t = typename std::remove_reference<Ref>::type;
        -
        574 
        -
        575  using channel_t = typename mp11::mp_if
        -
        576  <
        -
        577  std::is_same<T, use_default>,
        - -
        579  T
        -
        580  >::type;
        -
        581 
        -
        582  using layout_t = typename mp11::mp_if
        -
        583  <
        -
        584  std::is_same<L, use_default>,
        -
        585  layout
        -
        586  <
        -
        587  typename color_space_type<pixel_t>::type,
        -
        588  typename channel_mapping_type<pixel_t>::type
        -
        589  >,
        -
        590  L
        -
        591  >::type;
        -
        592 
        -
        593  static bool const mut = mp11::mp_if
        -
        594  <
        -
        595  std::is_same<IsMutable, use_default>,
        - -
        597  IsMutable
        -
        598  >::value;
        -
        599 
        -
        600  static bool const planar = mp11::mp_if
        -
        601  <
        -
        602  std::is_same<IsPlanar, use_default>,
        -
        603  is_planar<pixel_t>,
        -
        604  IsPlanar
        -
        605  >::value;
        -
        606 
        -
        607 public:
        - -
        609 };
        -
        610 
        -
        614 template
        -
        615 <
        -
        616  typename Iterator,
        -
        617  typename T = use_default,
        -
        618  typename L = use_default,
        -
        619  typename IsPlanar = use_default,
        -
        620  typename IsStep = use_default,
        -
        621  typename IsMutable = use_default
        -
        622 >
        - -
        624 {
        -
        625  using channel_t = typename mp11::mp_if
        -
        626  <
        -
        627  std::is_same<T, use_default>,
        - -
        629  T
        -
        630  >::type;
        -
        631 
        -
        632  using layout_t = typename mp11::mp_if
        -
        633  <
        -
        634  std::is_same<L, use_default>,
        -
        635  layout
        -
        636  <
        -
        637  typename color_space_type<Iterator>::type,
        -
        638  typename channel_mapping_type<Iterator>::type
        -
        639  >,
        -
        640  L
        -
        641  >::type;
        -
        642 
        -
        643  static const bool mut = mp11::mp_if
        -
        644  <
        -
        645  std::is_same<IsMutable, use_default>,
        - -
        647  IsMutable
        -
        648  >::value;
        -
        649 
        -
        650  static bool const planar = mp11::mp_if
        -
        651  <
        -
        652  std::is_same<IsPlanar, use_default>,
        -
        653  is_planar<Iterator>,
        -
        654  IsPlanar
        -
        655  >::value;
        -
        656 
        -
        657  static bool const step = mp11::mp_if
        -
        658  <
        -
        659  std::is_same<IsStep, use_default>,
        - -
        661  IsStep
        -
        662  >::type::value;
        -
        663 
        -
        664 public:
        - -
        666 };
        -
        667 
        -
        671 template <typename View, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename StepX = use_default, typename IsMutable = use_default>
        - -
        673 {
        -
        674  using channel_t = typename mp11::mp_if
        -
        675  <
        -
        676  std::is_same<T, use_default>,
        -
        677  typename channel_type<View>::type,
        -
        678  T
        -
        679  >;
        -
        680 
        -
        681  using layout_t = typename mp11::mp_if
        -
        682  <
        -
        683  std::is_same<L, use_default>,
        -
        684  layout
        -
        685  <
        -
        686  typename color_space_type<View>::type,
        -
        687  typename channel_mapping_type<View>::type
        -
        688  >,
        -
        689  L
        -
        690  >;
        -
        691 
        -
        692  static bool const mut = mp11::mp_if
        -
        693  <
        -
        694  std::is_same<IsMutable, use_default>,
        - -
        696  IsMutable
        -
        697  >::value;
        -
        698 
        -
        699  static bool const planar = mp11::mp_if
        -
        700  <
        -
        701  std::is_same<IsPlanar, use_default>,
        -
        702  is_planar<View>,
        -
        703  IsPlanar
        -
        704  >::value;
        -
        705 
        -
        706  static bool const step = mp11::mp_if
        -
        707  <
        -
        708  std::is_same<StepX, use_default>,
        - -
        710  StepX
        -
        711  >::value;
        -
        712 
        -
        713 public:
        -
        714  using type = typename view_type<channel_t, layout_t, planar, step, mut>::type;
        -
        715 };
        -
        716 
        -
        720 template <typename Image, typename T = use_default, typename L = use_default, typename IsPlanar = use_default>
        - -
        722 {
        -
        723  using channel_t = typename mp11::mp_if
        -
        724  <
        -
        725  std::is_same<T, use_default>,
        -
        726  typename channel_type<Image>::type,
        -
        727  T
        -
        728  >::type;
        -
        729 
        -
        730  using layout_t = typename mp11::mp_if
        -
        731  <
        -
        732  std::is_same<L, use_default>,
        -
        733  layout
        -
        734  <
        -
        735  typename color_space_type<Image>::type,
        -
        736  typename channel_mapping_type<Image>::type>,
        -
        737  L
        -
        738  >::type;
        -
        739 
        -
        740  static bool const planar = mp11::mp_if
        -
        741  <
        -
        742  std::is_same<IsPlanar, use_default>,
        -
        743  is_planar<Image>,
        -
        744  IsPlanar
        -
        745  >::value;
        -
        746 
        -
        747 public:
        -
        748  using type = typename image_type<channel_t, layout_t, planar>::type;
        -
        749 };
        -
        750 
        -
        751 }} // namespace boost::gil
        -
        752 
        -
        753 #endif
        +
        561 
        +
        565 template
        +
        566 <
        +
        567  typename Ref,
        +
        568  typename T = use_default,
        +
        569  typename L = use_default,
        +
        570  typename IsPlanar = use_default,
        +
        571  typename IsMutable = use_default>
        + +
        573 {
        +
        574  using pixel_t = typename std::remove_reference<Ref>::type;
        +
        575 
        +
        576  using channel_t = typename mp11::mp_if
        +
        577  <
        +
        578  std::is_same<T, use_default>,
        + +
        580  T
        +
        581  >::type;
        +
        582 
        +
        583  using layout_t = typename mp11::mp_if
        +
        584  <
        +
        585  std::is_same<L, use_default>,
        +
        586  layout
        +
        587  <
        +
        588  typename color_space_type<pixel_t>::type,
        +
        589  typename channel_mapping_type<pixel_t>::type
        +
        590  >,
        +
        591  L
        +
        592  >::type;
        +
        593 
        +
        594  static bool const mut = mp11::mp_if
        +
        595  <
        +
        596  std::is_same<IsMutable, use_default>,
        + +
        598  IsMutable
        +
        599  >::value;
        +
        600 
        +
        601  static bool const planar = mp11::mp_if
        +
        602  <
        +
        603  std::is_same<IsPlanar, use_default>,
        +
        604  is_planar<pixel_t>,
        +
        605  IsPlanar
        +
        606  >::value;
        +
        607 
        +
        608 public:
        + +
        610 };
        +
        611 
        +
        615 template
        +
        616 <
        +
        617  typename Iterator,
        +
        618  typename T = use_default,
        +
        619  typename L = use_default,
        +
        620  typename IsPlanar = use_default,
        +
        621  typename IsStep = use_default,
        +
        622  typename IsMutable = use_default
        +
        623 >
        + +
        625 {
        +
        626  using channel_t = typename mp11::mp_if
        +
        627  <
        +
        628  std::is_same<T, use_default>,
        + +
        630  T
        +
        631  >::type;
        +
        632 
        +
        633  using layout_t = typename mp11::mp_if
        +
        634  <
        +
        635  std::is_same<L, use_default>,
        +
        636  layout
        +
        637  <
        +
        638  typename color_space_type<Iterator>::type,
        +
        639  typename channel_mapping_type<Iterator>::type
        +
        640  >,
        +
        641  L
        +
        642  >::type;
        +
        643 
        +
        644  static const bool mut = mp11::mp_if
        +
        645  <
        +
        646  std::is_same<IsMutable, use_default>,
        + +
        648  IsMutable
        +
        649  >::value;
        +
        650 
        +
        651  static bool const planar = mp11::mp_if
        +
        652  <
        +
        653  std::is_same<IsPlanar, use_default>,
        +
        654  is_planar<Iterator>,
        +
        655  IsPlanar
        +
        656  >::value;
        +
        657 
        +
        658  static bool const step = mp11::mp_if
        +
        659  <
        +
        660  std::is_same<IsStep, use_default>,
        + +
        662  IsStep
        +
        663  >::type::value;
        +
        664 
        +
        665 public:
        + +
        667 };
        +
        668 
        +
        672 template <typename View, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename StepX = use_default, typename IsMutable = use_default>
        + +
        674 {
        +
        675  using channel_t = typename mp11::mp_if
        +
        676  <
        +
        677  std::is_same<T, use_default>,
        +
        678  typename channel_type<View>::type,
        +
        679  T
        +
        680  >;
        +
        681 
        +
        682  using layout_t = typename mp11::mp_if
        +
        683  <
        +
        684  std::is_same<L, use_default>,
        +
        685  layout
        +
        686  <
        +
        687  typename color_space_type<View>::type,
        +
        688  typename channel_mapping_type<View>::type
        +
        689  >,
        +
        690  L
        +
        691  >;
        +
        692 
        +
        693  static bool const mut = mp11::mp_if
        +
        694  <
        +
        695  std::is_same<IsMutable, use_default>,
        + +
        697  IsMutable
        +
        698  >::value;
        +
        699 
        +
        700  static bool const planar = mp11::mp_if
        +
        701  <
        +
        702  std::is_same<IsPlanar, use_default>,
        +
        703  is_planar<View>,
        +
        704  IsPlanar
        +
        705  >::value;
        +
        706 
        +
        707  static bool const step = mp11::mp_if
        +
        708  <
        +
        709  std::is_same<StepX, use_default>,
        + +
        711  StepX
        +
        712  >::value;
        +
        713 
        +
        714 public:
        +
        715  using type = typename view_type<channel_t, layout_t, planar, step, mut>::type;
        +
        716 };
        +
        717 
        +
        721 template <typename Image, typename T = use_default, typename L = use_default, typename IsPlanar = use_default>
        + +
        723 {
        +
        724  using channel_t = typename mp11::mp_if
        +
        725  <
        +
        726  std::is_same<T, use_default>,
        +
        727  typename channel_type<Image>::type,
        +
        728  T
        +
        729  >::type;
        +
        730 
        +
        731  using layout_t = typename mp11::mp_if
        +
        732  <
        +
        733  std::is_same<L, use_default>,
        +
        734  layout
        +
        735  <
        +
        736  typename color_space_type<Image>::type,
        +
        737  typename channel_mapping_type<Image>::type>,
        +
        738  L
        +
        739  >::type;
        +
        740 
        +
        741  static bool const planar = mp11::mp_if
        +
        742  <
        +
        743  std::is_same<IsPlanar, use_default>,
        +
        744  is_planar<Image>,
        +
        745  IsPlanar
        +
        746  >::value;
        +
        747 
        +
        748 public:
        +
        749  using type = typename image_type<channel_t, layout_t, planar>::type;
        +
        750 };
        +
        751 
        +
        752 }} // namespace boost::gil
        +
        753 
        +
        754 #endif
        -
        Constructs a homogeneous image type from a source image type by changing some of the properties.
        Definition: metafunctions.hpp:721
        -
        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
        -
        Returns the type of a four channel bit-aligned image given the bit size of its channels and its layou...
        Definition: metafunctions.hpp:480
        -
        MEMORY-BASED STEP ITERATOR.
        Definition: algorithm.hpp:36
        -
        Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar ...
        Definition: metafunctions.hpp:537
        -
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition: metafunctions.hpp:35
        -
        Determines if the given view has a horizontal step that could be set dynamically.
        Definition: metafunctions.hpp:193
        -
        Returns the type of a three channel image given its bitfield type, the bit size of its channels and i...
        Definition: metafunctions.hpp:413
        -
        Constructs an image view type from a source view type by changing some of the properties.
        Definition: metafunctions.hpp:672
        -
        Returns the type of a two channel bit-aligned image given the bit size of its channels and its layout...
        Definition: metafunctions.hpp:470
        +
        Constructs a homogeneous image type from a source image type by changing some of the properties.
        Definition: metafunctions.hpp:722
        +
        Returns the type of a view the pixel type, whether it operates on planar data and whether it has a st...
        Definition: metafunctions.hpp:557
        +
        Returns the type of a four channel bit-aligned image given the bit size of its channels and its layou...
        Definition: metafunctions.hpp:481
        +
        MEMORY-BASED STEP ITERATOR.
        Definition: algorithm.hpp:42
        +
        Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar ...
        Definition: metafunctions.hpp:538
        +
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition: metafunctions.hpp:36
        +
        Determines if the given view has a horizontal step that could be set dynamically.
        Definition: metafunctions.hpp:194
        +
        Returns the type of a three channel image given its bitfield type, the bit size of its channels and i...
        Definition: metafunctions.hpp:414
        +
        Constructs an image view type from a source view type by changing some of the properties.
        Definition: metafunctions.hpp:673
        +
        Returns the type of a two channel bit-aligned image given the bit size of its channels and its layout...
        Definition: metafunctions.hpp:471
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition: pixel_iterator.hpp:49
        -
        Determines if the given locator is mutable (i.e. its pixels can be changed)
        Definition: metafunctions.hpp:239
        -
        Determines if the given iterator has a step that could be set dynamically.
        Definition: metafunctions.hpp:148
        -
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:41
        -
        Determines if the given locator has a vertical step that could be set dynamically.
        Definition: metafunctions.hpp:189
        -
        A reference proxy to a planar pixel.
        Definition: metafunctions.hpp:25
        -
        Returns the type of a two channel image given its bitfield type, the bit size of its channels and its...
        Definition: metafunctions.hpp:406
        -
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition: metafunctions.hpp:24
        -
        Returns the type of a pixel iterator given the pixel type, whether it operates on planar data,...
        Definition: metafunctions.hpp:274
        -
        Returns the type of a homogeneous locator given the channel type, layout, whether it operates on plan...
        Definition: metafunctions.hpp:526
        -
        Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned,...
        Definition: metafunctions.hpp:391
        -
        Returns the type of a three channel bit-aligned image given the bit size of its channels and its layo...
        Definition: metafunctions.hpp:475
        +
        Determines if the given locator is mutable (i.e. its pixels can be changed)
        Definition: metafunctions.hpp:240
        +
        Determines if the given iterator has a step that could be set dynamically.
        Definition: metafunctions.hpp:149
        +
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:42
        +
        Determines if the given locator has a vertical step that could be set dynamically.
        Definition: metafunctions.hpp:190
        +
        A reference proxy to a planar pixel.
        Definition: metafunctions.hpp:26
        +
        Returns the type of a two channel image given its bitfield type, the bit size of its channels and its...
        Definition: metafunctions.hpp:407
        +
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition: metafunctions.hpp:25
        +
        Returns the type of a pixel iterator given the pixel type, whether it operates on planar data,...
        Definition: metafunctions.hpp:275
        +
        Returns the type of a homogeneous locator given the channel type, layout, whether it operates on plan...
        Definition: metafunctions.hpp:527
        +
        Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned,...
        Definition: metafunctions.hpp:392
        +
        Returns the type of a three channel bit-aligned image given the bit size of its channels and its layo...
        Definition: metafunctions.hpp:476
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:266
        -
        Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on pla...
        Definition: metafunctions.hpp:289
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: metafunctions.hpp:23
        -
        Determines if the given locator has a horizontal step that could be set dynamically.
        Definition: metafunctions.hpp:185
        -
        Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
        Definition: metafunctions.hpp:266
        -
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition: metafunctions.hpp:34
        -
        Determines if the given pixel reference is mutable (i.e. its channels can be changed)
        Definition: metafunctions.hpp:228
        -
        Returns the type of a five channel image given its bitfield type, the bit size of its channels and it...
        Definition: metafunctions.hpp:427
        -
        Basic views must be over basic locators.
        Definition: metafunctions.hpp:129
        +
        Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on pla...
        Definition: metafunctions.hpp:290
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: metafunctions.hpp:24
        +
        Determines if the given locator has a horizontal step that could be set dynamically.
        Definition: metafunctions.hpp:186
        +
        Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
        Definition: metafunctions.hpp:267
        +
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition: metafunctions.hpp:35
        +
        Determines if the given pixel reference is mutable (i.e. its channels can be changed)
        Definition: metafunctions.hpp:229
        +
        Returns the type of a five channel image given its bitfield type, the bit size of its channels and it...
        Definition: metafunctions.hpp:428
        +
        Basic views must be over basic locators.
        Definition: metafunctions.hpp:130
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition: image_view.hpp:53
        -
        Basic images must use basic views and std::allocator.
        Definition: metafunctions.hpp:137
        -
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:301
        -
        Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved)...
        Definition: metafunctions.hpp:57
        -
        Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layo...
        Definition: metafunctions.hpp:366
        -
        Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layo...
        Definition: metafunctions.hpp:465
        -
        Determines if the given view has a vertical step that could be set dynamically.
        Definition: metafunctions.hpp:197
        -
        Determines if a given pixel iterator is basic Basic iterators must use gil::pixel (if interleaved),...
        Definition: metafunctions.hpp:75
        -
        Returns the type of a four channel image given its bitfield type, the bit size of its channels and it...
        Definition: metafunctions.hpp:420
        -
        Returns the type of a packed image whose pixels may not be byte aligned. For example,...
        Definition: metafunctions.hpp:443
        -
        Determines whether the given pixel reference is a proxy class or a native C++ reference.
        Definition: metafunctions.hpp:202
        -
        Returns the type of a homogeneous pixel given the channel type and layout.
        Definition: metafunctions.hpp:491
        -
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition: metafunctions.hpp:216
        -
        Returns the type of a five channel bit-aligned image given the bit size of its channels and its layou...
        Definition: metafunctions.hpp:485
        -
        Constructs a pixel reference type from a source pixel reference type by changing some of the properti...
        Definition: metafunctions.hpp:571
        -
        Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and ...
        Definition: metafunctions.hpp:117
        -
        Returns the type of a homogeneous image given the channel type, layout, and whether it operates on pl...
        Definition: metafunctions.hpp:548
        +
        Basic images must use basic views and std::allocator.
        Definition: metafunctions.hpp:138
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:302
        +
        Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved)...
        Definition: metafunctions.hpp:58
        +
        Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layo...
        Definition: metafunctions.hpp:367
        +
        Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layo...
        Definition: metafunctions.hpp:466
        +
        Determines if the given view has a vertical step that could be set dynamically.
        Definition: metafunctions.hpp:198
        +
        Determines if a given pixel iterator is basic Basic iterators must use gil::pixel (if interleaved),...
        Definition: metafunctions.hpp:76
        +
        Returns the type of a four channel image given its bitfield type, the bit size of its channels and it...
        Definition: metafunctions.hpp:421
        +
        Returns the type of a packed image whose pixels may not be byte aligned. For example,...
        Definition: metafunctions.hpp:444
        +
        Determines whether the given pixel reference is a proxy class or a native C++ reference.
        Definition: metafunctions.hpp:203
        +
        Returns the type of a homogeneous pixel given the channel type and layout.
        Definition: metafunctions.hpp:492
        +
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition: metafunctions.hpp:217
        +
        Returns the type of a five channel bit-aligned image given the bit size of its channels and its layou...
        Definition: metafunctions.hpp:486
        +
        Constructs a pixel reference type from a source pixel reference type by changing some of the properti...
        Definition: metafunctions.hpp:572
        +
        Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and ...
        Definition: metafunctions.hpp:118
        +
        Returns the type of a homogeneous image given the channel type, layout, and whether it operates on pl...
        Definition: metafunctions.hpp:549
        Definition: color_convert.hpp:31
        -
        Returns the type of a single-channel image given its bitfield type, the bit size of its channel and i...
        Definition: metafunctions.hpp:399
        -
        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
        Definition: algorithm.hpp:38
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: algorithm.hpp:34
        -
        Determines if the given view is mutable (i.e. its pixels can be changed)
        Definition: metafunctions.hpp:242
        -
        Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties...
        Definition: metafunctions.hpp:623
        +
        Returns the type of a single-channel image given its bitfield type, the bit size of its channel and i...
        Definition: metafunctions.hpp:400
        +
        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
        Definition: algorithm.hpp:44
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: algorithm.hpp:40
        +
        Determines if the given view is mutable (i.e. its pixels can be changed)
        Definition: metafunctions.hpp:243
        +
        Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties...
        Definition: metafunctions.hpp:624
        diff --git a/develop/doc/html/reference/morphology_8hpp_source.html b/develop/doc/html/reference/morphology_8hpp_source.html index b93a21001..59a108d35 100644 --- a/develop/doc/html/reference/morphology_8hpp_source.html +++ b/develop/doc/html/reference/morphology_8hpp_source.html @@ -57,194 +57,195 @@ $(function() {
        8 
        9 #ifndef BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        10 #define BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        -
        11 #include <boost/gil/extension/numeric/kernel.hpp>
        -
        12 #include <boost/gil/gray.hpp>
        -
        13 #include <boost/gil/image_processing/threshold.hpp>
        -
        14 
        -
        15 namespace boost
        -
        16 {
        -
        17 namespace gil
        -
        18 {
        -
        19 namespace detail
        -
        20 {
        -
        21 enum class morphological_operation
        -
        22 {
        -
        23  dilation,
        -
        24  erosion,
        -
        25 };
        -
        28 
        -
        41 template <typename SrcView, typename DstView, typename Kernel>
        -
        42 void morph_impl(SrcView const& src_view, DstView const& dst_view, Kernel const& kernel,
        -
        43  morphological_operation identifier)
        -
        44 {
        -
        45  std::ptrdiff_t flip_ker_row, flip_ker_col, row_boundary, col_boundary;
        - -
        47  for (std::ptrdiff_t view_row = 0; view_row < src_view.height(); ++view_row)
        -
        48  {
        -
        49  for (std::ptrdiff_t view_col = 0; view_col < src_view.width(); ++view_col)
        -
        50  {
        -
        51  target_element = src_view(view_col, view_row);
        -
        52  for (std::size_t kernel_row = 0; kernel_row < kernel.size(); ++kernel_row)
        -
        53  {
        -
        54  flip_ker_row = kernel.size() - 1 - kernel_row; // row index of flipped kernel
        -
        55 
        -
        56  for (std::size_t kernel_col = 0; kernel_col < kernel.size(); ++kernel_col)
        -
        57  {
        -
        58  flip_ker_col = kernel.size() - 1 - kernel_col; // column index of flipped kernel
        -
        59 
        -
        60  // We ensure that we consider only those pixels which are overlapped
        -
        61  // on a non-zero kernel_element as
        -
        62  if (kernel.at(flip_ker_row, flip_ker_col) == 0)
        -
        63  {
        -
        64  continue;
        -
        65  }
        -
        66  // index of input signal, used for checking boundary
        -
        67  row_boundary = view_row + (kernel.center_y() - flip_ker_row);
        -
        68  col_boundary = view_col + (kernel.center_x() - flip_ker_col);
        -
        69 
        -
        70  // ignore input samples which are out of bound
        -
        71  if (row_boundary >= 0 && row_boundary < src_view.height() &&
        -
        72  col_boundary >= 0 && col_boundary < src_view.width())
        -
        73  {
        -
        74 
        -
        75  if (identifier == morphological_operation::dilation)
        -
        76  {
        -
        77  target_element =
        -
        78  (std::max)(src_view(col_boundary, row_boundary)[0], target_element);
        -
        79  }
        -
        80  else if (identifier == morphological_operation::erosion)
        -
        81  {
        -
        82  target_element =
        -
        83  (std::min)(src_view(col_boundary, row_boundary)[0], target_element);
        -
        84  }
        -
        85  }
        -
        86  }
        -
        87  }
        -
        88  dst_view(view_col, view_row) = target_element;
        -
        89  }
        -
        90  }
        -
        91 }
        -
        92 
        -
        104 template <typename SrcView, typename DstView, typename Kernel>
        -
        105 void morph(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat,
        -
        106  morphological_operation identifier)
        -
        107 {
        -
        108  BOOST_ASSERT(ker_mat.size() != 0 && src_view.dimensions() == dst_view.dimensions());
        -
        109  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        110  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        111 
        -
        112  gil_function_requires<ColorSpacesCompatibleConcept<typename color_space_type<SrcView>::type,
        -
        113  typename color_space_type<DstView>::type>>();
        -
        114 
        -
        115  gil::image<typename DstView::value_type> intermediate_img(src_view.dimensions());
        -
        116 
        -
        117  for (std::size_t i = 0; i < src_view.num_channels(); i++)
        -
        118  {
        -
        119  morph_impl(nth_channel_view(src_view, i), nth_channel_view(view(intermediate_img), i),
        -
        120  ker_mat, identifier);
        -
        121  }
        -
        122  copy_pixels(view(intermediate_img), dst_view);
        -
        123 }
        -
        124 
        -
        133 template <typename SrcView, typename DiffView>
        -
        134 void difference_impl(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        -
        135 {
        -
        136  for (std::ptrdiff_t view_row = 0; view_row < src_view1.height(); ++view_row)
        -
        137  for (std::ptrdiff_t view_col = 0; view_col < src_view1.width(); ++view_col)
        -
        138  diff_view(view_col, view_row) =
        -
        139  src_view1(view_col, view_row) - src_view2(view_col, view_row);
        -
        140 }
        -
        141 
        -
        149 template <typename SrcView, typename DiffView>
        -
        150 void difference(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        -
        151 {
        -
        152  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        153  gil_function_requires<MutableImageViewConcept<DiffView>>();
        -
        154 
        -
        155  gil_function_requires<ColorSpacesCompatibleConcept<
        -
        156  typename color_space_type<SrcView>::type, typename color_space_type<DiffView>::type>>();
        -
        157 
        -
        158  for (std::size_t i = 0; i < src_view1.num_channels(); i++)
        -
        159  {
        -
        160  difference_impl(nth_channel_view(src_view1, i), nth_channel_view(src_view2, i),
        -
        161  nth_channel_view(diff_view, i));
        -
        162  }
        -
        163 }
        -
        164 } // namespace detail
        -
        165 
        -
        178 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        179 void dilate(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        -
        180  int iterations)
        -
        181 {
        -
        182  copy_pixels(src_view, int_op_view);
        -
        183  for (int i = 0; i < iterations; ++i)
        -
        184  morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::dilation);
        -
        185 }
        -
        186 
        -
        199 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        200 void erode(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        -
        201  int iterations)
        -
        202 {
        -
        203  copy_pixels(src_view, int_op_view);
        -
        204  for (int i = 0; i < iterations; ++i)
        -
        205  morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::erosion);
        -
        206 }
        -
        207 
        -
        217 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        218 void opening(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        -
        219 {
        -
        220  erode(src_view, int_op_view, ker_mat, 1);
        -
        221  dilate(int_op_view, int_op_view, ker_mat, 1);
        -
        222 }
        -
        223 
        -
        234 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        235 void closing(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        -
        236 {
        -
        237  dilate(src_view, int_op_view, ker_mat, 1);
        -
        238  erode(int_op_view, int_op_view, ker_mat, 1);
        -
        239 }
        -
        240 
        -
        252 template <typename SrcView, typename DstView, typename Kernel>
        -
        253 void morphological_gradient(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        -
        254 {
        -
        255  using namespace boost::gil;
        -
        256  gil::image<typename DstView::value_type> int_dilate(src_view.dimensions()),
        -
        257  int_erode(src_view.dimensions());
        -
        258  dilate(src_view, view(int_dilate), ker_mat, 1);
        -
        259  erode(src_view, view(int_erode), ker_mat, 1);
        -
        260  difference(view(int_dilate), view(int_erode), dst_view);
        -
        261 }
        -
        262 
        -
        272 template <typename SrcView, typename DstView, typename Kernel>
        -
        273 void top_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        -
        274 {
        -
        275  using namespace boost::gil;
        -
        276  gil::image<typename DstView::value_type> int_opening(src_view.dimensions());
        -
        277  opening(src_view, view(int_opening), ker_mat);
        -
        278  difference(src_view, view(int_opening), dst_view);
        -
        279 }
        -
        280 
        -
        290 template <typename SrcView, typename DstView, typename Kernel>
        -
        291 void black_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        -
        292 {
        -
        293  using namespace boost::gil;
        -
        294  gil::image<typename DstView::value_type> int_closing(src_view.dimensions());
        -
        295  closing(src_view, view(int_closing), ker_mat);
        -
        296  difference(view(int_closing), src_view, dst_view);
        -
        297 }
        -
        299 }} // namespace boost::gil
        -
        300 #endif // BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        +
        11 
        +
        12 #include <boost/gil/image_processing/kernel.hpp>
        +
        13 #include <boost/gil/gray.hpp>
        +
        14 #include <boost/gil/image_processing/threshold.hpp>
        +
        15 
        +
        16 namespace boost
        +
        17 {
        +
        18 namespace gil
        +
        19 {
        +
        20 namespace detail
        +
        21 {
        +
        22 enum class morphological_operation
        +
        23 {
        +
        24  dilation,
        +
        25  erosion,
        +
        26 };
        +
        29 
        +
        42 template <typename SrcView, typename DstView, typename Kernel>
        +
        43 void morph_impl(SrcView const& src_view, DstView const& dst_view, Kernel const& kernel,
        +
        44  morphological_operation identifier)
        +
        45 {
        +
        46  std::ptrdiff_t flip_ker_row, flip_ker_col, row_boundary, col_boundary;
        + +
        48  for (std::ptrdiff_t view_row = 0; view_row < src_view.height(); ++view_row)
        +
        49  {
        +
        50  for (std::ptrdiff_t view_col = 0; view_col < src_view.width(); ++view_col)
        +
        51  {
        +
        52  target_element = src_view(view_col, view_row);
        +
        53  for (std::size_t kernel_row = 0; kernel_row < kernel.size(); ++kernel_row)
        +
        54  {
        +
        55  flip_ker_row = kernel.size() - 1 - kernel_row; // row index of flipped kernel
        +
        56 
        +
        57  for (std::size_t kernel_col = 0; kernel_col < kernel.size(); ++kernel_col)
        +
        58  {
        +
        59  flip_ker_col = kernel.size() - 1 - kernel_col; // column index of flipped kernel
        +
        60 
        +
        61  // We ensure that we consider only those pixels which are overlapped
        +
        62  // on a non-zero kernel_element as
        +
        63  if (kernel.at(flip_ker_row, flip_ker_col) == 0)
        +
        64  {
        +
        65  continue;
        +
        66  }
        +
        67  // index of input signal, used for checking boundary
        +
        68  row_boundary = view_row + (kernel.center_y() - flip_ker_row);
        +
        69  col_boundary = view_col + (kernel.center_x() - flip_ker_col);
        +
        70 
        +
        71  // ignore input samples which are out of bound
        +
        72  if (row_boundary >= 0 && row_boundary < src_view.height() &&
        +
        73  col_boundary >= 0 && col_boundary < src_view.width())
        +
        74  {
        +
        75 
        +
        76  if (identifier == morphological_operation::dilation)
        +
        77  {
        +
        78  target_element =
        +
        79  (std::max)(src_view(col_boundary, row_boundary)[0], target_element);
        +
        80  }
        +
        81  else if (identifier == morphological_operation::erosion)
        +
        82  {
        +
        83  target_element =
        +
        84  (std::min)(src_view(col_boundary, row_boundary)[0], target_element);
        +
        85  }
        +
        86  }
        +
        87  }
        +
        88  }
        +
        89  dst_view(view_col, view_row) = target_element;
        +
        90  }
        +
        91  }
        +
        92 }
        +
        93 
        +
        105 template <typename SrcView, typename DstView, typename Kernel>
        +
        106 void morph(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat,
        +
        107  morphological_operation identifier)
        +
        108 {
        +
        109  BOOST_ASSERT(ker_mat.size() != 0 && src_view.dimensions() == dst_view.dimensions());
        +
        110  gil_function_requires<ImageViewConcept<SrcView>>();
        +
        111  gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        112 
        +
        113  gil_function_requires<ColorSpacesCompatibleConcept<typename color_space_type<SrcView>::type,
        +
        114  typename color_space_type<DstView>::type>>();
        +
        115 
        +
        116  gil::image<typename DstView::value_type> intermediate_img(src_view.dimensions());
        +
        117 
        +
        118  for (std::size_t i = 0; i < src_view.num_channels(); i++)
        +
        119  {
        +
        120  morph_impl(nth_channel_view(src_view, i), nth_channel_view(view(intermediate_img), i),
        +
        121  ker_mat, identifier);
        +
        122  }
        +
        123  copy_pixels(view(intermediate_img), dst_view);
        +
        124 }
        +
        125 
        +
        134 template <typename SrcView, typename DiffView>
        +
        135 void difference_impl(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        +
        136 {
        +
        137  for (std::ptrdiff_t view_row = 0; view_row < src_view1.height(); ++view_row)
        +
        138  for (std::ptrdiff_t view_col = 0; view_col < src_view1.width(); ++view_col)
        +
        139  diff_view(view_col, view_row) =
        +
        140  src_view1(view_col, view_row) - src_view2(view_col, view_row);
        +
        141 }
        +
        142 
        +
        150 template <typename SrcView, typename DiffView>
        +
        151 void difference(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        +
        152 {
        +
        153  gil_function_requires<ImageViewConcept<SrcView>>();
        +
        154  gil_function_requires<MutableImageViewConcept<DiffView>>();
        +
        155 
        +
        156  gil_function_requires<ColorSpacesCompatibleConcept<
        +
        157  typename color_space_type<SrcView>::type, typename color_space_type<DiffView>::type>>();
        +
        158 
        +
        159  for (std::size_t i = 0; i < src_view1.num_channels(); i++)
        +
        160  {
        +
        161  difference_impl(nth_channel_view(src_view1, i), nth_channel_view(src_view2, i),
        +
        162  nth_channel_view(diff_view, i));
        +
        163  }
        +
        164 }
        +
        165 } // namespace detail
        +
        166 
        +
        179 template <typename SrcView, typename IntOpView, typename Kernel>
        +
        180 void dilate(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        +
        181  int iterations)
        +
        182 {
        +
        183  copy_pixels(src_view, int_op_view);
        +
        184  for (int i = 0; i < iterations; ++i)
        +
        185  morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::dilation);
        +
        186 }
        +
        187 
        +
        200 template <typename SrcView, typename IntOpView, typename Kernel>
        +
        201 void erode(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        +
        202  int iterations)
        +
        203 {
        +
        204  copy_pixels(src_view, int_op_view);
        +
        205  for (int i = 0; i < iterations; ++i)
        +
        206  morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::erosion);
        +
        207 }
        +
        208 
        +
        218 template <typename SrcView, typename IntOpView, typename Kernel>
        +
        219 void opening(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        +
        220 {
        +
        221  erode(src_view, int_op_view, ker_mat, 1);
        +
        222  dilate(int_op_view, int_op_view, ker_mat, 1);
        +
        223 }
        +
        224 
        +
        235 template <typename SrcView, typename IntOpView, typename Kernel>
        +
        236 void closing(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        +
        237 {
        +
        238  dilate(src_view, int_op_view, ker_mat, 1);
        +
        239  erode(int_op_view, int_op_view, ker_mat, 1);
        +
        240 }
        +
        241 
        +
        253 template <typename SrcView, typename DstView, typename Kernel>
        +
        254 void morphological_gradient(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        +
        255 {
        +
        256  using namespace boost::gil;
        +
        257  gil::image<typename DstView::value_type> int_dilate(src_view.dimensions()),
        +
        258  int_erode(src_view.dimensions());
        +
        259  dilate(src_view, view(int_dilate), ker_mat, 1);
        +
        260  erode(src_view, view(int_erode), ker_mat, 1);
        +
        261  difference(view(int_dilate), view(int_erode), dst_view);
        +
        262 }
        +
        263 
        +
        273 template <typename SrcView, typename DstView, typename Kernel>
        +
        274 void top_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        +
        275 {
        +
        276  using namespace boost::gil;
        +
        277  gil::image<typename DstView::value_type> int_opening(src_view.dimensions());
        +
        278  opening(src_view, view(int_opening), ker_mat);
        +
        279  difference(src_view, view(int_opening), dst_view);
        +
        280 }
        +
        281 
        +
        291 template <typename SrcView, typename DstView, typename Kernel>
        +
        292 void black_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        +
        293 {
        +
        294  using namespace boost::gil;
        +
        295  gil::image<typename DstView::value_type> int_closing(src_view.dimensions());
        +
        296  closing(src_view, view(int_closing), ker_mat);
        +
        297  difference(view(int_closing), src_view, dst_view);
        +
        298 }
        +
        300 }} // namespace boost::gil
        +
        301 #endif // BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        -
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:41
        -
        void difference(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Passes parameter values to the function 'difference_impl' alongwith individual channel views of input...
        Definition: morphology.hpp:150
        -
        void morph(SrcView const &src_view, DstView const &dst_view, Kernel const &ker_mat, morphological_operation identifier)
        Checks feasibility of the desired operation and passes parameter values to the function morph_impl al...
        Definition: morphology.hpp:105
        +
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:42
        +
        void difference(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Passes parameter values to the function 'difference_impl' alongwith individual channel views of input...
        Definition: morphology.hpp:151
        +
        void morph(SrcView const &src_view, DstView const &dst_view, Kernel const &ker_mat, morphological_operation identifier)
        Checks feasibility of the desired operation and passes parameter values to the function morph_impl al...
        Definition: morphology.hpp:106
        nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
        Definition: image_view_factory.hpp:418
        Two color spaces are compatible if they are the same.
        Definition: color.hpp:60
        -
        void morph_impl(SrcView const &src_view, DstView const &dst_view, Kernel const &kernel, morphological_operation identifier)
        Implements morphological operations at pixel level.This function compares neighbouring pixel values a...
        Definition: morphology.hpp:42
        -
        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
        +
        void morph_impl(SrcView const &src_view, DstView const &dst_view, Kernel const &kernel, morphological_operation identifier)
        Implements morphological operations at pixel level.This function compares neighbouring pixel values a...
        Definition: morphology.hpp:43
        +
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition: algorithm.hpp:288
        +
        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:549
        Definition: color_convert.hpp:31
        -
        void difference_impl(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Calculates the difference between pixel values of first image_view and second image_view.
        Definition: morphology.hpp:134
        +
        void difference_impl(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Calculates the difference between pixel values of first image_view and second image_view.
        Definition: morphology.hpp:135
        diff --git a/develop/doc/html/reference/numeric_8hpp_source.html b/develop/doc/html/reference/numeric_8hpp_source.html index 84f4af22e..4da852b42 100644 --- a/develop/doc/html/reference/numeric_8hpp_source.html +++ b/develop/doc/html/reference/numeric_8hpp_source.html @@ -49,245 +49,247 @@ $(function() {
        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_NUMERIC_HPP
        -
        9 #define BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/numeric/kernel.hpp>
        -
        12 #include <boost/gil/extension/numeric/convolve.hpp>
        -
        13 #include <boost/gil/image_view.hpp>
        -
        14 #include <boost/gil/typedefs.hpp>
        -
        15 #include <boost/gil/detail/math.hpp>
        -
        16 // fixes ambigious call to std::abs, https://stackoverflow.com/a/30084734/4593721
        -
        17 #include <cstdlib>
        -
        18 #include <cmath>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        33 inline double normalized_sinc(double x)
        -
        34 {
        -
        35  return std::sin(x * boost::gil::detail::pi) / (x * boost::gil::detail::pi);
        -
        36 }
        -
        37 
        -
        45 inline double lanczos(double x, std::ptrdiff_t a)
        -
        46 {
        -
        47  // means == but <= avoids compiler warning
        -
        48  if (0 <= x && x <= 0)
        -
        49  return 1;
        -
        50 
        -
        51  if (static_cast<double>(-a) < x && x < static_cast<double>(a))
        -
        52  return normalized_sinc(x) / normalized_sinc(x / static_cast<double>(a));
        -
        53 
        -
        54  return 0;
        -
        55 }
        -
        56 
        -
        57 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        58 #pragma warning(push)
        -
        59 #pragma warning(disable:4244) // 'argument': conversion from 'const Channel' to 'BaseChannelValue', possible loss of data
        -
        60 #endif
        -
        61 
        -
        62 inline void compute_tensor_entries(
        -
        63  boost::gil::gray16s_view_t dx,
        -
        64  boost::gil::gray16s_view_t dy,
        -
        65  boost::gil::gray32f_view_t m11,
        -
        66  boost::gil::gray32f_view_t m12_21,
        -
        67  boost::gil::gray32f_view_t m22)
        -
        68 {
        -
        69  for (std::ptrdiff_t y = 0; y < dx.height(); ++y) {
        -
        70  for (std::ptrdiff_t x = 0; x < dx.width(); ++x) {
        -
        71  auto dx_value = dx(x, y);
        -
        72  auto dy_value = dy(x, y);
        -
        73  m11(x, y) = dx_value * dx_value;
        -
        74  m12_21(x, y) = dx_value * dy_value;
        -
        75  m22(x, y) = dy_value * dy_value;
        -
        76  }
        -
        77  }
        -
        78 }
        -
        79 
        -
        80 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        81 #pragma warning(pop)
        -
        82 #endif
        -
        83 
        -
        90 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        91 inline detail::kernel_2d<T, Allocator> generate_normalized_mean(std::size_t side_length)
        -
        92 {
        -
        93  if (side_length % 2 != 1)
        -
        94  throw std::invalid_argument("kernel dimensions should be odd and equal");
        -
        95  const float entry = 1.0f / static_cast<float>(side_length * side_length);
        -
        96 
        -
        97  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        -
        98  for (auto& cell: result) {
        -
        99  cell = entry;
        -
        100  }
        -
        101 
        -
        102  return result;
        -
        103 }
        -
        104 
        -
        109 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        110 inline detail::kernel_2d<T, Allocator> generate_unnormalized_mean(std::size_t side_length)
        -
        111 {
        -
        112  if (side_length % 2 != 1)
        -
        113  throw std::invalid_argument("kernel dimensions should be odd and equal");
        -
        114 
        -
        115  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        -
        116  for (auto& cell: result) {
        -
        117  cell = 1.0f;
        -
        118  }
        -
        119 
        -
        120  return result;
        -
        121 }
        -
        122 
        -
        128 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        129 inline detail::kernel_2d<T, Allocator> generate_gaussian_kernel(std::size_t side_length, double sigma)
        -
        130 {
        -
        131  if (side_length % 2 != 1)
        -
        132  throw std::invalid_argument("kernel dimensions should be odd and equal");
        -
        133 
        +
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4 //
        +
        5 // Use, modification and distribution are subject to the Boost Software License,
        +
        6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        7 // http://www.boost.org/LICENSE_1_0.txt)
        +
        8 //
        +
        9 #ifndef BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
        +
        10 #define BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
        +
        11 
        +
        12 #include <boost/gil/image_processing/kernel.hpp>
        +
        13 #include <boost/gil/image_processing/convolve.hpp>
        +
        14 #include <boost/gil/image_view.hpp>
        +
        15 #include <boost/gil/typedefs.hpp>
        +
        16 #include <boost/gil/detail/math.hpp>
        +
        17 // fixes ambigious call to std::abs, https://stackoverflow.com/a/30084734/4593721
        +
        18 #include <cstdlib>
        +
        19 #include <cmath>
        +
        20 
        +
        21 namespace boost { namespace gil {
        +
        22 
        +
        34 inline double normalized_sinc(double x)
        +
        35 {
        +
        36  return std::sin(x * boost::gil::detail::pi) / (x * boost::gil::detail::pi);
        +
        37 }
        +
        38 
        +
        46 inline double lanczos(double x, std::ptrdiff_t a)
        +
        47 {
        +
        48  // means == but <= avoids compiler warning
        +
        49  if (0 <= x && x <= 0)
        +
        50  return 1;
        +
        51 
        +
        52  if (static_cast<double>(-a) < x && x < static_cast<double>(a))
        +
        53  return normalized_sinc(x) / normalized_sinc(x / static_cast<double>(a));
        +
        54 
        +
        55  return 0;
        +
        56 }
        +
        57 
        +
        58 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        59 #pragma warning(push)
        +
        60 #pragma warning(disable:4244) // 'argument': conversion from 'const Channel' to 'BaseChannelValue', possible loss of data
        +
        61 #endif
        +
        62 
        +
        63 inline void compute_tensor_entries(
        +
        64  boost::gil::gray16s_view_t dx,
        +
        65  boost::gil::gray16s_view_t dy,
        +
        66  boost::gil::gray32f_view_t m11,
        +
        67  boost::gil::gray32f_view_t m12_21,
        +
        68  boost::gil::gray32f_view_t m22)
        +
        69 {
        +
        70  for (std::ptrdiff_t y = 0; y < dx.height(); ++y) {
        +
        71  for (std::ptrdiff_t x = 0; x < dx.width(); ++x) {
        +
        72  auto dx_value = dx(x, y);
        +
        73  auto dy_value = dy(x, y);
        +
        74  m11(x, y) = dx_value * dx_value;
        +
        75  m12_21(x, y) = dx_value * dy_value;
        +
        76  m22(x, y) = dy_value * dy_value;
        +
        77  }
        +
        78  }
        +
        79 }
        +
        80 
        +
        81 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        82 #pragma warning(pop)
        +
        83 #endif
        +
        84 
        +
        91 template <typename T = float, typename Allocator = std::allocator<T>>
        + +
        93 {
        +
        94  if (side_length % 2 != 1)
        +
        95  throw std::invalid_argument("kernel dimensions should be odd and equal");
        +
        96  const float entry = 1.0f / static_cast<float>(side_length * side_length);
        +
        97 
        +
        98  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        +
        99  for (auto& cell: result) {
        +
        100  cell = entry;
        +
        101  }
        +
        102 
        +
        103  return result;
        +
        104 }
        +
        105 
        +
        110 template <typename T = float, typename Allocator = std::allocator<T>>
        + +
        112 {
        +
        113  if (side_length % 2 != 1)
        +
        114  throw std::invalid_argument("kernel dimensions should be odd and equal");
        +
        115 
        +
        116  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        +
        117  for (auto& cell: result) {
        +
        118  cell = 1.0f;
        +
        119  }
        +
        120 
        +
        121  return result;
        +
        122 }
        +
        123 
        +
        129 template <typename T = float, typename Allocator = std::allocator<T>>
        +
        130 inline detail::kernel_2d<T, Allocator> generate_gaussian_kernel(std::size_t side_length, double sigma)
        +
        131 {
        +
        132  if (side_length % 2 != 1)
        +
        133  throw std::invalid_argument("kernel dimensions should be odd and equal");
        134 
        -
        135  const double denominator = 2 * boost::gil::detail::pi * sigma * sigma;
        -
        136  auto middle = side_length / 2;
        -
        137  std::vector<T, Allocator> values(side_length * side_length);
        -
        138  for (std::size_t y = 0; y < side_length; ++y)
        -
        139  {
        -
        140  for (std::size_t x = 0; x < side_length; ++x)
        -
        141  {
        -
        142  const auto delta_x = middle > x ? middle - x : x - middle;
        -
        143  const auto delta_y = middle > y ? middle - y : y - middle;
        -
        144  const double power = (delta_x * delta_x + delta_y * delta_y) / (2 * sigma * sigma);
        -
        145  const double nominator = std::exp(-power);
        -
        146  const float value = static_cast<float>(nominator / denominator);
        -
        147  values[y * side_length + x] = value;
        -
        148  }
        -
        149  }
        -
        150 
        -
        151  return detail::kernel_2d<T, Allocator>(values.begin(), values.size(), middle, middle);
        -
        152 }
        -
        153 
        -
        161 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        162 inline detail::kernel_2d<T, Allocator> generate_dx_sobel(unsigned int degree = 1)
        -
        163 {
        -
        164  switch (degree)
        -
        165  {
        -
        166  case 0:
        -
        167  {
        -
        168  return detail::get_identity_kernel<T, Allocator>();
        -
        169  }
        -
        170  case 1:
        -
        171  {
        -
        172  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        173  std::copy(detail::dx_sobel.begin(), detail::dx_sobel.end(), result.begin());
        -
        174  return result;
        -
        175  }
        -
        176  default:
        -
        177  throw std::logic_error("not supported yet");
        -
        178  }
        -
        179 
        -
        180  //to not upset compiler
        -
        181  throw std::runtime_error("unreachable statement");
        -
        182 }
        -
        183 
        -
        191 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        192 inline detail::kernel_2d<T, Allocator> generate_dx_scharr(unsigned int degree = 1)
        -
        193 {
        -
        194  switch (degree)
        -
        195  {
        -
        196  case 0:
        -
        197  {
        -
        198  return detail::get_identity_kernel<T, Allocator>();
        -
        199  }
        -
        200  case 1:
        -
        201  {
        -
        202  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        203  std::copy(detail::dx_scharr.begin(), detail::dx_scharr.end(), result.begin());
        -
        204  return result;
        -
        205  }
        -
        206  default:
        -
        207  throw std::logic_error("not supported yet");
        -
        208  }
        -
        209 
        -
        210  //to not upset compiler
        -
        211  throw std::runtime_error("unreachable statement");
        -
        212 }
        -
        213 
        -
        221 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        222 inline detail::kernel_2d<T, Allocator> generate_dy_sobel(unsigned int degree = 1)
        -
        223 {
        -
        224  switch (degree)
        -
        225  {
        -
        226  case 0:
        -
        227  {
        -
        228  return detail::get_identity_kernel<T, Allocator>();
        -
        229  }
        -
        230  case 1:
        -
        231  {
        -
        232  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        233  std::copy(detail::dy_sobel.begin(), detail::dy_sobel.end(), result.begin());
        -
        234  return result;
        -
        235  }
        -
        236  default:
        -
        237  throw std::logic_error("not supported yet");
        -
        238  }
        -
        239 
        -
        240  //to not upset compiler
        -
        241  throw std::runtime_error("unreachable statement");
        -
        242 }
        -
        243 
        -
        251 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        252 inline detail::kernel_2d<T, Allocator> generate_dy_scharr(unsigned int degree = 1)
        -
        253 {
        -
        254  switch (degree)
        -
        255  {
        -
        256  case 0:
        -
        257  {
        -
        258  return detail::get_identity_kernel<T, Allocator>();
        -
        259  }
        -
        260  case 1:
        -
        261  {
        -
        262  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        263  std::copy(detail::dy_scharr.begin(), detail::dy_scharr.end(), result.begin());
        -
        264  return result;
        -
        265  }
        -
        266  default:
        -
        267  throw std::logic_error("not supported yet");
        -
        268  }
        -
        269 
        -
        270  //to not upset compiler
        -
        271  throw std::runtime_error("unreachable statement");
        -
        272 }
        -
        273 
        -
        283 template <typename GradientView, typename OutputView>
        - -
        285  GradientView dx,
        -
        286  GradientView dy,
        -
        287  OutputView ddxx,
        -
        288  OutputView dxdy,
        -
        289  OutputView ddyy)
        -
        290 {
        -
        291  auto sobel_x = generate_dx_sobel();
        -
        292  auto sobel_y = generate_dy_sobel();
        -
        293  detail::convolve_2d(dx, sobel_x, ddxx);
        -
        294  detail::convolve_2d(dx, sobel_y, dxdy);
        -
        295  detail::convolve_2d(dy, sobel_y, ddyy);
        -
        296 }
        -
        297 
        -
        298 }} // namespace boost::gil
        -
        299 
        -
        300 #endif
        +
        135 
        +
        136  const double denominator = 2 * boost::gil::detail::pi * sigma * sigma;
        +
        137  auto middle = side_length / 2;
        +
        138  std::vector<T, Allocator> values(side_length * side_length);
        +
        139  for (std::size_t y = 0; y < side_length; ++y)
        +
        140  {
        +
        141  for (std::size_t x = 0; x < side_length; ++x)
        +
        142  {
        +
        143  const auto delta_x = middle > x ? middle - x : x - middle;
        +
        144  const auto delta_y = middle > y ? middle - y : y - middle;
        +
        145  const double power = (delta_x * delta_x + delta_y * delta_y) / (2 * sigma * sigma);
        +
        146  const double nominator = std::exp(-power);
        +
        147  const float value = static_cast<float>(nominator / denominator);
        +
        148  values[y * side_length + x] = value;
        +
        149  }
        +
        150  }
        +
        151 
        +
        152  return detail::kernel_2d<T, Allocator>(values.begin(), values.size(), middle, middle);
        +
        153 }
        +
        154 
        +
        162 template <typename T = float, typename Allocator = std::allocator<T>>
        +
        163 inline detail::kernel_2d<T, Allocator> generate_dx_sobel(unsigned int degree = 1)
        +
        164 {
        +
        165  switch (degree)
        +
        166  {
        +
        167  case 0:
        +
        168  {
        +
        169  return detail::get_identity_kernel<T, Allocator>();
        +
        170  }
        +
        171  case 1:
        +
        172  {
        +
        173  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        174  std::copy(detail::dx_sobel.begin(), detail::dx_sobel.end(), result.begin());
        +
        175  return result;
        +
        176  }
        +
        177  default:
        +
        178  throw std::logic_error("not supported yet");
        +
        179  }
        +
        180 
        +
        181  //to not upset compiler
        +
        182  throw std::runtime_error("unreachable statement");
        +
        183 }
        +
        184 
        +
        192 template <typename T = float, typename Allocator = std::allocator<T>>
        + +
        194 {
        +
        195  switch (degree)
        +
        196  {
        +
        197  case 0:
        +
        198  {
        +
        199  return detail::get_identity_kernel<T, Allocator>();
        +
        200  }
        +
        201  case 1:
        +
        202  {
        +
        203  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        204  std::copy(detail::dx_scharr.begin(), detail::dx_scharr.end(), result.begin());
        +
        205  return result;
        +
        206  }
        +
        207  default:
        +
        208  throw std::logic_error("not supported yet");
        +
        209  }
        +
        210 
        +
        211  //to not upset compiler
        +
        212  throw std::runtime_error("unreachable statement");
        +
        213 }
        +
        214 
        +
        222 template <typename T = float, typename Allocator = std::allocator<T>>
        +
        223 inline detail::kernel_2d<T, Allocator> generate_dy_sobel(unsigned int degree = 1)
        +
        224 {
        +
        225  switch (degree)
        +
        226  {
        +
        227  case 0:
        +
        228  {
        +
        229  return detail::get_identity_kernel<T, Allocator>();
        +
        230  }
        +
        231  case 1:
        +
        232  {
        +
        233  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        234  std::copy(detail::dy_sobel.begin(), detail::dy_sobel.end(), result.begin());
        +
        235  return result;
        +
        236  }
        +
        237  default:
        +
        238  throw std::logic_error("not supported yet");
        +
        239  }
        +
        240 
        +
        241  //to not upset compiler
        +
        242  throw std::runtime_error("unreachable statement");
        +
        243 }
        +
        244 
        +
        252 template <typename T = float, typename Allocator = std::allocator<T>>
        + +
        254 {
        +
        255  switch (degree)
        +
        256  {
        +
        257  case 0:
        +
        258  {
        +
        259  return detail::get_identity_kernel<T, Allocator>();
        +
        260  }
        +
        261  case 1:
        +
        262  {
        +
        263  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        264  std::copy(detail::dy_scharr.begin(), detail::dy_scharr.end(), result.begin());
        +
        265  return result;
        +
        266  }
        +
        267  default:
        +
        268  throw std::logic_error("not supported yet");
        +
        269  }
        +
        270 
        +
        271  //to not upset compiler
        +
        272  throw std::runtime_error("unreachable statement");
        +
        273 }
        +
        274 
        +
        284 template <typename GradientView, typename OutputView>
        + +
        286  GradientView dx,
        +
        287  GradientView dy,
        +
        288  OutputView ddxx,
        +
        289  OutputView dxdy,
        +
        290  OutputView ddyy)
        +
        291 {
        +
        292  auto sobel_x = generate_dx_sobel();
        +
        293  auto sobel_y = generate_dy_sobel();
        +
        294  detail::convolve_2d(dx, sobel_x, ddxx);
        +
        295  detail::convolve_2d(dx, sobel_y, dxdy);
        +
        296  detail::convolve_2d(dy, sobel_y, ddyy);
        +
        297 }
        +
        298 
        +
        299 }} // namespace boost::gil
        +
        300 
        +
        301 #endif
        -
        detail::kernel_2d< T, Allocator > generate_dy_sobel(unsigned int degree=1)
        Generates Sobel operator in vertical direction.
        Definition: numeric.hpp:222
        -
        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
        -
        detail::kernel_2d< T, Allocator > generate_dx_scharr(unsigned int degree=1)
        Generate Scharr operator in horizontal direction.
        Definition: numeric.hpp:192
        -
        detail::kernel_2d< T, Allocator > generate_unnormalized_mean(std::size_t side_length)
        Generate kernel with all 1s.
        Definition: numeric.hpp:110
        -
        void compute_hessian_entries(GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy)
        Compute xy gradient, and second order x and y gradients.
        Definition: numeric.hpp:284
        -
        detail::kernel_2d< T, Allocator > generate_normalized_mean(std::size_t side_length)
        Generate mean kernel.
        Definition: numeric.hpp:91
        -
        detail::kernel_2d< T, Allocator > generate_gaussian_kernel(std::size_t side_length, double sigma)
        Generate Gaussian kernel.
        Definition: numeric.hpp:129
        -
        detail::kernel_2d< T, Allocator > generate_dx_sobel(unsigned int degree=1)
        Generates Sobel operator in horizontal direction.
        Definition: numeric.hpp:162
        -
        detail::kernel_2d< T, Allocator > generate_dy_scharr(unsigned int degree=1)
        Generate Scharr operator in vertical direction.
        Definition: numeric.hpp:252
        -
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition: numeric.hpp:45
        +
        detail::kernel_2d< T, Allocator > generate_dy_sobel(unsigned int degree=1)
        Generates Sobel operator in vertical direction.
        Definition: numeric.hpp:223
        +
        BOOST_FORCEINLINE auto copy(boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
        Copy when both src and dst are interleaved and of the same type can be just memmove.
        Definition: algorithm.hpp:145
        +
        detail::kernel_2d< T, Allocator > generate_dx_scharr(unsigned int degree=1)
        Generate Scharr operator in horizontal direction.
        Definition: numeric.hpp:193
        +
        detail::kernel_2d< T, Allocator > generate_unnormalized_mean(std::size_t side_length)
        Generate kernel with all 1s.
        Definition: numeric.hpp:111
        +
        void compute_hessian_entries(GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy)
        Compute xy gradient, and second order x and y gradients.
        Definition: numeric.hpp:285
        +
        detail::kernel_2d< T, Allocator > generate_normalized_mean(std::size_t side_length)
        Generate mean kernel.
        Definition: numeric.hpp:92
        +
        detail::kernel_2d< T, Allocator > generate_gaussian_kernel(std::size_t side_length, double sigma)
        Generate Gaussian kernel.
        Definition: numeric.hpp:130
        +
        detail::kernel_2d< T, Allocator > generate_dx_sobel(unsigned int degree=1)
        Generates Sobel operator in horizontal direction.
        Definition: numeric.hpp:163
        +
        variable-size kernel
        Definition: kernel.hpp:272
        +
        detail::kernel_2d< T, Allocator > generate_dy_scharr(unsigned int degree=1)
        Generate Scharr operator in vertical direction.
        Definition: numeric.hpp:253
        +
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition: numeric.hpp:46
        diff --git a/develop/doc/html/reference/pixel__iterator_8hpp_source.html b/develop/doc/html/reference/pixel__iterator_8hpp_source.html index 57ad6b1eb..230eacd6a 100644 --- a/develop/doc/html/reference/pixel__iterator_8hpp_source.html +++ b/develop/doc/html/reference/pixel__iterator_8hpp_source.html @@ -182,7 +182,7 @@ $(function() {
        158 
        159 #endif
        -
        MEMORY-BASED STEP ITERATOR.
        Definition: algorithm.hpp:36
        +
        MEMORY-BASED STEP ITERATOR.
        Definition: algorithm.hpp:42
        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
        Definition: pixel_iterator.hpp:124
        diff --git a/develop/doc/html/reference/pixel__numeric__operations_8hpp_source.html b/develop/doc/html/reference/pixel__numeric__operations_8hpp_source.html new file mode 100644 index 000000000..dca23fc97 --- /dev/null +++ b/develop/doc/html/reference/pixel__numeric__operations_8hpp_source.html @@ -0,0 +1,250 @@ + + + + + + + + + Generic Image Library: pixel_numeric_operations.hpp Source File + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_numeric_operations.hpp
        +
        +
        +
        1 //
        +
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        +
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4 //
        +
        5 // Distributed under the Boost Software License, Version 1.0
        +
        6 // See accompanying file LICENSE_1_0.txt or copy at
        +
        7 // http://www.boost.org/LICENSE_1_0.txt
        +
        8 //
        +
        9 #ifndef BOOST_GIL_PIXEL_NUMERIC_OPERATIONS_HPP
        +
        10 #define BOOST_GIL_PIXEL_NUMERIC_OPERATIONS_HPP
        +
        11 
        +
        12 #include <boost/gil/color_base_algorithm.hpp>
        +
        13 #include <boost/gil/pixel.hpp>
        +
        14 #include <boost/gil/channel_numeric_operations.hpp>
        +
        15 
        +
        16 namespace boost { namespace gil {
        +
        17 
        +
        18 // Function objects and utilities for pixel-wise numeric operations.
        +
        19 //
        +
        20 // List of currently defined functors:
        +
        21 // pixel_plus_t (+)
        +
        22 // pixel_minus_t (-)
        +
        23 // pixel_multiplies_scalar_t (*)
        +
        24 // pixel_divides_scalar_t (/)
        +
        25 // pixel_halves_t (/=2),
        +
        26 // pixel_zeros_t (=0)
        +
        27 // pixel_assigns_t (=)
        +
        28 
        +
        34 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        + +
        36 {
        +
        37  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        38  {
        +
        39  PixelResult result;
        +
        40  static_transform(p1, p2, result,
        + +
        42  <
        + + + +
        46  >());
        +
        47  return result;
        +
        48  }
        +
        49 };
        +
        50 
        +
        56 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        + +
        58 {
        +
        59  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        60  {
        +
        61  PixelResult result;
        +
        62  static_transform(p1, p2, result,
        + +
        64  <
        + + + +
        68  >());
        +
        69  return result;
        +
        70  }
        +
        71 };
        +
        72 
        +
        78 template <typename PixelRef, typename Scalar, typename PixelResult>
        + +
        80 {
        +
        81  auto operator()(PixelRef const& p, Scalar const& s) const -> PixelResult
        +
        82  {
        +
        83  PixelResult result;
        +
        84  static_transform(p, result,
        +
        85  std::bind(
        + +
        87  Scalar,
        + +
        89  std::placeholders::_1, s));
        +
        90  return result;
        +
        91  }
        +
        92 };
        +
        93 
        +
        99 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        + +
        101 {
        +
        102  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        103  {
        +
        104  PixelResult result;
        +
        105  static_transform(p1, p2, result,
        + +
        107  <
        + + + +
        111  >());
        +
        112  return result;
        +
        113  }
        +
        114 };
        +
        115 
        +
        121 template <typename PixelRef, typename Scalar, typename PixelResult>
        + +
        123 {
        +
        124  auto operator()(PixelRef const& p, Scalar const& s) const -> PixelResult
        +
        125  {
        +
        126  PixelResult result;
        +
        127  static_transform(p, result,
        + +
        129  Scalar,
        + +
        131  std::placeholders::_1, s));
        +
        132  return result;
        +
        133  }
        +
        134 };
        +
        135 
        +
        141 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        + +
        143 {
        +
        144  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        145  {
        +
        146  PixelResult result;
        +
        147  static_transform(p1, p2, result,
        + +
        149  <
        + + + +
        153  >());
        +
        154  return result;
        +
        155  }
        +
        156 };
        +
        157 
        +
        161 template <typename PixelRef>
        + +
        163 {
        +
        164  auto operator()(PixelRef& p) const -> PixelRef&
        +
        165  {
        +
        166  static_for_each(p, channel_halves_t<typename channel_type<PixelRef>::type>());
        +
        167  return p;
        +
        168  }
        +
        169 };
        +
        170 
        +
        174 template <typename PixelRef>
        + +
        176 {
        +
        177  auto operator()(PixelRef& p) const -> PixelRef&
        +
        178  {
        +
        179  static_for_each(p, channel_zeros_t<typename channel_type<PixelRef>::type>());
        +
        180  return p;
        +
        181  }
        +
        182 };
        +
        183 
        +
        186 template <typename Pixel>
        +
        187 void zero_channels(Pixel& p)
        +
        188 {
        +
        189  static_for_each(p, channel_zeros_t<typename channel_type<Pixel>::type>());
        +
        190 }
        +
        191 
        +
        200 template <typename PixelRef, typename PixelResult>
        + +
        202 {
        +
        203  auto operator()(PixelRef const& src, PixelResult& dst) const -> PixelResult
        +
        204  {
        +
        205  static_for_each(src, dst,
        + +
        207  <
        + + +
        210  >());
        +
        211  return dst;
        +
        212  }
        +
        213 };
        +
        214 
        +
        215 }} // namespace boost::gil
        +
        216 
        +
        217 #endif
        +
        +
        Sets pixel elements to zero (for whatever zero means)
        Definition: pixel_numeric_operations.hpp:175
        +
        Arithmetic operation of division of two channel values.
        Definition: channel_numeric_operations.hpp:98
        +
        Operation of setting channel value to zero.
        Definition: channel_numeric_operations.hpp:220
        +
        Arithmetic operation of multiplication of two channel values.
        Definition: channel_numeric_operations.hpp:77
        +
        Arithmetic operation of dividing channel value by scalar.
        Definition: channel_numeric_operations.hpp:181
        +
        Performs channel-wise division of pixel elements by scalar.
        Definition: pixel_numeric_operations.hpp:122
        +
        Performs channel-wise multiplication of pixel elements by scalar.
        Definition: pixel_numeric_operations.hpp:79
        +
        Arithmetic operation of dividing channel value by 2.
        Definition: channel_numeric_operations.hpp:202
        +
        Performs channel-wise division by 2.
        Definition: pixel_numeric_operations.hpp:162
        +
        Arithmetic operation of channel value by a scalar.
        Definition: channel_numeric_operations.hpp:160
        +
        Performs channel-wise division of two pixels.
        Definition: pixel_numeric_operations.hpp:142
        +
        Arithmetic operation of subtraction of two channel values.
        Definition: channel_numeric_operations.hpp:56
        +
        Performs channel-wise addition of two pixels.
        Definition: pixel_numeric_operations.hpp:35
        +
        Definition: color_convert.hpp:31
        +
        Definition: channel_numeric_operations.hpp:235
        +
        Performs channel-wise multiplication of two pixels.
        Definition: pixel_numeric_operations.hpp:100
        +
        Casts and assigns a pixel to another.
        Definition: pixel_numeric_operations.hpp:201
        +
        Performs channel-wise subtraction of two pixels.
        Definition: pixel_numeric_operations.hpp:57
        +
        Arithmetic operation of addition of two channel values.
        Definition: channel_numeric_operations.hpp:35
        + + + + + + diff --git a/develop/doc/html/reference/planar__pixel__iterator_8hpp_source.html b/develop/doc/html/reference/planar__pixel__iterator_8hpp_source.html index df5c2ce9f..ba8ddb017 100644 --- a/develop/doc/html/reference/planar__pixel__iterator_8hpp_source.html +++ b/develop/doc/html/reference/planar__pixel__iterator_8hpp_source.html @@ -270,7 +270,7 @@ $(function() {
        reference operator[](difference_type d) const
        Definition: planar_pixel_iterator.hpp:116
        planar_pixel_iterator(P *pix)
        Definition: planar_pixel_iterator.hpp:97
        -
        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 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:1082
        diff --git a/develop/doc/html/reference/planar__pixel__reference_8hpp_source.html b/develop/doc/html/reference/planar__pixel__reference_8hpp_source.html index 952877280..c27159816 100644 --- a/develop/doc/html/reference/planar__pixel__reference_8hpp_source.html +++ b/develop/doc/html/reference/planar__pixel__reference_8hpp_source.html @@ -274,9 +274,9 @@ $(function() {
        262 
        263 #endif
        -
        A reference proxy to a planar pixel.
        Definition: metafunctions.hpp:25
        +
        A reference proxy to a planar pixel.
        Definition: metafunctions.hpp:26
        void swap(const boost::gil::planar_pixel_reference< CR, CS > x, const boost::gil::planar_pixel_reference< CR, CS > y)
        swap for planar_pixel_reference
        Definition: planar_pixel_reference.hpp:257
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: metafunctions.hpp:23
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: metafunctions.hpp:24
        Definition: color_convert.hpp:31
        diff --git a/develop/doc/html/reference/position__iterator_8hpp_source.html b/develop/doc/html/reference/position__iterator_8hpp_source.html index 2e47cd7b4..ebb3d7611 100644 --- a/develop/doc/html/reference/position__iterator_8hpp_source.html +++ b/develop/doc/html/reference/position__iterator_8hpp_source.html @@ -149,7 +149,7 @@ $(function() {
        An iterator that remembers its current X,Y position and invokes a function object with it upon derefe...
        Definition: position_iterator.hpp:31
        reference operator[](difference_type d) const
        Definition: position_iterator.hpp:59
        -
        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 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:1082
        diff --git a/develop/doc/html/reference/read__and__convert__image_8hpp_source.html b/develop/doc/html/reference/read__and__convert__image_8hpp_source.html index ed1ea4658..e40b7aa1f 100644 --- a/develop/doc/html/reference/read__and__convert__image_8hpp_source.html +++ b/develop/doc/html/reference/read__and__convert__image_8hpp_source.html @@ -267,7 +267,7 @@ $(function() {
        269 #endif
        void read_and_convert_image(Reader &reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads and color-converts an image. Image memory is allocated.
        Definition: read_and_convert_image.hpp:32
        -
        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 >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:549
        diff --git a/develop/doc/html/reference/read__and__convert__view_8hpp_source.html b/develop/doc/html/reference/read__and__convert__view_8hpp_source.html index ec13fbee1..428eda042 100644 --- a/develop/doc/html/reference/read__and__convert__view_8hpp_source.html +++ b/develop/doc/html/reference/read__and__convert__view_8hpp_source.html @@ -271,7 +271,7 @@ $(function() {
        273 #endif
        void read_and_convert_view(Reader &reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads and color-converts an image view. No memory is allocated.
        Definition: read_and_convert_view.hpp:32
        -
        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 >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:549
        diff --git a/develop/doc/html/reference/read__image_8hpp_source.html b/develop/doc/html/reference/read__image_8hpp_source.html index 69acbd920..f9d9cd9e4 100644 --- a/develop/doc/html/reference/read__image_8hpp_source.html +++ b/develop/doc/html/reference/read__image_8hpp_source.html @@ -291,7 +291,7 @@ $(function() {
        288 #endif
        Definition: base.hpp:78
        -
        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 >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:549
        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/read__view_8hpp_source.html b/develop/doc/html/reference/read__view_8hpp_source.html index 6a35c9c49..5ae60fe7e 100644 --- a/develop/doc/html/reference/read__view_8hpp_source.html +++ b/develop/doc/html/reference/read__view_8hpp_source.html @@ -198,7 +198,7 @@ $(function() {
        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
        Definition: base.hpp:78
        -
        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 >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:549
        diff --git a/develop/doc/html/reference/reader__base_8hpp_source.html b/develop/doc/html/reference/reader__base_8hpp_source.html index b9fc53186..015c90fdc 100644 --- a/develop/doc/html/reference/reader__base_8hpp_source.html +++ b/develop/doc/html/reference/reader__base_8hpp_source.html @@ -158,7 +158,7 @@ $(function() {
        reader_base()
        Definition: reader_base.hpp:35
        void init_image(Image &img, const image_read_settings< FormatTag > &settings)
        Definition: reader_base.hpp:53
        Definition: reader_base.hpp:28
        -
        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 >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:549
        diff --git a/develop/doc/html/reference/rgb_8hpp_source.html b/develop/doc/html/reference/rgb_8hpp_source.html index 3a24af598..aa97b032d 100644 --- a/develop/doc/html/reference/rgb_8hpp_source.html +++ b/develop/doc/html/reference/rgb_8hpp_source.html @@ -103,10 +103,10 @@ $(function() {
        auto planar_rgb_view(std::size_t width, std::size_t height, IC r, IC g, IC b, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, rgb_t > >::view_t
        from raw RGB planar data
        Definition: rgb.hpp:46
        Blue.
        Definition: rgb.hpp:30
        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
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:302
        Green.
        Definition: rgb.hpp:27
        mp11::mp_list< red_t, green_t, blue_t > rgb_t
        Definition: rgb.hpp:34
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: algorithm.hpp:34
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: algorithm.hpp:40
        Red.
        Definition: rgb.hpp:24
        diff --git a/develop/doc/html/reference/rgba_8hpp_source.html b/develop/doc/html/reference/rgba_8hpp_source.html index a4775254e..936e629eb 100644 --- a/develop/doc/html/reference/rgba_8hpp_source.html +++ b/develop/doc/html/reference/rgba_8hpp_source.html @@ -100,10 +100,10 @@ $(function() {
        auto planar_rgba_view(std::size_t width, std::size_t height, ChannelPtr r, ChannelPtr g, ChannelPtr b, ChannelPtr a, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< ChannelPtr, rgba_t > >::view_t
        from raw RGBA planar data
        Definition: rgba.hpp:43
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:266
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition: image_view.hpp:53
        -
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:301
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:302
        mp11::mp_list< red_t, green_t, blue_t, alpha_t > rgba_t
        Definition: rgba.hpp:25
        Alpha.
        Definition: rgba.hpp:22
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: algorithm.hpp:34
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: algorithm.hpp:40
        diff --git a/develop/doc/html/reference/scaling_8hpp_source.html b/develop/doc/html/reference/scaling_8hpp_source.html index 23a6dda6b..3b014c204 100644 --- a/develop/doc/html/reference/scaling_8hpp_source.html +++ b/develop/doc/html/reference/scaling_8hpp_source.html @@ -137,7 +137,7 @@ $(function() {
        115 #endif
        void scale_lanczos(ImageView input_view, ImageView output_view, std::ptrdiff_t a)
        Complete Lanczos algorithm.
        Definition: scaling.hpp:95
        -
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition: numeric.hpp:45
        +
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition: numeric.hpp:46
        diff --git a/develop/doc/html/reference/scanline__read__iterator_8hpp_source.html b/develop/doc/html/reference/scanline__read__iterator_8hpp_source.html index dd5fdefd1..3bef3ba7d 100644 --- a/develop/doc/html/reference/scanline__read__iterator_8hpp_source.html +++ b/develop/doc/html/reference/scanline__read__iterator_8hpp_source.html @@ -148,7 +148,7 @@ $(function() {
        100 #endif
        Input iterator to read images.
        Definition: scanline_read_iterator.hpp:29
        -
        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 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:1082
        diff --git a/develop/doc/html/reference/step__iterator_8hpp_source.html b/develop/doc/html/reference/step__iterator_8hpp_source.html index 032d6f838..3ed3fd3d0 100644 --- a/develop/doc/html/reference/step__iterator_8hpp_source.html +++ b/develop/doc/html/reference/step__iterator_8hpp_source.html @@ -315,7 +315,7 @@ $(function() {
        321 
        322 #endif
        -
        MEMORY-BASED STEP ITERATOR.
        Definition: algorithm.hpp:36
        +
        MEMORY-BASED STEP ITERATOR.
        Definition: algorithm.hpp:42
        BOOST_FORCEINLINE bool operator!=(const point< T > &p1, const point< T > &p2)
        Definition: point.hpp:137
        function object that returns the memory unit distance between two iterators and advances a given iter...
        Definition: step_iterator.hpp:122
        An adaptor over an existing iterator that changes the step unit.
        Definition: step_iterator.hpp:41
        diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html b/develop/doc/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html index ed8ab6d7c..2d90a061a 100644 --- a/develop/doc/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html +++ b/develop/doc/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html @@ -96,8 +96,8 @@ struct boost::gil::RandomAccessNDImageConcept< Image >
      • concepts/image.hpp
      • -
        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
        +
        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:549
        +
        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:553
        diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t-members.html new file mode 100644 index 000000000..de6e38550 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t-members.html @@ -0,0 +1,66 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_assigns_t< Channel1, Channel2 > Member List
        +
        +
        + +

        This is the complete list of members for channel_assigns_t< Channel1, Channel2 >, including all inherited members.

        + + + + +
        ChannelRef1 typedef (defined in channel_assigns_t< Channel1, Channel2 >)channel_assigns_t< Channel1, Channel2 >
        ChannelRef2 typedef (defined in channel_assigns_t< Channel1, Channel2 >)channel_assigns_t< Channel1, Channel2 >
        operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelRef2channel_assigns_t< Channel1, Channel2 >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t.html new file mode 100644 index 000000000..1d5066a40 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__assigns__t.html @@ -0,0 +1,134 @@ + + + + + + + + + Generic Image Library: channel_assigns_t< Channel1, Channel2 > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_assigns_t< Channel1, Channel2 > Struct Template Reference
        +
        +
        + +

        #include <channel_numeric_operations.hpp>

        + + + + + + +

        +Public Types

        +using ChannelRef1 = typename channel_traits< Channel1 >::const_reference
         
        +using ChannelRef2 = typename channel_traits< Channel2 >::reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelRef2
         
        +

        Detailed Description

        +

        template<typename Channel1, typename Channel2>
        +struct boost::gil::channel_assigns_t< Channel1, Channel2 >

        + +

        structure for assigning one channel to another

        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef1 ch1,
        ChannelRef2 ch2 
        ) const -> ChannelRef2 +
        +
        +inline
        +
        +
        Parameters
        + + + +
        ch1- assignor side (input) of the assignment operation
        ch2- assignee side (output) of the assignment operation
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t-members.html new file mode 100644 index 000000000..08a6f15db --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t-members.html @@ -0,0 +1,65 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_divides_scalar_t< Channel, Scalar, ChannelResult > Member List
        +
        +
        + +

        This is the complete list of members for channel_divides_scalar_t< Channel, Scalar, ChannelResult >, including all inherited members.

        + + + +
        ChannelRef typedef (defined in channel_divides_scalar_t< Channel, Scalar, ChannelResult >)channel_divides_scalar_t< Channel, Scalar, ChannelResult >
        operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResultchannel_divides_scalar_t< Channel, Scalar, ChannelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t.html new file mode 100644 index 000000000..8ae805fe1 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__scalar__t.html @@ -0,0 +1,135 @@ + + + + + + + + + Generic Image Library: channel_divides_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_divides_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of dividing channel value by scalar. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + +

        +Public Types

        +using ChannelRef = typename channel_traits< Channel >::const_reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef channel, Scalar const &scalar) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel, typename Scalar, typename ChannelResult>
        +struct boost::gil::channel_divides_scalar_t< Channel, Scalar, ChannelResult >

        + +

        Arithmetic operation of dividing channel value by scalar.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef channel,
        Scalar const & scalar 
        ) const -> ChannelResult +
        +
        +inline
        +
        +
        Parameters
        + + + +
        channel- dividend operand of the two division operation.
        scalar- divisor operand of the two division operation.
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t-members.html new file mode 100644 index 000000000..22b3d947a --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t-members.html @@ -0,0 +1,66 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_divides_t< Channel1, Channel2, ChannelResult > Member List
        +
        + + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t.html new file mode 100644 index 000000000..0ed36e30c --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__divides__t.html @@ -0,0 +1,138 @@ + + + + + + + + + Generic Image Library: channel_divides_t< Channel1, Channel2, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_divides_t< Channel1, Channel2, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of division of two channel values. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + + + +

        +Public Types

        +using ChannelRef1 = typename channel_traits< Channel1 >::const_reference
         
        +using ChannelRef2 = typename channel_traits< Channel2 >::const_reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel1, typename Channel2, typename ChannelResult>
        +struct boost::gil::channel_divides_t< Channel1, Channel2, ChannelResult >

        + +

        Arithmetic operation of division of two channel values.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef1 ch1,
        ChannelRef2 ch2 
        ) const -> ChannelResult +
        +
        +inline
        +
        +
        Parameters
        + + + +
        ch1- dividend operand of the two division operation.
        ch2- divisor operand of the two division operation.
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t-members.html new file mode 100644 index 000000000..c8e12b65c --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t-members.html @@ -0,0 +1,65 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_halves_t< Channel > Member List
        +
        +
        + +

        This is the complete list of members for channel_halves_t< Channel >, including all inherited members.

        + + + +
        ChannelRef typedef (defined in channel_halves_t< Channel >)channel_halves_t< Channel >
        operator()(ChannelRef channel) const -> ChannelRef (defined in channel_halves_t< Channel >)channel_halves_t< Channel >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t.html new file mode 100644 index 000000000..eb7848c95 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__halves__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: channel_halves_t< Channel > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_halves_t< Channel > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of dividing channel value by 2. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + +

        +Public Types

        +using ChannelRef = typename channel_traits< Channel >::reference
         
        + + + +

        +Public Member Functions

        +auto operator() (ChannelRef channel) const -> ChannelRef
         
        +

        Detailed Description

        +

        template<typename Channel>
        +struct boost::gil::channel_halves_t< Channel >

        + +

        Arithmetic operation of dividing channel value by 2.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t-members.html new file mode 100644 index 000000000..c1ba6b51c --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t-members.html @@ -0,0 +1,65 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_minus_scalar_t< Channel, Scalar, ChannelResult > Member List
        +
        +
        + +

        This is the complete list of members for channel_minus_scalar_t< Channel, Scalar, ChannelResult >, including all inherited members.

        + + + +
        ChannelRef typedef (defined in channel_minus_scalar_t< Channel, Scalar, ChannelResult >)channel_minus_scalar_t< Channel, Scalar, ChannelResult >
        operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResultchannel_minus_scalar_t< Channel, Scalar, ChannelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t.html new file mode 100644 index 000000000..d779f0233 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__scalar__t.html @@ -0,0 +1,135 @@ + + + + + + + + + Generic Image Library: channel_minus_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_minus_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of subtracting scalar from channel value. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + +

        +Public Types

        +using ChannelRef = typename channel_traits< Channel >::const_reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef channel, Scalar const &scalar) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel, typename Scalar, typename ChannelResult>
        +struct boost::gil::channel_minus_scalar_t< Channel, Scalar, ChannelResult >

        + +

        Arithmetic operation of subtracting scalar from channel value.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef channel,
        Scalar const & scalar 
        ) const -> ChannelResult +
        +
        +inline
        +
        +
        Parameters
        + + + +
        channel- minuend operand of the subtraction.
        scalar- subtrahend operand of the subtraction.
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t-members.html new file mode 100644 index 000000000..07e38a180 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t-members.html @@ -0,0 +1,66 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_minus_t< Channel1, Channel2, ChannelResult > Member List
        +
        +
        + +

        This is the complete list of members for channel_minus_t< Channel1, Channel2, ChannelResult >, including all inherited members.

        + + + + +
        ChannelRef1 typedef (defined in channel_minus_t< Channel1, Channel2, ChannelResult >)channel_minus_t< Channel1, Channel2, ChannelResult >
        ChannelRef2 typedef (defined in channel_minus_t< Channel1, Channel2, ChannelResult >)channel_minus_t< Channel1, Channel2, ChannelResult >
        operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResultchannel_minus_t< Channel1, Channel2, ChannelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t.html new file mode 100644 index 000000000..f842e226f --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__minus__t.html @@ -0,0 +1,138 @@ + + + + + + + + + Generic Image Library: channel_minus_t< Channel1, Channel2, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_minus_t< Channel1, Channel2, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of subtraction of two channel values. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + + + +

        +Public Types

        +using ChannelRef1 = typename channel_traits< Channel1 >::const_reference
         
        +using ChannelRef2 = typename channel_traits< Channel2 >::const_reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel1, typename Channel2, typename ChannelResult>
        +struct boost::gil::channel_minus_t< Channel1, Channel2, ChannelResult >

        + +

        Arithmetic operation of subtraction of two channel values.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef1 ch1,
        ChannelRef2 ch2 
        ) const -> ChannelResult +
        +
        +inline
        +
        +
        Parameters
        + + + +
        ch1- minuend operand of the subtraction.
        ch2- subtrahend operand of the subtraction.
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t-members.html new file mode 100644 index 000000000..75b7611ce --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t-members.html @@ -0,0 +1,65 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_multiplies_scalar_t< Channel, Scalar, ChannelResult > Member List
        +
        +
        + +

        This is the complete list of members for channel_multiplies_scalar_t< Channel, Scalar, ChannelResult >, including all inherited members.

        + + + +
        ChannelRef typedef (defined in channel_multiplies_scalar_t< Channel, Scalar, ChannelResult >)channel_multiplies_scalar_t< Channel, Scalar, ChannelResult >
        operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResultchannel_multiplies_scalar_t< Channel, Scalar, ChannelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t.html new file mode 100644 index 000000000..71ce70317 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__scalar__t.html @@ -0,0 +1,135 @@ + + + + + + + + + Generic Image Library: channel_multiplies_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_multiplies_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of channel value by a scalar. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + +

        +Public Types

        +using ChannelRef = typename channel_traits< Channel >::const_reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef channel, Scalar const &scalar) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel, typename Scalar, typename ChannelResult>
        +struct boost::gil::channel_multiplies_scalar_t< Channel, Scalar, ChannelResult >

        + +

        Arithmetic operation of channel value by a scalar.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef channel,
        Scalar const & scalar 
        ) const -> ChannelResult +
        +
        +inline
        +
        +
        Parameters
        + + + +
        channel- first of the two factors (multiplicand).
        scalar- second of the two factors (multiplier).
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t-members.html new file mode 100644 index 000000000..2a338d61c --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t-members.html @@ -0,0 +1,66 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_multiplies_t< Channel1, Channel2, ChannelResult > Member List
        +
        + + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t.html new file mode 100644 index 000000000..ccbc19e4a --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__multiplies__t.html @@ -0,0 +1,138 @@ + + + + + + + + + Generic Image Library: channel_multiplies_t< Channel1, Channel2, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_multiplies_t< Channel1, Channel2, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of multiplication of two channel values. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + + + +

        +Public Types

        +using ChannelRef1 = typename channel_traits< Channel1 >::const_reference
         
        +using ChannelRef2 = typename channel_traits< Channel2 >::const_reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel1, typename Channel2, typename ChannelResult>
        +struct boost::gil::channel_multiplies_t< Channel1, Channel2, ChannelResult >

        + +

        Arithmetic operation of multiplication of two channel values.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef1 ch1,
        ChannelRef2 ch2 
        ) const -> ChannelResult +
        +
        +inline
        +
        +
        Parameters
        + + + +
        ch1- first of the two factors (multiplicand).
        ch2- second of the two factors (multiplier).
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t-members.html new file mode 100644 index 000000000..f253f5bda --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t-members.html @@ -0,0 +1,65 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_plus_scalar_t< Channel, Scalar, ChannelResult > Member List
        +
        +
        + +

        This is the complete list of members for channel_plus_scalar_t< Channel, Scalar, ChannelResult >, including all inherited members.

        + + + +
        ChannelRef typedef (defined in channel_plus_scalar_t< Channel, Scalar, ChannelResult >)channel_plus_scalar_t< Channel, Scalar, ChannelResult >
        operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResult (defined in channel_plus_scalar_t< Channel, Scalar, ChannelResult >)channel_plus_scalar_t< Channel, Scalar, ChannelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t.html new file mode 100644 index 000000000..5b76dac2c --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__scalar__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: channel_plus_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_plus_scalar_t< Channel, Scalar, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of adding scalar to channel value. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + +

        +Public Types

        +using ChannelRef = typename channel_traits< Channel >::const_reference
         
        + + + +

        +Public Member Functions

        +auto operator() (ChannelRef channel, Scalar const &scalar) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel, typename Scalar, typename ChannelResult>
        +struct boost::gil::channel_plus_scalar_t< Channel, Scalar, ChannelResult >

        + +

        Arithmetic operation of adding scalar to channel value.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t-members.html new file mode 100644 index 000000000..ebb67f163 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t-members.html @@ -0,0 +1,66 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_plus_t< Channel1, Channel2, ChannelResult > Member List
        +
        +
        + +

        This is the complete list of members for channel_plus_t< Channel1, Channel2, ChannelResult >, including all inherited members.

        + + + + +
        ChannelRef1 typedef (defined in channel_plus_t< Channel1, Channel2, ChannelResult >)channel_plus_t< Channel1, Channel2, ChannelResult >
        ChannelRef2 typedef (defined in channel_plus_t< Channel1, Channel2, ChannelResult >)channel_plus_t< Channel1, Channel2, ChannelResult >
        operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResultchannel_plus_t< Channel1, Channel2, ChannelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t.html new file mode 100644 index 000000000..e3bc5257d --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__plus__t.html @@ -0,0 +1,138 @@ + + + + + + + + + Generic Image Library: channel_plus_t< Channel1, Channel2, ChannelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_plus_t< Channel1, Channel2, ChannelResult > Struct Template Reference
        +
        +
        + +

        Arithmetic operation of addition of two channel values. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + + + +

        +Public Types

        +using ChannelRef1 = typename channel_traits< Channel1 >::const_reference
         
        +using ChannelRef2 = typename channel_traits< Channel2 >::const_reference
         
        + + + +

        +Public Member Functions

        auto operator() (ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
         
        +

        Detailed Description

        +

        template<typename Channel1, typename Channel2, typename ChannelResult>
        +struct boost::gil::channel_plus_t< Channel1, Channel2, ChannelResult >

        + +

        Arithmetic operation of addition of two channel values.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        Member Function Documentation

        + +

        ◆ operator()()

        + +
        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + +
        auto operator() (ChannelRef1 ch1,
        ChannelRef2 ch2 
        ) const -> ChannelResult +
        +
        +inline
        +
        +
        Parameters
        + + + +
        ch1- first of the two addends (augend).
        ch2- second of the two addends.
        +
        +
        + +
        +
        +
        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t-members.html new file mode 100644 index 000000000..d1f57ecfb --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t-members.html @@ -0,0 +1,65 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        channel_zeros_t< Channel > Member List
        +
        +
        + +

        This is the complete list of members for channel_zeros_t< Channel >, including all inherited members.

        + + + +
        ChannelRef typedef (defined in channel_zeros_t< Channel >)channel_zeros_t< Channel >
        operator()(ChannelRef channel) const -> ChannelRef (defined in channel_zeros_t< Channel >)channel_zeros_t< Channel >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t.html new file mode 100644 index 000000000..89441c1b5 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1channel__zeros__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: channel_zeros_t< Channel > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        channel_zeros_t< Channel > Struct Template Reference
        +
        +
        + +

        Operation of setting channel value to zero. + More...

        + +

        #include <channel_numeric_operations.hpp>

        + + + + +

        +Public Types

        +using ChannelRef = typename channel_traits< Channel >::reference
         
        + + + +

        +Public Member Functions

        +auto operator() (ChannelRef channel) const -> ChannelRef
         
        +

        Detailed Description

        +

        template<typename Channel>
        +struct boost::gil::channel_zeros_t< Channel >

        + +

        Operation of setting channel value to zero.

        +
        Note
        This is a generic implementation; user should specialize it for better performance.
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k-members.html new file mode 100644 index 000000000..a732c6e9d --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        correlator_k< Size, PixelAccum > Member List
        +
        +
        + +

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

        + + +
        operator()(SrcIterator src_begin, SrcIterator src_end, KernelIterator kernel_begin, DstIterator dst_begin) (defined in correlator_k< Size, PixelAccum >)correlator_k< Size, PixelAccum >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k.html b/develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k.html new file mode 100644 index 000000000..ce24a3492 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1detail_1_1correlator__k.html @@ -0,0 +1,84 @@ + + + + + + + + + Generic Image Library: correlator_k< Size, PixelAccum > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        correlator_k< Size, PixelAccum > Struct Template Reference
        +
        +
        + +

        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is a template parameter and must be compulsorily specified while using. + More...

        + +

        #include <convolve.hpp>

        + + + + + +

        +Public Member Functions

        +template<typename SrcIterator , typename KernelIterator , typename DstIterator >
        void operator() (SrcIterator src_begin, SrcIterator src_end, KernelIterator kernel_begin, DstIterator dst_begin)
         
        +

        Detailed Description

        +

        template<std::size_t Size, typename PixelAccum>
        +struct boost::gil::detail::correlator_k< Size, PixelAccum >

        + +

        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is a template parameter and must be compulsorily specified while using.

        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t-members.html new file mode 100644 index 000000000..45e8837ca --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_assigns_t< PixelRef, PixelResult > Member List
        +
        +
        + +

        This is the complete list of members for pixel_assigns_t< PixelRef, PixelResult >, including all inherited members.

        + + +
        operator()(PixelRef const &src, PixelResult &dst) const -> PixelResult (defined in pixel_assigns_t< PixelRef, PixelResult >)pixel_assigns_t< PixelRef, PixelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t.html new file mode 100644 index 000000000..a53a5ffd5 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__assigns__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: pixel_assigns_t< PixelRef, PixelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_assigns_t< PixelRef, PixelResult > Struct Template Reference
        +
        +
        + +

        Casts and assigns a pixel to another. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef const &src, PixelResult &dst) const -> PixelResult
         
        +

        Detailed Description

        +

        template<typename PixelRef, typename PixelResult>
        +struct boost::gil::pixel_assigns_t< PixelRef, PixelResult >

        + +

        Casts and assigns a pixel to another.

        +

        A generic implementation for casting and assigning a pixel to another. User should specialize it for better performance.

        +
        Template Parameters
        + + + +
        PixelRef- models PixelConcept
        PixelResult- models PixelValueConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t-members.html new file mode 100644 index 000000000..1d4b58960 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_divide_t< PixelRef1, PixelRef2, PixelResult > Member List
        +
        +
        + +

        This is the complete list of members for pixel_divide_t< PixelRef1, PixelRef2, PixelResult >, including all inherited members.

        + + +
        operator()(PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult (defined in pixel_divide_t< PixelRef1, PixelRef2, PixelResult >)pixel_divide_t< PixelRef1, PixelRef2, PixelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t.html new file mode 100644 index 000000000..2eaa37e0f --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divide__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: pixel_divide_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_divide_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference
        +
        +
        + +

        Performs channel-wise division of two pixels. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult
         
        +

        Detailed Description

        +

        template<typename PixelRef1, typename PixelRef2, typename PixelResult>
        +struct boost::gil::pixel_divide_t< PixelRef1, PixelRef2, PixelResult >

        + +

        Performs channel-wise division of two pixels.

        +
        Template Parameters
        + + + + +
        PixelRef1- models PixelConcept
        PixelRef2- models PixelConcept
        PixelResult- models PixelValueConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t-members.html new file mode 100644 index 000000000..7e3b477b3 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_divides_scalar_t< PixelRef, Scalar, PixelResult > Member List
        +
        +
        + +

        This is the complete list of members for pixel_divides_scalar_t< PixelRef, Scalar, PixelResult >, including all inherited members.

        + + +
        operator()(PixelRef const &p, Scalar const &s) const -> PixelResult (defined in pixel_divides_scalar_t< PixelRef, Scalar, PixelResult >)pixel_divides_scalar_t< PixelRef, Scalar, PixelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t.html new file mode 100644 index 000000000..19ed2ed80 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__divides__scalar__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: pixel_divides_scalar_t< PixelRef, Scalar, PixelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_divides_scalar_t< PixelRef, Scalar, PixelResult > Struct Template Reference
        +
        +
        + +

        Performs channel-wise division of pixel elements by scalar. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef const &p, Scalar const &s) const -> PixelResult
         
        +

        Detailed Description

        +

        template<typename PixelRef, typename Scalar, typename PixelResult>
        +struct boost::gil::pixel_divides_scalar_t< PixelRef, Scalar, PixelResult >

        + +

        Performs channel-wise division of pixel elements by scalar.

        +
        Template Parameters
        + + + + +
        PixelRef- models PixelConcept
        Scalar- models a scalar type
        PixelResult- models PixelValueConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t-members.html new file mode 100644 index 000000000..0af81c0fb --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_halves_t< PixelRef > Member List
        +
        +
        + +

        This is the complete list of members for pixel_halves_t< PixelRef >, including all inherited members.

        + + +
        operator()(PixelRef &p) const -> PixelRef & (defined in pixel_halves_t< PixelRef >)pixel_halves_t< PixelRef >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t.html new file mode 100644 index 000000000..528eb9a00 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__halves__t.html @@ -0,0 +1,89 @@ + + + + + + + + + Generic Image Library: pixel_halves_t< PixelRef > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_halves_t< PixelRef > Struct Template Reference
        +
        +
        + +

        Performs channel-wise division by 2. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef &p) const -> PixelRef &
         
        +

        Detailed Description

        +

        template<typename PixelRef>
        +struct boost::gil::pixel_halves_t< PixelRef >

        + +

        Performs channel-wise division by 2.

        +
        Template Parameters
        + + +
        PixelRef- models PixelConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t-members.html new file mode 100644 index 000000000..ae95bb74b --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_minus_t< PixelRef1, PixelRef2, PixelResult > Member List
        +
        +
        + +

        This is the complete list of members for pixel_minus_t< PixelRef1, PixelRef2, PixelResult >, including all inherited members.

        + + +
        operator()(PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult (defined in pixel_minus_t< PixelRef1, PixelRef2, PixelResult >)pixel_minus_t< PixelRef1, PixelRef2, PixelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t.html new file mode 100644 index 000000000..f6ace1c85 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__minus__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: pixel_minus_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_minus_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference
        +
        +
        + +

        Performs channel-wise subtraction of two pixels. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult
         
        +

        Detailed Description

        +

        template<typename PixelRef1, typename PixelRef2, typename PixelResult>
        +struct boost::gil::pixel_minus_t< PixelRef1, PixelRef2, PixelResult >

        + +

        Performs channel-wise subtraction of two pixels.

        +
        Template Parameters
        + + + + +
        PixelRef1- models PixelConcept
        PixelRef2- models PixelConcept
        PixelResult- models PixelValueConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t-members.html new file mode 100644 index 000000000..8725ba97f --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult > Member List
        +
        +
        + +

        This is the complete list of members for pixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult >, including all inherited members.

        + + +
        operator()(PixelRef const &p, Scalar const &s) const -> PixelResult (defined in pixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult >)pixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t.html new file mode 100644 index 000000000..3137af1e1 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiplies__scalar__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: pixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult > Struct Template Reference
        +
        +
        + +

        Performs channel-wise multiplication of pixel elements by scalar. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef const &p, Scalar const &s) const -> PixelResult
         
        +

        Detailed Description

        +

        template<typename PixelRef, typename Scalar, typename PixelResult>
        +struct boost::gil::pixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult >

        + +

        Performs channel-wise multiplication of pixel elements by scalar.

        +
        Template Parameters
        + + + + +
        PixelRef- models PixelConcept
        Scalar- models a scalar type
        PixelResult- models PixelValueConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t-members.html new file mode 100644 index 000000000..6dee13cbd --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_multiply_t< PixelRef1, PixelRef2, PixelResult > Member List
        +
        +
        + +

        This is the complete list of members for pixel_multiply_t< PixelRef1, PixelRef2, PixelResult >, including all inherited members.

        + + +
        operator()(PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult (defined in pixel_multiply_t< PixelRef1, PixelRef2, PixelResult >)pixel_multiply_t< PixelRef1, PixelRef2, PixelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t.html new file mode 100644 index 000000000..f69d3be55 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__multiply__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: pixel_multiply_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_multiply_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference
        +
        +
        + +

        Performs channel-wise multiplication of two pixels. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult
         
        +

        Detailed Description

        +

        template<typename PixelRef1, typename PixelRef2, typename PixelResult>
        +struct boost::gil::pixel_multiply_t< PixelRef1, PixelRef2, PixelResult >

        + +

        Performs channel-wise multiplication of two pixels.

        +
        Template Parameters
        + + + + +
        PixelRef1- models PixelConcept
        PixelRef1- models PixelConcept
        PixelResult- models PixelValueConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t-members.html new file mode 100644 index 000000000..286a3f9f6 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_plus_t< PixelRef1, PixelRef2, PixelResult > Member List
        +
        +
        + +

        This is the complete list of members for pixel_plus_t< PixelRef1, PixelRef2, PixelResult >, including all inherited members.

        + + +
        operator()(PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult (defined in pixel_plus_t< PixelRef1, PixelRef2, PixelResult >)pixel_plus_t< PixelRef1, PixelRef2, PixelResult >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t.html new file mode 100644 index 000000000..26dc3c74c --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__plus__t.html @@ -0,0 +1,91 @@ + + + + + + + + + Generic Image Library: pixel_plus_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_plus_t< PixelRef1, PixelRef2, PixelResult > Struct Template Reference
        +
        +
        + +

        Performs channel-wise addition of two pixels. + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef1 const &p1, PixelRef2 const &p2) const -> PixelResult
         
        +

        Detailed Description

        +

        template<typename PixelRef1, typename PixelRef2, typename PixelResult>
        +struct boost::gil::pixel_plus_t< PixelRef1, PixelRef2, PixelResult >

        + +

        Performs channel-wise addition of two pixels.

        +
        Template Parameters
        + + + + +
        PixelRef1- models PixelConcept
        PixelRef2- models PixelConcept
        PixelResult- models PixelValueConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__proxy.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__proxy.html new file mode 100644 index 000000000..662521bbd --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__proxy.html @@ -0,0 +1,76 @@ + + + + + + + + + Generic Image Library: pixel_proxy< T > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_proxy< T > Struct Template Reference
        +
        +
        + +

        Reference proxy associated with a type that has a "reference" member type alias. + More...

        + +

        #include <algorithm.hpp>

        + +

        Inherits remove_reference< T::reference >.

        +

        Detailed Description

        +

        template<typename T>
        +struct boost::gil::pixel_proxy< T >

        + +

        Reference proxy associated with a type that has a "reference" member type alias.

        +

        The reference proxy is the reference type, but with stripped-out C++ reference. Models PixelConcept.

        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t-members.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t-members.html new file mode 100644 index 000000000..694a53ef0 --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t-members.html @@ -0,0 +1,64 @@ + + + + + + + + + Generic Image Library: Member List + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        +
        +
        pixel_zeros_t< PixelRef > Member List
        +
        +
        + +

        This is the complete list of members for pixel_zeros_t< PixelRef >, including all inherited members.

        + + +
        operator()(PixelRef &p) const -> PixelRef & (defined in pixel_zeros_t< PixelRef >)pixel_zeros_t< PixelRef >inline
        + + + + + + diff --git a/develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t.html b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t.html new file mode 100644 index 000000000..81f3823df --- /dev/null +++ b/develop/doc/html/reference/structboost_1_1gil_1_1pixel__zeros__t.html @@ -0,0 +1,89 @@ + + + + + + + + + Generic Image Library: pixel_zeros_t< PixelRef > Struct Template Reference + + + + + + + +
        + + + + + + +
        +

        Boost GIL

        +

        +
        +
        +
        + + + + + + +
        +
        + +
        +
        pixel_zeros_t< PixelRef > Struct Template Reference
        +
        +
        + +

        Sets pixel elements to zero (for whatever zero means) + More...

        + +

        #include <pixel_numeric_operations.hpp>

        + + + + +

        +Public Member Functions

        +auto operator() (PixelRef &p) const -> PixelRef &
         
        +

        Detailed Description

        +

        template<typename PixelRef>
        +struct boost::gil::pixel_zeros_t< PixelRef >

        + +

        Sets pixel elements to zero (for whatever zero means)

        +
        Template Parameters
        + + +
        PixelRef- models PixelConcept
        +
        +
        +

        The documentation for this struct was generated from the following file: +
        + + + + + + diff --git a/develop/doc/html/reference/threshold_8hpp_source.html b/develop/doc/html/reference/threshold_8hpp_source.html index 76f3c1c95..24c896cd8 100644 --- a/develop/doc/html/reference/threshold_8hpp_source.html +++ b/develop/doc/html/reference/threshold_8hpp_source.html @@ -49,438 +49,439 @@ $(function() {
        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 #ifndef BOOST_GIL_IMAGE_PROCESSING_THRESHOLD_HPP
        -
        9 #define BOOST_GIL_IMAGE_PROCESSING_THRESHOLD_HPP
        -
        10 
        -
        11 #include <limits>
        -
        12 #include <array>
        -
        13 #include <type_traits>
        -
        14 #include <cstddef>
        -
        15 #include <algorithm>
        -
        16 #include <vector>
        -
        17 #include <cmath>
        -
        18 
        -
        19 #include <boost/assert.hpp>
        -
        20 
        -
        21 #include <boost/gil/image.hpp>
        -
        22 #include <boost/gil/extension/numeric/kernel.hpp>
        -
        23 #include <boost/gil/extension/numeric/convolve.hpp>
        -
        24 #include <boost/gil/image_processing/numeric.hpp>
        -
        25 
        -
        26 namespace boost { namespace gil {
        -
        27 
        -
        28 namespace detail {
        -
        29 
        -
        30 template
        -
        31 <
        -
        32  typename SourceChannelT,
        -
        33  typename ResultChannelT,
        -
        34  typename SrcView,
        -
        35  typename DstView,
        -
        36  typename Operator
        -
        37 >
        -
        38 void threshold_impl(SrcView const& src_view, DstView const& dst_view, Operator const& threshold_op)
        -
        39 {
        -
        40  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        41  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        42  static_assert(color_spaces_are_compatible
        -
        43  <
        -
        44  typename color_space_type<SrcView>::type,
        -
        45  typename color_space_type<DstView>::type
        -
        46  >::value, "Source and destination views must have pixels with the same color space");
        -
        47 
        -
        48  //iterate over the image checking each pixel value for the threshold
        -
        49  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        -
        50  {
        -
        51  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        -
        52  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
        -
        53 
        -
        54  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        -
        55  {
        -
        56  static_transform(src_it[x], dst_it[x], threshold_op);
        -
        57  }
        -
        58  }
        -
        59 }
        -
        60 
        -
        61 } //namespace boost::gil::detail
        -
        62 
        - -
        70 {
        -
        71  regular,
        -
        72  inverse
        -
        73 };
        -
        74 
        - -
        78 {
        -
        79  otsu
        -
        80 };
        -
        81 
        - -
        85 {
        -
        86  threshold,
        -
        87  zero
        -
        88 };
        -
        89 
        -
        90 enum class threshold_adaptive_method
        -
        91 {
        -
        92  mean,
        -
        93  gaussian
        -
        94 };
        -
        95 
        -
        107 template <typename SrcView, typename DstView>
        - -
        109  SrcView const& src_view,
        -
        110  DstView const& dst_view,
        -
        111  typename channel_type<DstView>::type threshold_value,
        -
        112  typename channel_type<DstView>::type max_value,
        - -
        114 )
        -
        115 {
        -
        116  //deciding output channel type and creating functor
        -
        117  using source_channel_t = typename channel_type<SrcView>::type;
        -
        118  using result_channel_t = typename channel_type<DstView>::type;
        -
        119 
        -
        120  if (direction == threshold_direction::regular)
        -
        121  {
        -
        122  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        -
        123  [threshold_value, max_value](source_channel_t px) -> result_channel_t {
        -
        124  return px > threshold_value ? max_value : 0;
        -
        125  });
        -
        126  }
        -
        127  else
        -
        128  {
        -
        129  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        -
        130  [threshold_value, max_value](source_channel_t px) -> result_channel_t {
        -
        131  return px > threshold_value ? 0 : max_value;
        -
        132  });
        -
        133  }
        -
        134 }
        -
        135 
        -
        146 template <typename SrcView, typename DstView>
        - -
        148  SrcView const& src_view,
        -
        149  DstView const& dst_view,
        -
        150  typename channel_type<DstView>::type threshold_value,
        - -
        152 )
        -
        153 {
        -
        154  //deciding output channel type and creating functor
        -
        155  using result_channel_t = typename channel_type<DstView>::type;
        -
        156 
        -
        157  result_channel_t max_value = (std::numeric_limits<result_channel_t>::max)();
        -
        158  threshold_binary(src_view, dst_view, threshold_value, max_value, direction);
        -
        159 }
        -
        160 
        -
        172 template <typename SrcView, typename DstView>
        - -
        174  SrcView const& src_view,
        -
        175  DstView const& dst_view,
        -
        176  typename channel_type<DstView>::type threshold_value,
        - - -
        179 )
        -
        180 {
        -
        181  //deciding output channel type and creating functor
        -
        182  using source_channel_t = typename channel_type<SrcView>::type;
        -
        183  using result_channel_t = typename channel_type<DstView>::type;
        -
        184 
        -
        185  std::function<result_channel_t(source_channel_t)> threshold_logic;
        -
        186 
        - -
        188  {
        -
        189  if (direction == threshold_direction::regular)
        -
        190  {
        -
        191  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        -
        192  [threshold_value](source_channel_t px) -> result_channel_t {
        -
        193  return px > threshold_value ? threshold_value : px;
        -
        194  });
        -
        195  }
        -
        196  else
        -
        197  {
        -
        198  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        -
        199  [threshold_value](source_channel_t px) -> result_channel_t {
        -
        200  return px > threshold_value ? px : threshold_value;
        -
        201  });
        -
        202  }
        -
        203  }
        -
        204  else
        -
        205  {
        -
        206  if (direction == threshold_direction::regular)
        -
        207  {
        -
        208  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        -
        209  [threshold_value](source_channel_t px) -> result_channel_t {
        -
        210  return px > threshold_value ? px : 0;
        -
        211  });
        -
        212  }
        -
        213  else
        -
        214  {
        -
        215  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        -
        216  [threshold_value](source_channel_t px) -> result_channel_t {
        -
        217  return px > threshold_value ? 0 : px;
        -
        218  });
        -
        219  }
        -
        220  }
        -
        221 }
        -
        222 
        -
        223 namespace detail{
        -
        224 
        -
        225 template <typename SrcView, typename DstView>
        -
        226 void otsu_impl(SrcView const& src_view, DstView const& dst_view, threshold_direction direction)
        -
        227 {
        -
        228  //deciding output channel type and creating functor
        -
        229  using source_channel_t = typename channel_type<SrcView>::type;
        -
        230 
        -
        231  std::array<std::size_t, 256> histogram{};
        -
        232  //initial value of min is set to maximum possible value to compare histogram data
        -
        233  //initial value of max is set to minimum possible value to compare histogram data
        -
        234  auto min = (std::numeric_limits<source_channel_t>::max)(),
        -
        235  max = (std::numeric_limits<source_channel_t>::min)();
        -
        236 
        -
        237  if (sizeof(source_channel_t) > 1 || std::is_signed<source_channel_t>::value)
        -
        238  {
        -
        239  //iterate over the image to find the min and max pixel values
        -
        240  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        -
        241  {
        -
        242  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        -
        243  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        -
        244  {
        -
        245  if (src_it[x] < min) min = src_it[x];
        -
        246  if (src_it[x] > min) min = src_it[x];
        -
        247  }
        -
        248  }
        -
        249 
        -
        250  //making histogram
        -
        251  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        -
        252  {
        -
        253  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        -
        254 
        -
        255  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        -
        256  {
        -
        257  histogram[((src_it[x] - min) * 255) / (max - min)]++;
        -
        258  }
        -
        259  }
        -
        260  }
        -
        261  else
        -
        262  {
        -
        263  //making histogram
        -
        264  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        -
        265  {
        -
        266  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        -
        267 
        -
        268  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        -
        269  {
        -
        270  histogram[src_it[x]]++;
        -
        271  }
        -
        272  }
        -
        273  }
        -
        274 
        -
        275  //histData = histogram data
        -
        276  //sum = total (background + foreground)
        -
        277  //sumB = sum background
        -
        278  //wB = weight background
        -
        279  //wf = weight foreground
        -
        280  //varMax = tracking the maximum known value of between class variance
        -
        281  //mB = mu background
        -
        282  //mF = mu foreground
        -
        283  //varBeetween = between class variance
        -
        284  //http://www.labbookpages.co.uk/software/imgProc/otsuThreshold.html
        -
        285  //https://www.ipol.im/pub/art/2016/158/
        -
        286  std::ptrdiff_t total_pixel = src_view.height() * src_view.width();
        -
        287  std::ptrdiff_t sum_total = 0, sum_back = 0;
        -
        288  std::size_t weight_back = 0, weight_fore = 0, threshold = 0;
        -
        289  double var_max = 0, mean_back, mean_fore, var_intra_class;
        -
        290 
        -
        291  for (std::size_t t = 0; t < 256; t++)
        -
        292  {
        -
        293  sum_total += t * histogram[t];
        -
        294  }
        -
        295 
        -
        296  for (int t = 0; t < 256; t++)
        -
        297  {
        -
        298  weight_back += histogram[t]; // Weight Background
        -
        299  if (weight_back == 0) continue;
        -
        300 
        -
        301  weight_fore = total_pixel - weight_back; // Weight Foreground
        -
        302  if (weight_fore == 0) break;
        -
        303 
        -
        304  sum_back += t * histogram[t];
        -
        305 
        -
        306  mean_back = sum_back / weight_back; // Mean Background
        -
        307  mean_fore = (sum_total - sum_back) / weight_fore; // Mean Foreground
        -
        308 
        -
        309  // Calculate Between Class Variance
        -
        310  var_intra_class = weight_back * weight_fore * (mean_back - mean_fore) * (mean_back - mean_fore);
        -
        311 
        -
        312  // Check if new maximum found
        -
        313  if (var_intra_class > var_max) {
        -
        314  var_max = var_intra_class;
        -
        315  threshold = t;
        -
        316  }
        -
        317  }
        -
        318  if (sizeof(source_channel_t) > 1 && std::is_unsigned<source_channel_t>::value)
        -
        319  {
        -
        320  threshold_binary(src_view, dst_view, (threshold * (max - min) / 255) + min, direction);
        -
        321  }
        -
        322  else {
        -
        323  threshold_binary(src_view, dst_view, threshold, direction);
        -
        324  }
        -
        325 }
        -
        326 } //namespace detail
        -
        327 
        -
        328 template <typename SrcView, typename DstView>
        -
        329 void threshold_optimal
        -
        330 (
        -
        331  SrcView const& src_view,
        -
        332  DstView const& dst_view,
        - - -
        335 )
        -
        336 {
        -
        337  if (mode == threshold_optimal_value::otsu)
        -
        338  {
        -
        339  for (std::size_t i = 0; i < src_view.num_channels(); i++)
        -
        340  {
        -
        341  detail::otsu_impl
        -
        342  (nth_channel_view(src_view, i), nth_channel_view(dst_view, i), direction);
        -
        343  }
        -
        344  }
        -
        345 }
        -
        346 
        -
        347 namespace detail {
        -
        348 
        -
        349 template
        -
        350 <
        -
        351  typename SourceChannelT,
        -
        352  typename ResultChannelT,
        -
        353  typename SrcView,
        -
        354  typename DstView,
        -
        355  typename Operator
        -
        356 >
        -
        357 void adaptive_impl
        -
        358 (
        -
        359  SrcView const& src_view,
        -
        360  SrcView const& convolved_view,
        -
        361  DstView const& dst_view,
        -
        362  Operator const& threshold_op
        -
        363 )
        -
        364 {
        -
        365  //template argument validation
        -
        366  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        367  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        368 
        -
        369  static_assert(color_spaces_are_compatible
        -
        370  <
        -
        371  typename color_space_type<SrcView>::type,
        -
        372  typename color_space_type<DstView>::type
        -
        373  >::value, "Source and destination views must have pixels with the same color space");
        -
        374 
        -
        375  //iterate over the image checking each pixel value for the threshold
        -
        376  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        -
        377  {
        -
        378  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        -
        379  typename SrcView::x_iterator convolved_it = convolved_view.row_begin(y);
        -
        380  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
        -
        381 
        -
        382  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        -
        383  {
        -
        384  static_transform(src_it[x], convolved_it[x], dst_it[x], threshold_op);
        -
        385  }
        -
        386  }
        -
        387 }
        -
        388 } //namespace boost::gil::detail
        -
        389 
        -
        390 template <typename SrcView, typename DstView>
        -
        391 void threshold_adaptive
        -
        392 (
        -
        393  SrcView const& src_view,
        -
        394  DstView const& dst_view,
        -
        395  typename channel_type<DstView>::type max_value,
        -
        396  std::size_t kernel_size,
        -
        397  threshold_adaptive_method method = threshold_adaptive_method::mean,
        - -
        399  typename channel_type<DstView>::type constant = 0
        -
        400 )
        -
        401 {
        -
        402  BOOST_ASSERT_MSG((kernel_size % 2 != 0), "Kernel size must be an odd number");
        -
        403 
        -
        404  typedef typename channel_type<SrcView>::type source_channel_t;
        -
        405  typedef typename channel_type<DstView>::type result_channel_t;
        -
        406 
        -
        407  image<typename SrcView::value_type> temp_img(src_view.width(), src_view.height());
        -
        408  typename image<typename SrcView::value_type>::view_t temp_view = view(temp_img);
        -
        409  SrcView temp_conv(temp_view);
        -
        410 
        -
        411  if (method == threshold_adaptive_method::mean)
        -
        412  {
        -
        413  std::vector<float> mean_kernel_values(kernel_size, 1.0f/kernel_size);
        -
        414  kernel_1d<float> kernel(mean_kernel_values.begin(), kernel_size, kernel_size/2);
        -
        415 
        -
        416  detail::convolve_1d
        -
        417  <
        -
        418  pixel<float, typename SrcView::value_type::layout_t>
        -
        419  >(src_view, kernel, temp_view);
        -
        420  }
        -
        421  else if (method == threshold_adaptive_method::gaussian)
        -
        422  {
        -
        423  detail::kernel_2d<float> kernel = generate_gaussian_kernel(kernel_size, 1.0);
        -
        424  convolve_2d(src_view, kernel, temp_view);
        -
        425  }
        -
        426 
        -
        427  if (direction == threshold_direction::regular)
        -
        428  {
        -
        429  detail::adaptive_impl<source_channel_t, result_channel_t>(src_view, temp_conv, dst_view,
        -
        430  [max_value, constant](source_channel_t px, source_channel_t threshold) -> result_channel_t
        -
        431  { return px > (threshold - constant) ? max_value : 0; });
        -
        432  }
        -
        433  else
        -
        434  {
        -
        435  detail::adaptive_impl<source_channel_t, result_channel_t>(src_view, temp_conv, dst_view,
        -
        436  [max_value, constant](source_channel_t px, source_channel_t threshold) -> result_channel_t
        -
        437  { return px > (threshold - constant) ? 0 : max_value; });
        -
        438  }
        -
        439 }
        -
        440 
        -
        441 template <typename SrcView, typename DstView>
        -
        442 void threshold_adaptive
        -
        443 (
        -
        444  SrcView const& src_view,
        -
        445  DstView const& dst_view,
        -
        446  std::size_t kernel_size,
        -
        447  threshold_adaptive_method method = threshold_adaptive_method::mean,
        - -
        449  int constant = 0
        -
        450 )
        -
        451 {
        -
        452  //deciding output channel type and creating functor
        -
        453  typedef typename channel_type<DstView>::type result_channel_t;
        -
        454 
        -
        455  result_channel_t max_value = (std::numeric_limits<result_channel_t>::max)();
        -
        456 
        -
        457  threshold_adaptive(src_view, dst_view, max_value, kernel_size, method, direction, constant);
        -
        458 }
        -
        459 
        -
        461 
        -
        462 }} //namespace boost::gil
        -
        463 
        -
        464 #endif //BOOST_GIL_IMAGE_PROCESSING_THRESHOLD_HPP
        +
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4 //
        +
        5 // Use, modification and distribution are subject to the Boost Software License,
        +
        6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        7 // http://www.boost.org/LICENSE_1_0.txt)
        +
        8 //
        +
        9 #ifndef BOOST_GIL_IMAGE_PROCESSING_THRESHOLD_HPP
        +
        10 #define BOOST_GIL_IMAGE_PROCESSING_THRESHOLD_HPP
        +
        11 
        +
        12 #include <limits>
        +
        13 #include <array>
        +
        14 #include <type_traits>
        +
        15 #include <cstddef>
        +
        16 #include <algorithm>
        +
        17 #include <vector>
        +
        18 #include <cmath>
        +
        19 
        +
        20 #include <boost/assert.hpp>
        +
        21 
        +
        22 #include <boost/gil/image.hpp>
        +
        23 #include <boost/gil/image_processing/kernel.hpp>
        +
        24 #include <boost/gil/image_processing/convolve.hpp>
        +
        25 #include <boost/gil/image_processing/numeric.hpp>
        +
        26 
        +
        27 namespace boost { namespace gil {
        +
        28 
        +
        29 namespace detail {
        +
        30 
        +
        31 template
        +
        32 <
        +
        33  typename SourceChannelT,
        +
        34  typename ResultChannelT,
        +
        35  typename SrcView,
        +
        36  typename DstView,
        +
        37  typename Operator
        +
        38 >
        +
        39 void threshold_impl(SrcView const& src_view, DstView const& dst_view, Operator const& threshold_op)
        +
        40 {
        +
        41  gil_function_requires<ImageViewConcept<SrcView>>();
        +
        42  gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        43  static_assert(color_spaces_are_compatible
        +
        44  <
        +
        45  typename color_space_type<SrcView>::type,
        +
        46  typename color_space_type<DstView>::type
        +
        47  >::value, "Source and destination views must have pixels with the same color space");
        +
        48 
        +
        49  //iterate over the image checking each pixel value for the threshold
        +
        50  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        +
        51  {
        +
        52  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        +
        53  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
        +
        54 
        +
        55  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        +
        56  {
        +
        57  static_transform(src_it[x], dst_it[x], threshold_op);
        +
        58  }
        +
        59  }
        +
        60 }
        +
        61 
        +
        62 } //namespace boost::gil::detail
        +
        63 
        + +
        71 {
        +
        72  regular,
        +
        73  inverse
        +
        74 };
        +
        75 
        + +
        79 {
        +
        80  otsu
        +
        81 };
        +
        82 
        + +
        86 {
        +
        87  threshold,
        +
        88  zero
        +
        89 };
        +
        90 
        +
        91 enum class threshold_adaptive_method
        +
        92 {
        +
        93  mean,
        +
        94  gaussian
        +
        95 };
        +
        96 
        +
        108 template <typename SrcView, typename DstView>
        + +
        110  SrcView const& src_view,
        +
        111  DstView const& dst_view,
        +
        112  typename channel_type<DstView>::type threshold_value,
        +
        113  typename channel_type<DstView>::type max_value,
        + +
        115 )
        +
        116 {
        +
        117  //deciding output channel type and creating functor
        +
        118  using source_channel_t = typename channel_type<SrcView>::type;
        +
        119  using result_channel_t = typename channel_type<DstView>::type;
        +
        120 
        +
        121  if (direction == threshold_direction::regular)
        +
        122  {
        +
        123  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        +
        124  [threshold_value, max_value](source_channel_t px) -> result_channel_t {
        +
        125  return px > threshold_value ? max_value : 0;
        +
        126  });
        +
        127  }
        +
        128  else
        +
        129  {
        +
        130  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        +
        131  [threshold_value, max_value](source_channel_t px) -> result_channel_t {
        +
        132  return px > threshold_value ? 0 : max_value;
        +
        133  });
        +
        134  }
        +
        135 }
        +
        136 
        +
        147 template <typename SrcView, typename DstView>
        + +
        149  SrcView const& src_view,
        +
        150  DstView const& dst_view,
        +
        151  typename channel_type<DstView>::type threshold_value,
        + +
        153 )
        +
        154 {
        +
        155  //deciding output channel type and creating functor
        +
        156  using result_channel_t = typename channel_type<DstView>::type;
        +
        157 
        +
        158  result_channel_t max_value = (std::numeric_limits<result_channel_t>::max)();
        +
        159  threshold_binary(src_view, dst_view, threshold_value, max_value, direction);
        +
        160 }
        +
        161 
        +
        173 template <typename SrcView, typename DstView>
        + +
        175  SrcView const& src_view,
        +
        176  DstView const& dst_view,
        +
        177  typename channel_type<DstView>::type threshold_value,
        + + +
        180 )
        +
        181 {
        +
        182  //deciding output channel type and creating functor
        +
        183  using source_channel_t = typename channel_type<SrcView>::type;
        +
        184  using result_channel_t = typename channel_type<DstView>::type;
        +
        185 
        +
        186  std::function<result_channel_t(source_channel_t)> threshold_logic;
        +
        187 
        + +
        189  {
        +
        190  if (direction == threshold_direction::regular)
        +
        191  {
        +
        192  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        +
        193  [threshold_value](source_channel_t px) -> result_channel_t {
        +
        194  return px > threshold_value ? threshold_value : px;
        +
        195  });
        +
        196  }
        +
        197  else
        +
        198  {
        +
        199  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        +
        200  [threshold_value](source_channel_t px) -> result_channel_t {
        +
        201  return px > threshold_value ? px : threshold_value;
        +
        202  });
        +
        203  }
        +
        204  }
        +
        205  else
        +
        206  {
        +
        207  if (direction == threshold_direction::regular)
        +
        208  {
        +
        209  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        +
        210  [threshold_value](source_channel_t px) -> result_channel_t {
        +
        211  return px > threshold_value ? px : 0;
        +
        212  });
        +
        213  }
        +
        214  else
        +
        215  {
        +
        216  detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
        +
        217  [threshold_value](source_channel_t px) -> result_channel_t {
        +
        218  return px > threshold_value ? 0 : px;
        +
        219  });
        +
        220  }
        +
        221  }
        +
        222 }
        +
        223 
        +
        224 namespace detail{
        +
        225 
        +
        226 template <typename SrcView, typename DstView>
        +
        227 void otsu_impl(SrcView const& src_view, DstView const& dst_view, threshold_direction direction)
        +
        228 {
        +
        229  //deciding output channel type and creating functor
        +
        230  using source_channel_t = typename channel_type<SrcView>::type;
        +
        231 
        +
        232  std::array<std::size_t, 256> histogram{};
        +
        233  //initial value of min is set to maximum possible value to compare histogram data
        +
        234  //initial value of max is set to minimum possible value to compare histogram data
        +
        235  auto min = (std::numeric_limits<source_channel_t>::max)(),
        +
        236  max = (std::numeric_limits<source_channel_t>::min)();
        +
        237 
        +
        238  if (sizeof(source_channel_t) > 1 || std::is_signed<source_channel_t>::value)
        +
        239  {
        +
        240  //iterate over the image to find the min and max pixel values
        +
        241  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        +
        242  {
        +
        243  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        +
        244  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        +
        245  {
        +
        246  if (src_it[x] < min) min = src_it[x];
        +
        247  if (src_it[x] > min) min = src_it[x];
        +
        248  }
        +
        249  }
        +
        250 
        +
        251  //making histogram
        +
        252  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        +
        253  {
        +
        254  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        +
        255 
        +
        256  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        +
        257  {
        +
        258  histogram[((src_it[x] - min) * 255) / (max - min)]++;
        +
        259  }
        +
        260  }
        +
        261  }
        +
        262  else
        +
        263  {
        +
        264  //making histogram
        +
        265  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        +
        266  {
        +
        267  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        +
        268 
        +
        269  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        +
        270  {
        +
        271  histogram[src_it[x]]++;
        +
        272  }
        +
        273  }
        +
        274  }
        +
        275 
        +
        276  //histData = histogram data
        +
        277  //sum = total (background + foreground)
        +
        278  //sumB = sum background
        +
        279  //wB = weight background
        +
        280  //wf = weight foreground
        +
        281  //varMax = tracking the maximum known value of between class variance
        +
        282  //mB = mu background
        +
        283  //mF = mu foreground
        +
        284  //varBeetween = between class variance
        +
        285  //http://www.labbookpages.co.uk/software/imgProc/otsuThreshold.html
        +
        286  //https://www.ipol.im/pub/art/2016/158/
        +
        287  std::ptrdiff_t total_pixel = src_view.height() * src_view.width();
        +
        288  std::ptrdiff_t sum_total = 0, sum_back = 0;
        +
        289  std::size_t weight_back = 0, weight_fore = 0, threshold = 0;
        +
        290  double var_max = 0, mean_back, mean_fore, var_intra_class;
        +
        291 
        +
        292  for (std::size_t t = 0; t < 256; t++)
        +
        293  {
        +
        294  sum_total += t * histogram[t];
        +
        295  }
        +
        296 
        +
        297  for (int t = 0; t < 256; t++)
        +
        298  {
        +
        299  weight_back += histogram[t]; // Weight Background
        +
        300  if (weight_back == 0) continue;
        +
        301 
        +
        302  weight_fore = total_pixel - weight_back; // Weight Foreground
        +
        303  if (weight_fore == 0) break;
        +
        304 
        +
        305  sum_back += t * histogram[t];
        +
        306 
        +
        307  mean_back = sum_back / weight_back; // Mean Background
        +
        308  mean_fore = (sum_total - sum_back) / weight_fore; // Mean Foreground
        +
        309 
        +
        310  // Calculate Between Class Variance
        +
        311  var_intra_class = weight_back * weight_fore * (mean_back - mean_fore) * (mean_back - mean_fore);
        +
        312 
        +
        313  // Check if new maximum found
        +
        314  if (var_intra_class > var_max) {
        +
        315  var_max = var_intra_class;
        +
        316  threshold = t;
        +
        317  }
        +
        318  }
        +
        319  if (sizeof(source_channel_t) > 1 && std::is_unsigned<source_channel_t>::value)
        +
        320  {
        +
        321  threshold_binary(src_view, dst_view, (threshold * (max - min) / 255) + min, direction);
        +
        322  }
        +
        323  else {
        +
        324  threshold_binary(src_view, dst_view, threshold, direction);
        +
        325  }
        +
        326 }
        +
        327 } //namespace detail
        +
        328 
        +
        329 template <typename SrcView, typename DstView>
        +
        330 void threshold_optimal
        +
        331 (
        +
        332  SrcView const& src_view,
        +
        333  DstView const& dst_view,
        + + +
        336 )
        +
        337 {
        +
        338  if (mode == threshold_optimal_value::otsu)
        +
        339  {
        +
        340  for (std::size_t i = 0; i < src_view.num_channels(); i++)
        +
        341  {
        +
        342  detail::otsu_impl
        +
        343  (nth_channel_view(src_view, i), nth_channel_view(dst_view, i), direction);
        +
        344  }
        +
        345  }
        +
        346 }
        +
        347 
        +
        348 namespace detail {
        +
        349 
        +
        350 template
        +
        351 <
        +
        352  typename SourceChannelT,
        +
        353  typename ResultChannelT,
        +
        354  typename SrcView,
        +
        355  typename DstView,
        +
        356  typename Operator
        +
        357 >
        +
        358 void adaptive_impl
        +
        359 (
        +
        360  SrcView const& src_view,
        +
        361  SrcView const& convolved_view,
        +
        362  DstView const& dst_view,
        +
        363  Operator const& threshold_op
        +
        364 )
        +
        365 {
        +
        366  //template argument validation
        +
        367  gil_function_requires<ImageViewConcept<SrcView>>();
        +
        368  gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        369 
        +
        370  static_assert(color_spaces_are_compatible
        +
        371  <
        +
        372  typename color_space_type<SrcView>::type,
        +
        373  typename color_space_type<DstView>::type
        +
        374  >::value, "Source and destination views must have pixels with the same color space");
        +
        375 
        +
        376  //iterate over the image checking each pixel value for the threshold
        +
        377  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        +
        378  {
        +
        379  typename SrcView::x_iterator src_it = src_view.row_begin(y);
        +
        380  typename SrcView::x_iterator convolved_it = convolved_view.row_begin(y);
        +
        381  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
        +
        382 
        +
        383  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        +
        384  {
        +
        385  static_transform(src_it[x], convolved_it[x], dst_it[x], threshold_op);
        +
        386  }
        +
        387  }
        +
        388 }
        +
        389 } //namespace boost::gil::detail
        +
        390 
        +
        391 template <typename SrcView, typename DstView>
        +
        392 void threshold_adaptive
        +
        393 (
        +
        394  SrcView const& src_view,
        +
        395  DstView const& dst_view,
        +
        396  typename channel_type<DstView>::type max_value,
        +
        397  std::size_t kernel_size,
        +
        398  threshold_adaptive_method method = threshold_adaptive_method::mean,
        + +
        400  typename channel_type<DstView>::type constant = 0
        +
        401 )
        +
        402 {
        +
        403  BOOST_ASSERT_MSG((kernel_size % 2 != 0), "Kernel size must be an odd number");
        +
        404 
        +
        405  typedef typename channel_type<SrcView>::type source_channel_t;
        +
        406  typedef typename channel_type<DstView>::type result_channel_t;
        +
        407 
        +
        408  image<typename SrcView::value_type> temp_img(src_view.width(), src_view.height());
        +
        409  typename image<typename SrcView::value_type>::view_t temp_view = view(temp_img);
        +
        410  SrcView temp_conv(temp_view);
        +
        411 
        +
        412  if (method == threshold_adaptive_method::mean)
        +
        413  {
        +
        414  std::vector<float> mean_kernel_values(kernel_size, 1.0f/kernel_size);
        +
        415  kernel_1d<float> kernel(mean_kernel_values.begin(), kernel_size, kernel_size/2);
        +
        416 
        +
        417  detail::convolve_1d
        +
        418  <
        +
        419  pixel<float, typename SrcView::value_type::layout_t>
        +
        420  >(src_view, kernel, temp_view);
        +
        421  }
        +
        422  else if (method == threshold_adaptive_method::gaussian)
        +
        423  {
        +
        424  detail::kernel_2d<float> kernel = generate_gaussian_kernel(kernel_size, 1.0);
        +
        425  convolve_2d(src_view, kernel, temp_view);
        +
        426  }
        +
        427 
        +
        428  if (direction == threshold_direction::regular)
        +
        429  {
        +
        430  detail::adaptive_impl<source_channel_t, result_channel_t>(src_view, temp_conv, dst_view,
        +
        431  [max_value, constant](source_channel_t px, source_channel_t threshold) -> result_channel_t
        +
        432  { return px > (threshold - constant) ? max_value : 0; });
        +
        433  }
        +
        434  else
        +
        435  {
        +
        436  detail::adaptive_impl<source_channel_t, result_channel_t>(src_view, temp_conv, dst_view,
        +
        437  [max_value, constant](source_channel_t px, source_channel_t threshold) -> result_channel_t
        +
        438  { return px > (threshold - constant) ? 0 : max_value; });
        +
        439  }
        +
        440 }
        +
        441 
        +
        442 template <typename SrcView, typename DstView>
        +
        443 void threshold_adaptive
        +
        444 (
        +
        445  SrcView const& src_view,
        +
        446  DstView const& dst_view,
        +
        447  std::size_t kernel_size,
        +
        448  threshold_adaptive_method method = threshold_adaptive_method::mean,
        + +
        450  int constant = 0
        +
        451 )
        +
        452 {
        +
        453  //deciding output channel type and creating functor
        +
        454  typedef typename channel_type<DstView>::type result_channel_t;
        +
        455 
        +
        456  result_channel_t max_value = (std::numeric_limits<result_channel_t>::max)();
        +
        457 
        +
        458  threshold_adaptive(src_view, dst_view, max_value, kernel_size, method, direction, constant);
        +
        459 }
        +
        460 
        +
        462 
        +
        463 }} //namespace boost::gil
        +
        464 
        +
        465 #endif //BOOST_GIL_IMAGE_PROCESSING_THRESHOLD_HPP
        -
        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...
        Definition: threshold.hpp:173
        +
        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...
        Definition: threshold.hpp:174
        -
        threshold_direction
        Definition: threshold.hpp:69
        -
        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 chan...
        Definition: threshold.hpp:147
        +
        threshold_direction
        Definition: threshold.hpp:70
        +
        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 chan...
        Definition: threshold.hpp:148
        nth_channel_view_type< View >::type nth_channel_view(const View &src, int n)
        Definition: image_view_factory.hpp:418
        @ inverse
        Consider values less than or equal to threshold value.
        -
        threshold_optimal_value
        Method of optimal threshold value calculation.
        Definition: threshold.hpp:77
        +
        threshold_optimal_value
        Method of optimal threshold value calculation.
        Definition: threshold.hpp:78
        @ regular
        Consider values greater than threshold value.
        -
        detail::kernel_2d< T, Allocator > generate_gaussian_kernel(std::size_t side_length, double sigma)
        Generate Gaussian kernel.
        Definition: numeric.hpp:129
        -
        threshold_truncate_mode
        TODO.
        Definition: threshold.hpp:84
        -
        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
        +
        detail::kernel_2d< T, Allocator > generate_gaussian_kernel(std::size_t side_length, double sigma)
        Generate Gaussian kernel.
        Definition: numeric.hpp:130
        +
        threshold_truncate_mode
        TODO.
        Definition: threshold.hpp:85
        +
        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:549
        Definition: color_convert.hpp:31
        diff --git a/develop/doc/html/reference/utilities_8hpp_source.html b/develop/doc/html/reference/utilities_8hpp_source.html index d345916d0..3eb8f982e 100644 --- a/develop/doc/html/reference/utilities_8hpp_source.html +++ b/develop/doc/html/reference/utilities_8hpp_source.html @@ -320,7 +320,7 @@ $(function() {
        299 #endif
        point< std::ptrdiff_t > ifloor(point< float > const &p)
        Definition: point.hpp:268
        -
        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
        +
        BOOST_FORCEINLINE auto copy(boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
        Copy when both src and dst are interleaved and of the same type can be just memmove.
        Definition: algorithm.hpp:145
        plus function object whose arguments may be of different type.
        Definition: utilities.hpp:218
        point< std::ptrdiff_t > iceil(point< float > const &p)
        Definition: point.hpp:280
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:266
        diff --git a/develop/doc/html/reference/write__view_8hpp_source.html b/develop/doc/html/reference/write__view_8hpp_source.html index 5f2309194..57af5ad66 100644 --- a/develop/doc/html/reference/write__view_8hpp_source.html +++ b/develop/doc/html/reference/write__view_8hpp_source.html @@ -275,7 +275,7 @@ $(function() {
        Helper metafunction to generate writer type.
        Definition: get_writer.hpp:20
        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)
        Definition: write_view.hpp:196
        -
        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 >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:549
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition: any_image_view.hpp:75
        Definition: device.hpp:643
        Helper metafunction to generate dynamic image writer type.
        Definition: get_writer.hpp:63
        diff --git a/develop/doc/html/search.html b/develop/doc/html/search.html index 0b36b004d..944705175 100644 --- a/develop/doc/html/search.html +++ b/develop/doc/html/search.html @@ -89,7 +89,7 @@ diff --git a/develop/doc/html/toolbox.html b/develop/doc/html/toolbox.html index f7f4d9154..4ee763f5d 100644 --- a/develop/doc/html/toolbox.html +++ b/develop/doc/html/toolbox.html @@ -126,7 +126,7 @@ made suggestions for improvements.

        diff --git a/develop/doc/html/tutorial/gradient.html b/develop/doc/html/tutorial/gradient.html index de568d609..c3e8fd6c0 100644 --- a/develop/doc/html/tutorial/gradient.html +++ b/develop/doc/html/tutorial/gradient.html @@ -953,7 +953,7 @@ code with different compilers.

        diff --git a/develop/doc/html/tutorial/histogram.html b/develop/doc/html/tutorial/histogram.html index dd4415ca1..329854bd9 100644 --- a/develop/doc/html/tutorial/histogram.html +++ b/develop/doc/html/tutorial/histogram.html @@ -171,7 +171,7 @@ memory is allocated and no images are copied.

        diff --git a/develop/doc/html/tutorial/video.html b/develop/doc/html/tutorial/video.html index c5842fca9..fb79a0ebd 100644 --- a/develop/doc/html/tutorial/video.html +++ b/develop/doc/html/tutorial/video.html @@ -82,7 +82,7 @@