Commit Graph

849 Commits

Author SHA1 Message Date
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
Stefan Seefeld
0fe841f2bf Fix setup logic to also work with differently named GIL forks. (#306) 2019-06-04 09:05:53 +02:00
Mateusz Łoskot
baeac8ce87
Disable BOOST_GIL_USE_CONCEPT_CHECK when compiling tests with clang (#304)
Avoid Clang flooding with non-disableable warnings like:

   T does not declare any constructor to initialize its non-modifiable members

when compiling with concepts check enabled.

Bug 41759: `warn_no_constructor_for_refconst` can not be disabled (Boost.ConceptCheck)
https://bugs.llvm.org/show_bug.cgi?id=41759
2019-06-02 06:13:04 +02:00
Mateusz Łoskot
3877432826
Fix project name in comment [ci skip] 2019-05-31 22:58:11 +02:00
Mateusz Łoskot
3e043a41a2
Define WIN32 macro to make LibRaw happy (#303)
Apparently, for some not entirely clear reasons, possibly historical
use of `.vcproj`, LibRaw uses (not defines!) `WIN32` macro, instead of
C standard compliant `_WIN32` common to majority of compilers on Windows.

This patch is required if GIL IO is used with Boost.Build or custom
Makefile, without this custom `WIN32` hand-rolled in build configuration.

Hopefully, LibRaw may accept some clean up for this in near future:
https://github.com/LibRaw/LibRaw/pull/206
2019-05-31 22:41:22 +02:00
Mateusz Łoskot
5024f6ffdd
Guidelines: increase line length limit to 100 characters [ci skip] 2019-05-31 22:07:48 +02:00
Mateusz Łoskot
628bfc2b65
Add minimal top-level Jamfile to run test/ project
Related to #302
2019-05-28 21:31:40 +02:00
Mateusz Łoskot
4ed7701b47
Move tests of extensions inside test/ directory (#302)
Split header tests accordingly i.e. test core headers as part of
core tests, numeric extension headers as part of numeric tests, etc.

It extends the convention of sub-directories already established in
`include/boost/gil` directory. It is sensible to follow it in other
areas of the source tree (i.e. `test/`, `doc/` and `benchmark/`).

Another important reason to move the tests is to enable removal of
the top-level `Jamfile` with all its definitions of test-specific
requirements.
The top-level `Jamfile` is not advised, especially if it specifies
build requirements like C++ language version.
Those affect non-tests builds e.g. documentation, causing failures
during generation of HTML documentation (leads to missing docs).
2019-05-28 18:58:22 +02:00
Mateusz Łoskot
446a35ba84
Ignore files generated by documentation build [skip ci] 2019-05-27 19:40:06 +02:00
Mateusz Łoskot
a6283366a2
Fix remote URL [skip ci] 2019-05-27 17:31:22 +02:00
Mateusz Łoskot
43908adccc
Tweak info on adding remote [skip ci] 2019-05-27 17:30:01 +02:00
Mateusz Łoskot
d60a9c1886
Add missing word [ci skip] 2019-05-27 17:15:52 +02:00
Mateusz Łoskot
72dae8b572
Update procedure of updating pull request [skip ci] 2019-05-27 17:12:36 +02:00
Mateusz Łoskot
9418bafc0b
[editorconfig] Add guidelines at 80 and 90 column [ci skip]
The setting is very handy for IDE extensions like this one for VS
https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelines
2019-05-26 22:54:06 +02:00
Mateusz Łoskot
1b44f169f8
Remove unused Quickbook and HTML files (#301)
Removed files are remains of old documentation.
Content of those files has already been moved to .rst files.
2019-05-25 15:49:28 +02:00
Mateusz Łoskot
e56761e670
[travis] Add explicit dist:xenial [skip appveyor]
As tests seem to confirm, Travis may build forks auto-selecting
Xenial or Trusty. For example, Xenial for boostorg/gil and
Trusty for mloskot/gil.

[skip azp]
2019-05-23 12:54:47 +02:00
Mateusz Łoskot
d0cb17adef
[travis] Remove llvm-toolchain-trusty-6.0 source [skip appveyor]
Packages clang-6.0 (and 4.0 and 5.0) are available from Xenial's
default Apt package sources.

[skip azp]
2019-05-23 12:15:10 +02:00