2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-22 03:22:15 +00:00
Commit Graph

265 Commits

Author SHA1 Message Date
Mateusz Łoskot
fc70dafa9e Fix warning: unused variable 'src_p' [-Wunused-variable] 2019-03-21 21:14:10 +01:00
Mateusz Łoskot
d9e7ff588f Comment unused parameter of channel_premultiply call operator (#264)
Fix warning: unused parameter `c` [-Wunused-parameter].
Clean up typographic quotation marks.
2019-03-21 18:54:06 +01:00
Mateusz Łoskot
5427e60dcc Add missing #include <sstream> 2019-03-21 18:41:24 +01:00
Nikita Kniazev
33d4ac05ae Use just ::value where is possible (#262)
The ::value member is common convention of all MPL and TypeTraits metafunctions.

Fixes VS2015 failures (#261)
2019-03-19 20:34:11 +01:00
Mateusz Łoskot
af8dcac47e Add missing #include <boost/mpl/and.hpp> 2019-03-18 22:11:05 +01:00
Mateusz Łoskot
f81952e115 Fix gray_t and gray_color_t mismatch in default_color_converter_impl (#250)
Add number of static assertions to test indices used to access
elements of color mapping sequence are in range.

Fixes #249
2019-03-04 17:33:03 +01:00
Mateusz Łoskot
52ed09f0bc Add missing #include <boost/config.hpp> 2019-02-21 00:41:30 +01:00
Mateusz Łoskot
21139476e5 Include all public headers in gil.hpp (#237) 2019-02-20 19:02:58 +00:00
Mateusz Łoskot
22baac5367 Add dynamic_step.hpp for base templates declaration (#238)
Replace all scattered around forward declarations of
`dynamic_{x,y,xy}_step_type` with this common header,
where the templates are also documented.

Refine documentation of `transposed_type` - this is kept
in locator.hpp as it is not just related to the dynamic step.
2019-02-19 16:34:20 +00:00
Mateusz Łoskot
b78a762fdd Fix clang and GCC warning on unsequenced access 2019-02-06 22:26:09 +01:00
Mateusz Łoskot
545bd85677 Ignore warning -Wunused-but-set-variable in concepts 2019-02-06 22:24:11 +01:00
Mateusz Łoskot
f4133c8068 Ignore warning -Wuninitialized in concepts 2019-02-06 22:23:38 +01:00
Mateusz Łoskot
db28b19959 Ignore GCC warning -Wunused-but-set-variable 2019-02-06 22:02:08 +01:00
Mateusz Łoskot
6763a8cd98 Build core tests with BOOST_GIL_USE_CONCEPT_CHECK defined (#230)
when building tests with both, Boost.Build and CMake.

Disable concepts check for tests where range (e.g. std::array)
used as image pixel - not fully specialised as acceptable pixel type.

Ignore warnings from boost/concept_check.hpp
Rationalise uses of GCC and clang diagnostic push/pop,
with adding constraint for GCC 4.6+ as minimum version
where the pragma was introduced.

Closes #228
2019-02-05 22:19:35 +00:00
Samuel Debionne
2308a1a85a Use Boost.Variant instead of GIL's own variant implementation (#231)
Adds support C++11 decltype(auto)

Fixes #131
2019-02-05 00:47:08 +00:00
Mateusz Łoskot
cd2ad3b75b Replace boost::is_pointer with std::is_pointer in static_assert 2019-01-27 23:37:39 +01:00
Mateusz Łoskot
12e68d4d2c Tidy up uses of Boost.Filesystem in IO (#226)
Remove unused #include-s and leave io/test/paths.hpp as sole
place of #include <boost/filesystem.hpp> for IO tests.
Silence annoying -Wconversion or -Wshorten-64-to-32 warning
from Boost.SmartPtr via Boost.Filesystem:
  conversion to 'std::atomic<int>::__integral_type {aka int}'
    from 'long int' may alter its value
2019-01-27 22:11:03 +00:00
Mateusz Łoskot
45ca507ca3 Replace some uses of boost::is_same with std::is_same (#225)
Those are places boost::is_same can be replaced in non-intrusive way.
Remaining are types derived from boost::is_same, where the replacing
would affect all their uses - effectively switching from boost::true_/false_ types
to std::true_type and std::false_type.
Such change needs to come along with Boost.MPL to MP11 migration.
2019-01-27 10:54:05 +00:00
Mateusz Loskot
83a735a09c Fix GCC -Wunused-parameter warnings (#221) 2019-01-20 09:37:31 +01:00
Mateusz Loskot
54f1817e99 Replace boost::enable_if with std::enable_if (#215)
Replace boost::disable_if with std::enable_if and negated condition.
Update mpl::and_ expressions to yield value convertible to bool, instead of type.
Format std::enable_if expressions and nearby code they are nested in.
Replace complex template-based leading return type of functions
  with auto and trailing return type for greater readability.
Replace some Boost type traits with <type_traits> features.
Replace 0 with nullptr where modernize-use-nullptr missed (updates #180).

Notice, boost::lazy_enable_if in extension/toolbox has not been replaced,
but it seems it could have been - need verification with number of compilers.
2019-01-18 09:31:58 +01:00
Mateusz Loskot
40e158b26b Fix warning: suggest parentheses around assignment used as truth value (#214)
Tidy up around the fix.
2019-01-16 12:29:36 +01:00
Mateusz Łoskot
e3ef52bb80 Correct order of constexpr and type specifier
The constexpr belongs to the declaration specifiers (like static) and
not just the type specifiers (like cv-qualifiers), so it binds to
the declaration (like static), not the type (like const).

Refines #211
2019-01-15 00:42:20 +01:00
Mateusz Loskot
da6acc6cca Remove uses of Boost.Function (#213)
Remove uses of boost::mem_fn (missing from Bind.Bind removal in #212).
2019-01-13 06:32:20 +01:00
Mateusz Loskot
78b7dcfeca Remove uses of Boost.Bind and Boost.Lambda (#212)
Replace with std::bind and C++11 lambda functions.
The two Boost libraries should no longer be a direct
dependency of Boost.GIL.
2019-01-13 02:03:25 +01:00
Mateusz Loskot
a2b2ca977a Replace BOOST_STATIC_CONSTANT with constexpr (#211)
Tidy up formatting of refactored parts of code.
2019-01-12 23:57:35 +01:00
Mateusz Loskot
f578a8be9c Replace assert() macro with BOOST_ASSERT() macro (#208)
Add #include <boost/assert.hpp> where necessary.
Apply minor clean-up near the macro replacements.

Closes #96
2019-01-12 10:21:01 +01:00
Mateusz Loskot
6e3ccc00b1 Remove dependency on Boost.StaticAssert (#207)
Replaced BOOST_STATIC_ASSERT with C++11 binary static_assert,
with empty message.

In future, this should make it possible to automatically refactor
into C++17 unary static_assert using clang-tidy and
its modernize-unary-static-assert check.

Closes #106
2019-01-11 10:33:09 +01:00
Mateusz Loskot
a4185bcea2 Remove Boost.Bind from extension/dynamic_image (#202)
Replace boost::bind with std::bind from C++11.
Move template parameter comments to Doxygen \tparam-s,
so they are captured as proper documentation.
Tidy up code formatting.
2018-12-20 16:51:20 +01:00
Mateusz Loskot
2233fb166a Remove Boost.Bind from io (#203)
Replace Boost.MPL boolean constants with C++11 equivalents.
Replace `throw()` with `noexcept`.
Replace empty constructor body with `default`.
Rename private class members to avoid leading underscore
(too easy to confuse as reserved identifier).
Tidy up with compact formatting.
2018-12-18 18:50:57 +01:00
Mateusz Loskot
06d1dbb066 Fix hard-wired use of Boost.Array static_size member (#200)
Fixes #142
2018-12-18 11:57:32 +01:00
Mateusz Łoskot
149b4c8605 Remove reference instantiation
Introduced in recent SHA-1 c065671e01
2018-12-17 23:47:07 +01:00
Mateusz Łoskot
c9d5ce6d43 Replace typedef with using in comments [ci skip]
Left-overs from previous modernize-use-using refactoring.
2018-12-17 19:35:13 +01:00
Mateusz Loskot
abfa519b00 Apply clang-tidy modernize-use-using to extension/toolbox (#198)
Run clang-tidy 7.0 with `-checks='-*,modernize-use-using' -fix` against
single TU with `#include <boost/gil/extension/toolbox/*.hpp>`.

Manually refactor numerous typedef-s
- where missed by modernize-use-using check, not uncommon
- in code snippets in comments

Outcome is that searching for lower-case whole word typedef
in all the extension/toolbox/*.hpp should return no matches.
2018-12-17 19:25:19 +01:00
Mateusz Łoskot
c065671e01 Ignore warning: unused type alias [-Wunused-local-typedef]
Typically, in concepts, unused aliases are nothing uncommon.

Add TODO about some member aliaseis that perhaps should be concept-checked.
2018-12-17 14:33:46 +01:00
Mateusz Loskot
5340a352c4 Apply clang-tidy modernize-use-using to extension/io (#197)
Run clang-tidy 7.0 with `-checks='-*,modernize-use-using' -fix` against
single TU with `#include <boost/gil/extension/io/*.hpp>`.

Manually refactor numerous typedef-s
- where missed by modernize-use-using check, not uncommon
- in code snippets in comments

Outcome is that searching for lower-case whole word typedef
in all the extension/io/*.hpp should return no matches.
2018-12-17 01:24:30 +01:00
Mateusz Loskot
fbd056baf0 Apply clang-tidy modernize-use-using to io (#195)
Run clang-tidy 7.0 with `-checks='-*,modernize-use-using' -fix`
against single TU with `#include <boost/gil/io/*.hpp>`.

Manually refactor numerous typedef-s
- where missed by modernize-use-using check, not uncommon
- in code snippets in comments

Outcome is that searching for lower-case whole word typedef
in all io/*.hpp should return no matches.
2018-12-17 00:48:58 +01:00
Mateusz Loskot
a33523f868 Apply clang-tidy modernize-use-using to extension/numeric (#196)
Run clang-tidy 7.0 with `-checks='-*,modernize-use-using' -fix` against
single TU with `#include <boost/gil/extension/numeric/*.hpp>`.

Manually refactor numerous typedef-s
- where missed by modernize-use-using check, not uncommon
- in code snippets in comments

Outcome is that searching for lower-case whole word typedef
in all the extension/numeric/*.hpp should return no matches,
2018-12-17 00:17:23 +01:00
Mateusz Loskot
0e11759d4e Apply clang-tidy modernize-use-using to extension/dynamic_image (#193)
Run clang-tidy 7.0 with `-checks='-*,modernize-use-using' -fix`
against single TU with `#include <boost/gil/concepts/*.hpp>`.

Manually refactor numerous typedef-s
- where missed by modernize-use-using check, not uncommon
- in code snippets in comments

Outcome is that searching for lower-case whole word typedef
in all the extension/dynamic_image/*.hpp should return 5 matches,
in definitions of macros (TODO).
2018-12-16 01:25:12 +01:00
Mateusz Loskot
46939c7b29 Apply clang-tidy modernize-use-using to core headers (#192)
Run clang-tidy 7.0 with `-checks='-*,modernize-use-using' -fix`
against single TU with `#include <boost/gil/concepts/*.hpp>`.

Manually refactor numerous typedef-s
- where missed by modernize-use-using check, not uncommon
- in code snippets in comments

Outcome is that searching for lower-case whole word typedef
in all the top-level core headers should return no matches.
2018-12-15 19:10:30 +01:00
Mateusz Łoskot
4616dc1bdc [numeric] Remove unused type alias from detail::correlate_rows_imp
Fix warning: typedef kernel_type locally defined but not used
[-Wunused-local-typedefs]
2018-12-15 01:03:43 +01:00
Samuel Debionne
6b0b66c0f2 Remove deprecated unary/binary_function (#191)
std::unary_function and std::binary_function are deprecated in C++11
and removed in C++17.
2018-12-14 22:58:55 +01:00
Mateusz Loskot
230158bd66 Fix const on return type not applied to pointee type of typedef (#190)
Replace png_structp and png_infop aliases with regular pointers to
to prevent type qualifiers ignored on function return type.
2018-12-14 08:12:45 +01:00
Mateusz Loskot
2250b7159c Fix conflicting definitions from io/dynamic_io_new.hpp and toolbox/dynamic_images.hpp (#185)
The problem appears to be due to the same definitions copied from one
part of the library to the other.
The definitions have been shuffled to fix the compilation,
but purely based on searching the code for what is used where,
thus without confidence where those belong by author's intention.

Fixes #183
2018-12-12 17:58:57 +01:00
Mateusz Loskot
e0288ece9e Apply clang-tidy modernize-use-nullptr (#180)
Used clang-tidy 7.0 with the command:

  run-clang-tidy.py \
      -header-filter='boost\/gil\/.*' \
      -checks='-*,modernize-use-nullptr' -fix

Update CONTRIBUTING.md on how to generate compile command
database and run clang-tidy.
2018-12-10 09:58:37 +01:00
Mateusz Loskot
682a7264da Include missing headers across boost/gil/extension/io (#179)
Missing headers revealed by compilation of self-contained header tests.
2018-12-09 23:40:38 +01:00
Mateusz Loskot
032a4786bb Remove unnecessary extern C around libraw.h include (#178)
Since libraw is C++ library, not C, it is always built as C++ library.
2018-12-09 21:38:59 +01:00
Mateusz Loskot
057a02ad0a Replace writer<Device,jpeg_tag> where writer_backend<Device,jpeg_tag> expected (#177)
The reference to `writer<Device,jpeg_tag>` is clearly incorrect:
- writer has no members `init_device`, `empty_buffer`, `closed_buffer`
- if use of writer was correct there, it would require
  `#include <boost/gil/extension/io/jpeg/detail/writer.hpp>`, but that
  would impose cyclic-dependency between writer.hpp and writer_backend.hpp.
2018-12-09 15:45:51 +01:00
Mateusz Łoskot
8c26143574 Add missing #include <boost/gil/extension/io/*/tags.hpp>
Fixes compilation error about undeclared *_tag.
2018-12-08 22:20:58 +01:00
Mateusz Łoskot
a0b5767392 Add missing #include <boost/gil/extension/io/raw/tags.hpp>
Fixes compilation error about undeclared raw_tag.
2018-12-08 12:10:59 +01:00
Mateusz Loskot
63e2a1a98a Fix compile-time bugs subchroma_image.hpp definions (#164)
Add missing typename in mpl::if_ condition result.
Restore BOOST_CXX14_CONSTEXPR in boost::algorithm::clamp function
- apparently, GCC 5.5.0 does not compile it with C++11 constexpr.
Still not adding subchroma_image.cpp to toolbox test target
input sources due to run-time failure.

Depends on #176
2018-12-07 23:55:13 +01:00