-
Notifications
You must be signed in to change notification settings - Fork 170
Port TuttleOFX extension : pattern #581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
meshtag
wants to merge
18
commits into
boostorg:develop
Choose a base branch
from
meshtag:TuttleOFX_pattern
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2b550c2
Added all standard morphological transformations
meshtag 48436fc
Improved comments and some other things
meshtag 14900be
Applied adviced changes
meshtag 53d92b2
Applied adviced changes
meshtag 6ac3102
Should handle grayscale dilation/erosion
meshtag 7e779a9
Checking
meshtag 3aa5d7c
Merge remote-tracking branch 'upstream/develop' into develop
meshtag 73580e1
Merge branch 'develop' of https://github.com/boostorg/gil into develop
meshtag bcfce0b
Merge branch 'develop' of https://github.com/boostorg/gil into tuttle…
meshtag d7a3e88
Port TuttleOFX pattern extension
meshtag 4c06300
Remove unnecessary namespace resolution
meshtag 368ada5
Use better variable types
meshtag e14ce81
Improve error catching mechanism
meshtag f7ef520
Improve formatting
meshtag 17fdd4e
Merge branch 'develop' of https://github.com/boostorg/gil into Tuttle…
meshtag 216f956
Modified as per first review and compiler warnings suppression
meshtag ae8d9bb
Improve variable handling
meshtag 1284963
Provide alphabetical ordering in build instruction files
meshtag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
include/boost/gil/extension/toolbox/metafunctions/pattern.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // Copyright Tom Brinkman 2008. Distributed under the Boost | ||
| // Software License, Version 1.0. (See accompanying | ||
| // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| #ifndef _pattern_hpp_ | ||
| #define _pattern_hpp_ | ||
|
|
||
| #include <boost/gil.hpp> | ||
|
|
||
| namespace boost { namespace gil { | ||
|
|
||
| /// \brief Repeatedly copies smaller image view passed through the struct constructor in subimage | ||
| /// views of the larger image view passed through overloaded '()' operator. | ||
| template <typename view_t> | ||
|
meshtag marked this conversation as resolved.
Outdated
|
||
| struct pattern | ||
| { | ||
| view_t v2; | ||
| pattern(view_t v2) | ||
| : v2(v2) | ||
| { | ||
| } | ||
|
|
||
| void operator()(view_t& view) | ||
| { | ||
| using namespace boost::gil; | ||
|
meshtag marked this conversation as resolved.
Outdated
|
||
|
|
||
| std::size_t h = v2.height(), w = v2.width(); | ||
|
meshtag marked this conversation as resolved.
Outdated
|
||
|
|
||
| // For ensuring that view passed through '()' operator has dimensions greater than or | ||
| // equal to the dimensions of view passed through constructor. | ||
| if (h > view.height() || w > view.width()) | ||
| { | ||
| throw std::length_error("Image view passed through overloaded '()' operator must have" | ||
| " dimensions greater than or equal to the dimensions of image view passed through" | ||
| " struct constructor"); | ||
| } | ||
|
|
||
| for (std::ptrdiff_t x = 0; x < view.width(); x += w) | ||
| { | ||
| for (std::ptrdiff_t y = 0; y < view.height(); y += h) | ||
| { | ||
| std::ptrdiff_t aw = w; | ||
| if (x + w > view.width()) | ||
| { | ||
| std::ptrdiff_t t = x + w - view.width(); | ||
| aw = w - t; | ||
| } | ||
|
|
||
| std::ptrdiff_t ah = h; | ||
| if (y + h > view.height()) | ||
| { | ||
| std::ptrdiff_t t = y + h - view.height(); | ||
| ah = h - t; | ||
| } | ||
|
|
||
| view_t v3 = subimage_view(view, x, y, aw, ah); | ||
| view_t v4 = subimage_view(v2, 0, 0, aw, ah); | ||
| copy_pixels(v4, v3); | ||
| } | ||
| } | ||
| } | ||
| }; // pattern | ||
| }} // namespace boost::gil | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,237 @@ | ||
| // | ||
| // Copyright 2021 Prathamesh Tagore <prathameshtagore@gmail.com> | ||
| // | ||
| // Use, modification and distribution are subject to the Boost Software License, | ||
| // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | ||
| // http://www.boost.org/LICENSE_1_0.txt) | ||
| // | ||
|
|
||
| // Reference for test case was taken from | ||
| // https://github.com/tuttleofx/TuttleOFX/blob/develop/libraries/boostHack/boost/gil/extension/toolbox/pattern.tests.cpp | ||
|
|
||
| #include <boost/gil/extension/toolbox/metafunctions.hpp> | ||
| #include <boost/core/lightweight_test.hpp> | ||
| #include <vector> | ||
|
|
||
| namespace gil = boost::gil; | ||
|
|
||
| // This function helps us fill pixels of a rgb view given as 2nd argument with | ||
| // elements of the vector given as 1st argument. | ||
| void pixel_fill_rgb(std::vector<std::vector<std::vector<int>>>& vec, | ||
| gil::rgb8_image_t& img) | ||
| { | ||
| for (std::ptrdiff_t view_row = 0; view_row < view(img).height(); ++view_row) | ||
| { | ||
| for (std::ptrdiff_t view_col = 0; view_col < view(img).width(); ++view_col) | ||
| { | ||
| gil::view(img)(view_col, view_row) = gil::rgb8_pixel_t(vec[view_row][view_col][0], | ||
| vec[view_row][view_col][1], vec[view_row][view_col][2]); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| int main() | ||
| { | ||
| std::vector<std::vector<std::vector<int>>> original_img_vector { | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}} | ||
| }; | ||
|
|
||
| std::vector<std::vector<std::vector<int>>> expected_img_vector { | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0} ,{ 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}}, | ||
| {{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, | ||
| { 0, 0, 0}, { 0, 0, 0}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}}, | ||
| {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, {255, 255, 255}, | ||
| {255, 255, 255}, {255, 255, 255}, {255, 255, 255}} | ||
| }; | ||
|
|
||
| gil::rgb8_image_t original_img(16, 16), expected_img(33, 17), obtained_img(33, 17); | ||
| gil::rgb8_view_t original_img_view = gil::view(original_img); | ||
| gil::rgb8_view_t obtained_img_view = gil::view(obtained_img); | ||
|
|
||
| pixel_fill_rgb(original_img_vector, original_img); | ||
| pixel_fill_rgb(expected_img_vector, expected_img); | ||
|
|
||
| gil::pattern<gil::rgb8_view_t> pattern(original_img_view); | ||
| pattern(obtained_img_view); | ||
|
|
||
| BOOST_TEST(gil::equal_pixels(obtained_img_view, gil::view(expected_img))); | ||
|
|
||
| return boost::report_errors(); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.