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).
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.
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
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.
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.
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
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
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`).
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.
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
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
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
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.
The assignment was superfluous in general case and incorrect in specific
case when the algorithm was given a lambda expression.
The copy assignment operator is defined as deleted for lambda
expressions.
Add minimal test for for_each_pixel algorithm to verify it compiles with
lambda expression.
The previous name is too generic and prone to variable shadowing,
causing compilation warnings (eg. vector named buffer in JPEG-s
reader::read_rows method).
* Applies patch from John Femiani submitted via Trac
https://svn.boost.org/trac10/ticket/2222 description:
It would be convenient if GIL views modeled ReversibleCollection concept.
In fact they almost do already. Without modeling this concept, it is
hard to use an image view with boost::range algorithms.
* Add related image_view concepts for Collection, ForwardCollection,
ReversibleCollection.
* Add tests for the new concepts.
* Add run-time tests for the new image_view methods.
* Apply patch from https://svn.boost.org/trac10/ticket/8896
* Add compile-time test of RandomAccessNDImageViewConcept
* Confirms the reported failure (tested with GCC 7.3 and clang 5.0)
* Verifies correctness of the patch
https://svn.boost.org/trac10/ticket/2979 description:
The description of the metafunction boost::gil::image_is_basic says that
it will return mpl::true_ if the image uses a basic view and
std::allocator<unsigned char>, however the implementation returns true
for any kind images that use any kind of allocator.
In file included from /usr/local/include/boost/gil/extension/io/png/read.hpp:29:
In file included from /usr/local/include/boost/gil/io/get_reader.hpp:22:
In file included from /usr/local/include/boost/gil/io/get_read_device.hpp:26:
In file included from /usr/local/include/boost/gil/io/path_spec.hpp:23:
/usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>"
When loading PNG images with "simple transparency" the IO extension
should expland the contained alpha palette into a proper alpha channel.
Currenty the code queries if the image contains an alpha channel, which
is different from an alpha palette.
Fixes: #117
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.
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.
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.
Add cast to explicitly indicate val promotion to at least
32-bit integer. The arithmetic operations are performed on
int of higher rank type. Finally, since the result value is
guaranteed to fit range of 8/16-bit result integer type,
it is safe to cast.
This should make it clearer for a reader that subtleties
of implicit promotions and conversions have been considered.
- unused parameter
- shadowed typedef
- implicit conversion changes signedness:
int to signed <int>
int to unsigned <int>
Note, arithmetic op is performed on int as higher rank type
with result is in range of return type, safe to cast.
Pre-defined packed_channel_reference_base::set::num_values already
represents the value.
Fixes warning C4458: declaration of 'num_values' hides class member
Currently GIL refuses to load TARGA files whose screen origin is
in the upper left-hand corner. See Trac ticket 8429 for sample
image files created from GIMP 2.
Currently GIL refuses to load TARGA files whose screen origin is
in the upper left-hand corner. See Trac ticket 8429 for sample
image files created from GIMP 2.