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

389 Commits

Author SHA1 Message Date
Mateusz Łoskot
ba518df03a [circleci] Allow only master and develop branches for all build jobs
CircleCI 2.0 does not yet support branch filtering per workflow.
2018-06-27 21:11:55 +02:00
Stefan Seefeld
089ca49085 A few more CI fixes. 2018-06-27 08:10:32 -04:00
Mateusz Loskot
0216ea4fe8 [circleci] Enable for master branch 2018-06-27 07:37:19 -04:00
Stefan Seefeld
51028a2335 Fix documentation upload process. 2018-06-27 00:42:30 -04:00
Mateusz Łoskot
e0ef163d2b [travis] Allow failures for variant=ubsan_integer
Currently, UBSan integer checks report several false positives due to
unsigned integer overflows (well-defined).
Instead of hiding them completely, keep them displayed on the matrix
until we decide how to handle. For example, there may be some issues
regarding size of unsigned type used, etc.

Sort variant=ubsan_* jobs.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
c95bcf96ad Remove #define GIL_VERSION "2.1.2"
The macro was replaced by recently added gil/version.hpp

Closes #82
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
a000f26cf4 Fix mention links in CONTRIBUTING.md [ci skip] 2018-06-27 00:02:27 -04:00
Mateusz Łoskot
e4322aa094 Remove dependency on Boost.SmartPtr
Replace boost::shared_ptr with C++11 std::shared_ptr.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
abb260ed05 [cmake] Add targets for individual I/O format tests
Unify tests set with Jamfile and fabscript definitions.
Search for libtiffxx and tiffio.hxx with C++ stream
interface for TIFF - required by I/O.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
81db99b734 Resolve ambiguous ofstream due to imported std and filesystem namespaces
Replace using namespace std import with full std:: qualification.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
a435900b34 Remove dependency on boost::lexical_cast
Replace lexical_cast with C++11 std::to_string function.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
8e1db33826 Remove dependency on boost::array
Replace boost::array with C++11 std::array.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
472d1e57d3 Fix warning: extra ';' [ci skip] 2018-06-27 00:02:27 -04:00
Mateusz Łoskot
3d311c68e3 [appveyor] List required Boost libraries explicitly
Group list of deps for easy identification of direct ones.
Add --quiet option to git submodule commands on Travis CI.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
550be8fd32 [travis] Group list of deps for easy identification of direct ones [ci skip] 2018-06-27 00:02:27 -04:00
Mateusz Łoskot
2c5e0d227d [travis] List required Boost libraries explicitly [skip appveyor]
tools/boostdep/depinst/depinst.py helper automatically calculates
maximum set of required Boost libraries, based on #include-s.

Manual listing should help to control any new additions
and prevent introduction of unwanted dependencies.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
cc6ba0ae72 Disable unaligned pointer access
Rename GIL_NONWORD_POINTER_ALIGNMENT_SUPPORTED
    to BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS.
Undefine BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS by default and document it.
If defined, issue warning or error, depending on target platform.

This changes how packed_channel_reference_base-based channels perform
access - aligned memory access by default.

This also fixes undefined behavior detected by UBSan in some test cases.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
30c249de9e [doc] Add BOOST_GIL_DOXYGEN_ONLY to Doxyfile [ci skip]
To be used as #ifdef test for definitions that should be preprocessed
only by Doxygen, but skipped during normal compilation.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
0963021f8b [doc] Remove unused Doxygen predefine ADOBE_GIL_STANDALONE_DOCUMENTATION [ci skip] 2018-06-27 00:02:27 -04:00
Mateusz Łoskot
f3d80cfddb [b2] Add -Wcast-align to <cxxflags> for GCC/clang [ci skip] 2018-06-27 00:02:27 -04:00
Mateusz Łoskot
189889e39f Add Boost.Build variants for UBSan-enabled builds
The build variants enable group of checks offered by clang
UndefinedBehaviorSanitizer detector.

Add sanitizers suppression file in .ci/blacklist.supp based on
copy of the file from Boost.Beast.

Update Travis CI:
  - Add .ci/build-and-test.sh script as handy proxy for b2 command.
  - Add build jobs for each of the three new UBSan variants.
  - Display COMPILER and VARIANT first as these two are most important
    details while inspecting the build matrix
    (TOOLSET can be derived from COMPILER).
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
472ec6bafc [doc] Describe development workflow using CMake [ci skip]
Add "Using Faber" section.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
bfb0c15323 [cmake] Update FindBoost.cmake auto-download instructions [ci skip]
Add GIL_DISABLE_FINDBOOST_DOWNLAOD option (default=OFF).
Output values of Boost_INCLUDE_DIRS and BOOST_LIBRARY_DIRS
  - should help to know which Boost we are building GIL against.
Fix add_executable with empty sources list.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
2476006f9f Fix typo [ci skip] 2018-06-27 00:02:27 -04:00
Mateusz Łoskot
5c2ad8d142 [circleci] Remove gcc 4.7 build jobs [ci skip]
First GCC 4.8.1 was the first feature-complete implementation of C++11.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
94f5ad613a Use promote_integral in channel_invert algorithm
This should help to avoid UB due to possible signed integer overflows,
for minimum/maximum of input channel domain.

Fixes #89
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
7f6eb255c7 Simplify pull template sections [ci skip] 2018-06-27 00:02:27 -04:00
Mateusz Łoskot
2658e2059a Replace some of Boost.MPL and Boost.TypeTraits with C++11 equivalents
Non-functional refactoring of promote_integral added in #91
Clean up 128-bit support remains.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
b8af11db87 Add promote_integral metafunction
Copied from Boost.Geometry, including original tests, with some non-functional
modifications explained in the comments.
The utility can be used where it is important to avoid integer overflow.
2018-06-27 00:02:27 -04:00
Mateusz Łoskot
57693484df Suggest use of --jobs N for git commands where applicable
[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
41c87d8cbc [circleci] Add GCC 8.1 jobs to workflow 2018-06-27 00:02:27 -04:00
Mateusz Loskot
9f4bc93ad6 Replace boost::integer_traits with std::numeric_limits
std::numeric_limits<T>::max() is constexpr since C++11
2018-06-27 00:02:27 -04:00
Mateusz Loskot
a6795334d3 [test] Verify channel_minmax values against std::numeric_limits 2018-06-27 00:02:27 -04:00
Mateusz Loskot
73ec99e606 Refactor single-program channel test to Boost.Test suites and cases
Motivation:
- state clearly what is covered with tests without reading non-trivial code
- avoid cleverness - tests should be no-brainer
- get closer to one test case targets one feature/beaviour with one check
- replace obscure `throw std::exception` with diagnostics that are actually
  useful to pin-point failure cause and location - makes CI logs useful.
- allow to select and run specific tests
- make tests maintenance easy, quick and fun

Propose new structure of tests that reflects the previous tests hierarchy,
but organizes channel tests in test/channel directory with test programs
each covering specific library feature (or set of closely related features).

The refactored tests cover 100% of checks from the old `channel.cpp`,
plus it refines or adds a bunch more.
NOTE: old test/channel.cpp has not been removed yet.

Common definitions from the single test/channel.cpp moved to
channel_test_fixtures.hpp and namespace boost::gil::test::fixture:
Classes and typedefs:
- `do_test` as `fixture::channel`
- `value_core` as `fixture::channel_value`
- `reference_core` as `fixture::channel_reference`
- `packed_reference_core` as `fixture::packed_channel_reference`
- `packed_dynamic_reference_core` as `fixture::packed_dynamic_channel_reference`
- `channel_archetype` and relatives to `channel_concepts.cpp` which is compile
   test in Jamfile
- `test_packed_channel_reference()` parts as `fixture::packed_channels565`
- `test_packed_dynamic_channel_reference()` parts as `fixture::packed_dynamic_channels565`
Test case functions called from `do_test<T>::test_all`:
- `test_channel_invert()` to `algorithm_channel_invert.cpp` suite
- `test_channel_convert()` to `algorithm_channel_convert.cpp` suite
- `test_channel_multiply()` to `algorithm_channel_multiply.cpp` suite
- `test_channel_math()` split to `algorithm_channel_relation.cpp`
   and `algorithm_channel_arithmetic.cpp`

Add test cases for each channel value type T as used to run from
`test_channel_value_impl<T>`, `test_packed_channel_reference<T>` and
`test_packed_dynamic_channel_reference<T>`.

Add list of possible T-s defined as type-lists `fixture::channel_byte_types`,
`fixture::channel_integer_types`, `channel_float_types` and
`channel_bitfield_types` which used with `BOOST_AUTO_TEST_CASE_TEMPLATE`
generate all possible combination of inputs.

Add new `channel_test_fixture.cpp` is a self-test suite verifying the fixtures.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
b80667f0c6 [io/bmp] Explain DIB orientation variants that affect reading
Trim trailing whitespaces (.editorconfig)

[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
4bc6575f5f Build tests with -fsanitize=undefined
Sort common compilation flags
2018-06-27 00:02:27 -04:00
Mateusz Loskot
69101e6dc9 [cmake] Tidy up
[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
87b7fdbcab [msvc] Build tests with NOMINMAX to suppress min/max macros 2018-06-27 00:02:27 -04:00
Mateusz Loskot
b0627dd1dc Clarify console input belongs to listed steps
Fenced code in numbered or bullet list works in Markdown.

[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
a872cea86b Add TIP about complete clean-up and reset of super-project repository
[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
b92ee65973 Add TIP on testing against master branch of Boost super-project
[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
d09ab2e473 Add Table of Contents to CONTRIBUTING.md
[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
47461ab59c Fix -Wconversion about float from unsigned int (#84)
Use of gil::float32_t type members typedefs with variables for half-results.
Observing intermediate values migth be useful during debugging.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
baa20b670d [circleci] Deploy root Jamfile with common compilation config 2018-06-27 00:02:27 -04:00
Mateusz Loskot
ed67f9a571 Replace bitsN[s] aliases with C++11 fixed width integer types
Import the selection of integer types into boost::gil namespace,
  and move from channel.hpp to typedefs.hpp for easier access.
Replace bits32f with float32_t and bits64f with float64_t
  - kept as alias of scoped_channel_value.
Move float64_t (bits64f) to typedefs.hpp.
Replace the four {float|double}_{zero|one} min/max channel values
  with float_point_zero and float_point_one templates.
Replace <boost/cstdint,hpp> with C++11 <cstdint>.

Introduce preference of using declaration instead of typedef.
Reformat typedefs.hpp to take advantage of the using declaration
  - works much better for left-to-right reading, alias name as
    most important detail comes first.
Add some of missing #include typedefs.hpp, sort some headers.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
1a9a01ce5d [cmake] Restore downloading of FindBoost.cmake for CMake older than 3.11
Download the module from the latest stable release, not master.
Require Boost 1.67 or later.

[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
2a3b350c5f Add TIP on copying b2 to PATH
[ci skip]
[skip ci]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
a2cf24c78e Link README for CI build status
[ci skip]
2018-06-27 00:02:27 -04:00
Mateusz Loskot
1d72f6a205 [appveyor] Fix build jobs using CMake
Attempt to fix the Boost look-up failure.
2018-06-27 00:02:27 -04:00
Mateusz Loskot
f3fd792787 Test float-point divisor for less/greater-than Zero
Add divisor check to point2<T>::operator/=, if Zero do nothing.

This hack helps to avoid compiler warnings without
polluting the source with pragmas.
2018-06-27 00:02:27 -04:00