2
0
mirror of https://github.com/boostorg/gil.git synced 2026-01-28 07:12:14 +00:00
Commit Graph

765 Commits

Author SHA1 Message Date
Mateusz Łoskot
055ee947a0 Clean up and refactor extension/numeric/convolve.hpp
- Tidy up formatting and code flow for readability
- Rename parameters for clarify, avoiding abbreviations
- Rename typedefs in CamelCase style instead of UPPER_CASE
- Add Doxygen comments and placeholders for documentation content to fill
2019-07-22 13:23:24 +02:00
Pranam Lashkari
2c4529ed95 Add convolve function in Numeric extension (#347)
This function combines both `convolve_rows` and `convolve_cols` into
single call for user convenience
2019-07-22 11:20:57 +02:00
Mateusz Łoskot
d86e4a4dec Bump Sphinx version from 1.7.9 to 2.1 (#346)
Fixes #345
2019-07-22 01:49:47 +02:00
Mateusz Łoskot
5c1754bc2f Link to documentation built from develop in README [ci skip] 2019-07-22 01:43:14 +02:00
Mateusz Łoskot
24468697f5 [travis] Dump version of installed Sphinx 2019-07-22 00:20:11 +02:00
Mateusz Łoskot
6b181acce2 [doc] Split tutorial into separate documents for quickstart section [ci skip] (#325)
Split the table of contents into two section:
  - Quickstart materials
  - Detailed documentation
Move doc/before_after.dox to tutorial/histogram.rst (closes #286).
Tidy up tutorial reST paragraphs, mark-up and code samples.
2019-07-21 20:54:03 +02:00
MIRAL SHAH
6bdc48c615 Otsu threshold implemented (#314)
closes #311
2019-07-20 03:10:25 +05:30
Mateusz Łoskot
516ee84f1c Include <iostream> only if BOOST_GIL_TEST_DEBUG defined [ci skip] 2019-07-18 23:01:20 +02:00
Mateusz Łoskot
584cdd4e23 Modify random_value fixture test to cope with repeated values (seeding issue) 2019-07-18 21:37:39 +02:00
Mateusz Łoskot
89436c9cdc Include boost/core/typeinfo.hpp where used
Refines #338
2019-07-18 19:57:19 +02:00
Mateusz Łoskot
dafcaa169e Extract GIL-specific Boost.Test utilities from test/unit_test.hpp (#338)
Add separate header `test/unit_test_utility.hpp` for printers and
other utilities for better integration of GIL types with Boost.Test.
2019-07-18 17:49:05 +02:00
Mateusz Łoskot
69adf0e8a5 Fix ENABLE_GRAY_ALPHA macro name to BOOST_GIL_IO_ENABLE_GRAY_ALPHA 2019-07-17 22:05:13 +02:00
MIRAL SHAH
8234329237 New threshold tests added for multi-channel views 2019-07-18 01:32:29 +05:30
Mateusz Łoskot
d7884ee1a6 Fix parameters type of subimage_view functions in core and dynamic_image (#337)
Align with `subsampled_view` overloads accepting `point_t` and `coord_t`
Both types are based on `std::ptrdiff_t`. Fixes compilation warnings.
Tidy up `subimage_view` and `subsampled_view` with trailing return.
Add tests for `subimage_view` in core and dynamic_image extension.
(First tests for the dynamic_image, hurray! :))

Add explicit cast to double in division operator for point<T> to
fix compilation warnings.
2019-07-16 13:05:48 +02:00
Mateusz Łoskot
b1a382c45b Compare float-pointing value to zero using <= operator (#336) 2019-07-16 02:33:19 +02:00
Mateusz Łoskot
73314b19a6 [numeric] Correct name of BOOST_TEST_MODULE [ci skip] 2019-07-14 23:00:47 +02:00
Mateusz Łoskot
9ce3f08a36 Add first tests for convolve functions from Numeric extension (#335)
First stab at convolution tests includes cases with the identity kernel.
Move `pixel`-s streaming facility used by Boost.Test (required  by
`BOOST_TEST` macro) to the common header for re-use in other tests.
2019-07-14 21:43:32 +01:00
Mateusz Łoskot
da2e4722bf threshold.hpp: Remove unused type alias 2019-07-14 17:24:47 +02:00
Mateusz Łoskot
2bdaa622bf Add Image Processing section to Doxygen-based docs (#334) [ci skip] 2019-07-12 15:56:52 +01:00
Mateusz Łoskot
199bec1eae Tidy up GitHub templates using comments [ci skip] 2019-07-12 15:08:20 +01:00
Mateusz Łoskot
48679777d7 Fix error: RView identifier not found in planar_rgba_view (#332)
Add basic run-time test of `planar_rgba_view` function.
Add missing includes of `pixel.hpp` and `planar_pixel_reference.hpp`
also required for successful compilation.

Fixes #331
2019-07-12 12:32:17 +01:00
MIRAL SHAH
3f42ff847d comparison operator changed to > from >= for threshold value comparison 2019-07-11 04:18:12 +05:30
Mateusz Łoskot
0809f2de71 Add color_spaces_are_compatible requirement as static_assert to threshold (#329)
Since use of `gil_function_requires` check is optional, it can be
disabled by not defining `BOOST_GIL_USE_CONCEPT_CHECK`, we need
a mandatory form of the check.
Add compile-time test verifying the static assertion.
Closes #323
2019-07-10 11:20:41 +01:00
Mateusz Łoskot
35a5bdc190 Add image_processing/scaling.hpp to boost/gil.hpp (#330) 2019-07-10 09:59:42 +02:00
Mateusz Łoskot
bf8e0dd1cf Add threshold_truncate.cpp missing from Jamfile 2019-07-10 09:44:18 +02:00
Mateusz Łoskot
266bf414aa Tidy up headers in gil/image_processing/ directory (#326)
Add missing `inline` specifier for tiny functions.
Add missing include guards.
Add missing copyright notice.
Remove superfluous `boost::gil::` namespace qualifiers.
Make use of 100 characters line length limit:
 - Remove superfluous newlines to avoid too much of vertical stretch.
 - Tidy up Doxygen comments.
2019-07-09 10:01:43 +02:00
Tyler Deuty
92c8cc72e4 Add suppressive parentheses for function-like macro (#328)
Work around clash between min/max macros defined in Windows SDK
headers and C++ functions like std::min/max, std::numeric_min/max,
without requiring users to #define NOMINMAX.
2019-07-09 10:01:01 +02:00
Mateusz Łoskot
5ec5566fe4 [doc] Removed unused files (#327) [ci skip]
The following files have been deleted:

- doc/adobe_logo.gif
- doc/adobe_source.css
- doc/boost.png
- doc/build.sh
- doc/rst.css
- doc/shorten_file_name.sh
2019-07-09 09:45:18 +02:00
Mateusz Łoskot
c3e84adbd7 [doc] Fix incomplete code-block directive [skip appveyor]
Tidy up paragraph reformatting.
2019-07-08 19:08:26 +02:00
Mateusz Łoskot
7a51663dd8 [doc] Fix inconsistent reST sections markup [skip appveyor]
Use code-block directive for code blocks.
Apply 79 line length limit to according to doc8 linter for Python
and reStructuredText.

[skip azp]
2019-07-08 18:09:54 +02:00
Mateusz Łoskot
5406038385 Add documentation build steps to doc/README.md 2019-07-08 18:09:35 +02:00
Mateusz Łoskot
02064f9743 Set max line length to 79 for .rst documents according to reST linter 2019-07-08 15:33:07 +02:00
Mateusz Łoskot
74c497c36f Apply the rule of three in memory_based_2d_locator and iterator_from_2d (#324)
Add copy assignment operator to memory_based_2d_locator and iterator_from_2d.
Add copy constructor to image_view which already has copy assignment operator.

Fix GCC 9 warning -Wdeprecated-copy that:

  "implicit declaration of a copy constructor or copy assignment operator
  is deprecated if the class has a user-provided copy constructor or
  copy assignment operator, in C++11 and up."
2019-07-07 13:58:04 +02:00
Mateusz Łoskot
cbc0a30ae8 Fix Slack channel name [ci skip] 2019-07-07 00:04:58 +02:00
Mateusz Łoskot
08c546dc7f Add VS2019 and WSL configuration to CMakeSettings.json [ci skip] 2019-07-07 00:02:24 +02:00
Mateusz Łoskot
ee169ef104 Unify names of files and targets of image processing tests [skip ci] 2019-07-05 00:20:38 +02:00
Mateusz Łoskot
1400b6df79 Ignore VSCode's *.code-workspace files [skip ci] 2019-07-05 00:07:59 +02:00
Mateusz Łoskot
bd91abfff3 Add cmake-variants.yaml sample for Visual Studio Code + CMake Tools [skip ci] 2019-07-04 23:57:30 +02:00
Mateusz Łoskot
ab4c686970 [numeric] std::extent not usable to obtain size of kernel_1d_fixed (#320)
Use of `std::extent` was introduced in PR #200 but it turns out as
not applicable for `std::array` or derived types (e.g. `kernel_1d_fixed`).
This led to obtaining invalid size of `kernel_1d_fixed` and erroneous
results of the rows and columns convolution.
This change replaces `std::extent` with new public constant member
`kernel_1d_fixed::static_size`.

Since `kernel_1d_fixed` is derived from `std::array`, the Alternative
could be to use `std::tuple_size` specialization for `std::array`.

Add static assertion to require that kernel size must be odd to
ensure validity at the center.
2019-07-04 20:45:33 +02:00
Mateusz Łoskot
48b5ec4e68 Update example/cmake/CMakeSettings.json [ci skip] 2019-07-04 20:23:54 +02:00
Mateusz Łoskot
dfbbec1531 [circleci] Deal with b2 increased default of parallel jobs [skip appveyor]
Attempt to fix random failures suddenly happening on CircleCI,
likely due to memory issues:

    g++: internal compiler error: Killed (program cc1plus)

[skip travis]
[skip azp]
2019-07-03 21:00:03 +02:00
Mateusz Łoskot
7f23184076 Add basic test for color base algorithm: static_transform (#319)
The test also illustrates and verifies that the `static_transform` is
constrained by the size of destination color base. That is, it is
applicable if the source color base has number of elements equal-to or
greater-than the destination color base.
2019-07-03 07:40:48 +02:00
Mateusz Łoskot
c6cb094ce9 Clarify use of gray_layout_t in homogeneous_color_base tests for N>1 2019-07-02 20:21:53 +02:00
Mateusz Łoskot
67c3ac77c9 Add kernel test to numeric/Jamfile (#318)
Change missing from #317
2019-06-30 20:52:41 +02:00
Mateusz Łoskot
b4a69319bc Add tests for kernel_1d and kernel_1d_fixed classes (#317)
Add FIXME and TODO comments about issues that needs to be clarified.
2019-06-29 10:38:24 +02:00
Olzhas Zhumabek
cf897c5969 Implementation of lanczos down scaling (#309)
* Simple implementation of lanczos scaling

* Simple implementation of lanczos scaling

* Refactor lanczos into separate header

This commit moves the algorithm
into its own header. It also provides
templated interface now, utilizing
a little bit of decltype and declval
to resolve types for lambdas and stuff

* Zero pixel at start of lanczos_at

This commit fixes a possible bug and
fixes some style incosistencies

* Improve documentation for Lanczos

This commit adds documentation which
describes when to use the algorithm,
a brief description of how it is
supposed to work, and some caution
on the quality of the output

* Address style issues and fix warnings

This commit fixes a style issue realted
to namespace declaration and
fixes a warning in added zeroing of
a pixel at start of lanczos

* text-realign function arguments

* fix formatting issues

* Implement handful of sanity tests

This commit introduces a couple of
sanity tests such as black image
scaling to black image, and lanczos
response being 0 at x = 0

* bracket on newline for for loops

* add lanczos scaling to tests

* more precision in lanczos calculation

This commit migrates integral values
to double precision and uses PI
provided by boost.Math. These changes
solve downscaled image being darker

* Simple implementation of lanczos scaling

* Refactor lanczos into separate header

This commit moves the algorithm
into its own header. It also provides
templated interface now, utilizing
a little bit of decltype and declval
to resolve types for lambdas and stuff

* Zero pixel at start of lanczos_at

This commit fixes a possible bug and
fixes some style incosistencies

* Improve documentation for Lanczos

This commit adds documentation which
describes when to use the algorithm,
a brief description of how it is
supposed to work, and some caution
on the quality of the output

* Address style issues and fix warnings

This commit fixes a style issue realted
to namespace declaration and
fixes a warning in added zeroing of
a pixel at start of lanczos

* text-realign function arguments

* fix formatting issues

* Implement handful of sanity tests

This commit introduces a couple of
sanity tests such as black image
scaling to black image, and lanczos
response being 0 at x = 0

* bracket on newline for for loops

* add lanczos scaling to tests

* more precision in lanczos calculation

This commit migrates integral values
to double precision and uses PI
provided by boost.Math. These changes
solve downscaled image being darker

* Add Jamfile for ip test directory

Add Jamfile for image_processing
test directory and build-project
from outer test directory

* Add IP test directory to ci build

This commit adds a line at the end
of .ci/build-and-test.sh to include
image processing tests in CI builds

* Remove redundant lines from Jamfile

Simplify Jamfile at
test/image_processing

* Rewrite range condition

x > -a && x < a exchange with
-a < x && x < a in lanczos

* Add newline at the end of files

* Add math and lexical_cast to get-boost

As math and lexical_cast are used
in lanczos scaling, both were added
to get-boost

* Revert "Add newline at the end of files"

Since Boost.Math.Constants is
overengineered for use case by
requiring Boost.lexical_cast or
a global define, it is removed

This reverts commit 0743ab072ff3455421853697f7f46aee7d22382c.

* Define pi and use in lanczos

Value of pi is moved out into detail
and used by lanczos

* Move image_processing to test/core

* formatting fixes

* Adjust CMakeLists for moved IP tests

This commit removes image_processing as
subdirectory from test/ and adds to
test/core's CMakeLists

* Remove unused from get-boost

Since lanczos scaling no longer uses
boost.math.constants, lexical_cast
has been removed as well

* Downgrade math to transitive dep

This is a stray change left from
my incorrect resetting of the HEAD
on lanczos branch

* Remove unnecessary includes

io includes are not used in lanczos
scaling test, and they break build

* Fix ambiguous overload issue for min

Since width() and height()  now return
std::ptrdiff_t, call to std::min needs
a cast. There was also shadowing of
pi declared in detail/math.hpp,
which is also fixed

* Apply mloskot's patch

The patch provided by Mateusz changes
all usages of long int into ptrdiff_t,
which is returned by width() and
height() functions of image_view

* Apply .editorconfig rules

This commit is a simple reformat of
affected files

* Use aliases x_coord_t and y_coord_t

The change converges integer handling
in arguments, using view' type aliases.
View arguments have to come first to
avoid non-deduced context problem.
Also replaced long int with ptrdiff_t
in lanczos, in numeric.hpp file

* Apply alias usage for rest of the code

Some places with ptrdiff_t were
left out from previous commit, so they
are changed in this one. Plus a fix for
max call being ambiguous.

* Replace all literals with casted vars

This commit takes extreme stance of
never using an integer literal due to
problems in ambiguity of deduction of
min and max functions

* Fix unenclosed foreach

During rebase of gsoc2019 onto develop,
I didn't enclose first foreach with
matching endforeach, hence tests failed
2019-06-23 13:14:23 +03:00
MIRAL SHAH
716fe9ad8c Implement algorithms for binary and binary inverse thresholding (#313)
Add public functions threshold_binary and threshold_truncate.
Add tests and example.
Closes #310
2019-06-18 21:42:43 +02:00
Mateusz Łoskot
698d83c60f [cmake] Build conan package from sources if missing [ci skip] 2019-06-05 23:44:07 +02:00
Mateusz Łoskot
3d6deaeff8 Restore running of legacy tests on Travis CI and AppVeyor (#308)
Remove .ci/build-and-test.sh as unused (commands moved to.travis.yml).
2019-06-05 22:50:36 +02:00
Mateusz Łoskot
895aa77fb6 [CMake] Remove GIL_DOWNLOAD_FINDBOOST option (#307)
Upcoming CMake 3.15 introduced more dependencies in FindBoost.cmake
what makes the downloading impractical.
2019-06-05 09:19:17 +02:00