2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-19 14:32:10 +00:00
Commit Graph

494 Commits

Author SHA1 Message Date
Mateusz Loskot
443eaa5fae Fix compilation of subchroma_image.hpp as self-contained headers (#176)
Rename `Scaling_Factors` to lower-case, as well as its template parameters.
Move `scaling_factors` to namespace `detail` and before it is use.
Fix access to `scaling_factors` members in derived classes.
Add missing `typename`.
Remove superfluous thus incorrect `typename`.
Remove `subchroma_image_view` implicit friends with self
- Fixes template parameter aliasing for Locator and Factors.

Subset of fixes from pending PR #164
2018-12-07 16:00:17 +01:00
Mateusz Łoskot
c1334b60fe Refer to EditorConfig that helps to avoid trailing whitespaces [ci skip]
Following #171 we should keep the code free from trailing whitespaces.
2018-12-07 10:10:54 +01:00
Mateusz Loskot
9e9ed7c239 Add missing #include-s to ensure self-contained headers (#175) 2018-12-07 09:50:52 +01:00
Mateusz Łoskot
1075967712 Move self-contained headers test to test/headers
Modify Boost.Jam script generating tests to support targets per the library
directories/modules.
2018-12-06 22:35:39 +01:00
Mateusz Łoskot
af4f0ef7f1 Update CONTRIBUTING.md for CMake 3.13 or later [ci skip]
Follows up recent CMake fixes in FindBoost.cmake:
- https://gitlab.kitware.com/cmake/cmake/merge_requests/2568
- https://gitlab.kitware.com/cmake/cmake/merge_requests/2579
2018-12-06 21:03:36 +01:00
Mateusz Loskot
40241a6efb Reformat boost/gil/concepts/*.hpp to limit line length to 90 characters (#173)
Replace `typedef` with using declaration.
Replace complex return type declared for functions with trailing return type and `auto`.
Format complex metaprogramming constructs in clear and readable way.
Remove superfluous `public` access specifier from `struct` inheritance.
Rename ambiguous type aliases.
Make template parameters
- upper-case (if initials e.g. `CS`)
- camel-case if multi-word (e.g. `ColorSpace`).
2018-12-06 19:11:58 +01:00
Samuel Debionne
edcc912ceb Update design_guide.rst (#172)
Follows up #83 that replaced bitsN[s] aliases with C++11 types
2018-12-06 13:41:13 +01:00
Mateusz Loskot
66bb07d02b Trim trailing whitespaces in all source code files (#171)
PowerShell script used to perform the trimming:

Get-ChildItem -Recurse -Include @("*.cpp", "*.hpp") |
  ForEach-Object { (Get-Content $_.FullName)
      | Foreach {$_.TrimEnd()} | Set-Content $_.FullName }
2018-12-05 08:51:33 +01:00
Mateusz Łoskot
42a14c1f4c Fix Sphinx warnig about html_add_permalinks type [ci skip]
WARNING: The config value `html_add_permalinks' has type `bool',
         defaults to `str'.
2018-11-20 19:41:36 +01:00
Mateusz Łoskot
c683fd45b1 Remove Exhale from doc/requirements.txt [ci skip] 2018-11-20 16:09:19 +01:00
Mateusz Łoskot
4bd08aac67 Start doc/README.md document [ci skip]
Add Python pip requirements.txt (preparing for Exhale prototype).
2018-11-20 15:59:01 +01:00
Mateusz Loskot
7b5b01ec14 Split single boost/gil/concepts.hpp into boost/gil/concepts/*.hpp (#169) 2018-11-17 23:36:29 +01:00
Mateusz Łoskot
28df5bc482 Clean up several warnings about unreferenced formal parameters
Add comment to premultiply.hpp:
- FIXME: Is c input paramater not used intentionally?
boost-1.69.0-beta1 boost-1.69.0
2018-10-29 15:26:53 +01:00
Mateusz Łoskot
5fd0f7878c [cmake] Prefix status messages with Boost.GIL for source clarity [ci skip]
Remove GIL_USE_BOOST_STAGE as unnecessary.
Download FindBoost.cmake for <3.13 - this module in CMake 3.13
received some important updates.
2018-10-29 14:01:48 +01:00
Mateusz Loskot
3947b798fb Remove dependency on boost/algorithm/clamp.hpp (#159)
Copy boost::algorithm::clamp to where it was solely used in Toolbox.
Remove typename where not needed thus not allowed:
- fixes error: expected nested-name-specifier
- GCC and clang issue diagnostics; latest MSVC does not, seems not even
  parsing templates until they are used.
2018-10-29 13:48:15 +01:00
Mateusz Loskot
31d58273f6 [cmake] Fix missing hyphen in -D option [ci skip] 2018-10-25 21:18:53 +02:00
Mateusz Łoskot
52cbffd661 [cmake] Add tips on how to troubleshoot CMake faliures to find Boost [ci skip] 2018-10-25 17:42:29 +02:00
Mateusz Loskot
4bd51cdba5 Fix undefined behaviour due to unsequenced side effects of same scalar (#163) 2018-10-25 13:38:22 +02:00
Mateusz Łoskot
1faab668e2 [toolbox] Fix warning due to implicit int to uint8_t conversion 2018-10-24 18:12:16 +02:00
Mateusz Łoskot
4284d2d4dd [toolbox] Fix warning due to implicit int to uint8_t conversion 2018-10-24 17:59:24 +02:00
Mateusz Łoskot
ed5010901f [cmake] Add sample CMakeSettings.json for Visual Studio 2017 [ci skip]
The file is provided for convenience as an example ready to use for most
situations though. It is ignored in GIL root directory.
2018-10-24 17:19:51 +02:00
Mateusz Loskot
a1c966dd9b Fix point<T> divide and multiply to not to hardcode result as point<double> (#157)
The free variants of operator/ and operator* now yield new
type of point<T> with T promoted to type common for both operands.

Add missing member operator*=, for symmetry.
Add template function iround(point<T>) as no-op sink for point
specialisations for T of integer types.
Add explicit casts of arithmetic intermediate results to avoid
compilation warnings.
Replace redundant point<T> construction in return statement with uniform
initialization.
Add static_assert validating range of axis_value integer template parameter.

Update test/point/point.cpp with basic checks of all point<T> members.

Fixes #153
2018-10-24 15:08:39 +02:00
Mateusz Loskot
c1e590591d Remove dependency on boost/config/no_tr1/cmath.hpp (#162) 2018-10-24 10:53:47 +02:00
Mateusz Loskot
e286137e55 Remove dependency on boost/algorithm/string.hpp as unused (#158) 2018-10-24 09:42:17 +02:00
Mateusz Loskot
e3912d81c4 [travis] Switch Boost super-project to develop branch [skip appveyor] (#161)
Currently, we are experiencing UBSan builds failures due to issues in
Boost.Function version attached to Boost super-project.
Build UBSan with b2 visibility=global instead of default hidden.

Detailed discussions at:
- https://github.com/boostorg/function/pull/29
- https://lists.boost.org/boost-gil/2018/10/0100.php

Note, we are switching temporarily and we should switch back to
testing against Boost super-project master branch
- a stable Boost version closest to the next release state.
2018-10-23 21:51:51 +02:00
Mateusz Łoskot
3b8398f17c Fix version.hpp include guard name [ci skip] 2018-10-22 15:05:21 +02:00
Mateusz Loskot
53dc1a6949 Add basic tests for point<T> (#156) 2018-10-20 16:35:29 +02:00
Mateusz Łoskot
9b89b4fd9d [cmake] Add test/image_view to CMake configuration
[ci skip]
2018-10-20 00:07:56 +02:00
Mateusz Łoskot
9426683651 [cmake] Add CMakeLists.txt for test/algorithm
Do not link lightweight_test-based tests against Boost.Test libraries.
Tidy up.

[ci skip]
2018-10-19 23:50:30 +02:00
Mateusz Łoskot
02dc9aadeb Ignore CMakeSettings.json [ci skip] 2018-10-19 22:50:17 +02:00
Mateusz Łoskot
1ca412691c Update b2 commands for Boost libraries [ci skip]
Show how to get complete staged build using versioned layout.
Tidy up.
2018-10-19 22:34:25 +02:00
Mateusz Łoskot
347f8ad123 [CMake] Improve FindBoost.cmake auto-update procedure [ci skip]
Rename the CMake option, add informative messages to
explain some troubleshooting tricks.
2018-10-19 19:08:33 +02:00
Mateusz Łoskot
4e5ffae00d Remove CMakeSettings.json for VS2017 as user-specific file [ci skip]
This is a local file with user-specific settings which does not fit into
the public git repository.
2018-10-19 19:07:05 +02:00
Mateusz Loskot
ce82941fa2 Rename point2<T> to point<T> (#155)
Add point2<T> alias template for backward compatibility with Boost <=1.68.
Replace multiple point_t aliases of point<ptrdiff_t> with single defined
in point.hpp. The point_t is common used to represent dimensions.
Replace many uses of point<ptrdiff_t> with point_t.

Apply reformatting around point2 changes to respect the line length limit.

Follows up discussion in #154
2018-10-19 09:32:23 +02:00
Mateusz Loskot
b4c3a69479 Extract point2<T> from utilities.hpp to point.hpp (#154)
The point belongs to core basic concepts in GIL, not an optional
utility. The tutorial starts with description of point.
Such core concepts are defined in dedicated headers which is quite
a useful convention that also makes the code structure clearer.

Remove from trivial point2 class superfluous empty destructor,
copy constructor, assignment operator.

Clean up point.hpp formatting (eg. respect line length limit).

Co-authored-by: Nikita Kniazev @Kojoley
2018-10-18 21:38:14 +02:00
Mateusz Łoskot
acd626c45e Fix warning: extra tokens at end of #endif directive 2018-10-15 22:15:30 +02:00
Mateusz Loskot
47ac718a13 Merge pull request #152 from mloskot/ml/trac-ticket-7189
Fix conflict with std::fill_n and boost::range::fill_n (Trac 7189)
2018-10-13 21:37:41 +02:00
Mateusz Łoskot
875136885a Fix conflict with std::fill_n and boost::range::fill_n (Trac 7189)
Add minimal test for the std::fill and boost::array or std::array as
pixel type.
2018-10-12 18:34:28 +02:00
Mateusz Loskot
1f1f8836ca Merge pull request #147 from mloskot/ml/add-headers-compile-test
Add test to verify headers are self-contained
2018-10-05 21:35:16 +02:00
Mateusz Łoskot
9dc67eae1d Add test to verify headers are self-contained
For each header, a translation unit is generated along with
corresponding compile target.
Currently, only boost/gil/*.hpp and boost/gil/io/* headres are included.

On CI services, compile self_contained_headers targets only if
TEST_HEADERS environment variable is set. This is to avoid build
timeouts due to CI services limits.
When running b2 locally, the tests are compiled by default.
2018-10-05 18:11:08 +02:00
Mateusz Loskot
aa323e1dc6 Merge pull request #146 from mloskot/ml/fix-some-gcc-warnings
Fix some gcc warnings
2018-10-04 20:29:44 +02:00
Mateusz Loskot
0e8336fd34 Merge pull request #148 from mloskot/ml/fix-self-contained-headers
Add #include directives with missing headers
2018-10-04 20:06:37 +02:00
Mateusz Łoskot
244be70c1d Add #include directives with missing headers
Make core and io headers self-contained.
Required by test to verify headers are self-contained in #147.
2018-10-03 23:27:57 +02:00
Mateusz Łoskot
e4e72b5ee4 Add explicit conversion of arithmetic result to expected result type
Fixes warnings due to implicit promotion of operands, then implicit
conversion.
2018-09-28 23:43:02 +02:00
Mateusz Łoskot
ed96c9cdf1 Use GCC pragma to disable -Wconversion and -Wfloat-equal
Fixes warnings where equality or assignment operators
applied to operands of different signedness or float-point.
2018-09-28 23:36:27 +02:00
Mateusz Łoskot
4bd625ff31 Replace unsigned with signed for int as compile-time index 2018-09-28 23:30:35 +02:00
Mateusz Loskot
7293313207 Merge pull request #145 from mloskot/ml/includes-relative-to-boost-root-and-sorted
Refactor library includes to #include <boost/gil/...>
2018-09-28 21:19:17 +02:00
Mateusz Łoskot
32fec9f05b Refactor library includes to #include <boost/gil/...>
Group include directives, sort within group:
* In headers of GIL core and extensions:
  1. boost/gil/extension/*
  2. boost/gil/*
  3. boost/*
  4. C++ standard library headers
* In programs:
  1. boost/gil/*
  2. boost/*
  3. C++ standard library headers
  4. "xxx.hpp" for local headers
Add basic guidelines to CONTRIBUTING.md.
Add/Remove #include <boost/config.hpp> or std headers un/necessary.
Rename gil_concept.hpp to concepts.hpp.
Remove gil_all.hpp - we already have all-in-one boost/gil.hpp.
Tidy up and unify copyright and license header.
Tidy up formatting and excessive whitespaces in some comments.
Remove Doxygen block with file description, author, date, etc.
Remove dead or commented pragmas and directives.
Trim trailing whitespaces.
2018-09-28 16:26:34 +02:00
Mateusz Loskot
fe0113e828 Merge pull request #144 from mloskot/ml/remove-gil-config-header
Remove gil_config.hpp as unnecessary
2018-09-27 20:12:56 +02:00
Mateusz Łoskot
c3bb2e1a94 Remove gil_config.hpp as unnecessary
Move BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS define setting and
documentation comment to channel.hpp where solely used.

Trim trailing whitespaces.
2018-09-27 15:38:40 +02:00