* 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
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
Although GCC 4.8 is labelled as C++11 compatible, the reasons are:
* GCC 4.8 is buggy enough to prevent reasonable use of Boost.MP11
* GCC 4.8 is dying
Closes#282
C++11 / 20.11.2 Header <type_traits> synopsis
1 The behavior of a program that adds specializations for any
of the class templates defined in this subclause is undefined
unless otherwise specified.
The specializations are not used anywhere, so they are safe to remove
without providing a replacement.
Fixes#283
Use type traits and features of C++11, then use Boost.MP11.
Remove unused and unnecessary metafunctions in `detail` namespace.
Remove explicit access to ::type as no longer necessary with MP11.
Clean up and reformat code according to the current guidelines.
Legacy tests have been updated where necessary to accommodate
switch to MP11.
Replace std::is_integral with gil::detail::is_channel_integral
Replacing boost::is_integral with std::is_integral is C++ UB:
C++11 / 20.11.2 Header <type_traits> synopsis
1 The behavior of a program that adds specializations for any
of the class templates defined in this subclause is undefined
unless otherwise specified.
Implements also proposal in #93Closes#229
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.
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
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
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.
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.
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
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
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.
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.
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.
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.
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.
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,
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>"