Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
pylene
Commits
d6c62704
Commit
d6c62704
authored
Dec 10, 2019
by
Edwin Carlinet
Browse files
Merge branch 'development/cpp20-msvc-fixes' into 'development/cpp20'
CPP20 made MSVC compatible. See merge request
!84
parents
1be5bb97
9b3dad80
Pipeline
#15177
passed with stages
in 12 minutes and 56 seconds
Changes
60
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
d6c62704
...
...
@@ -4,8 +4,6 @@ stages:
-
bench
-
deploy
before_script
:
-
export CMAKE_BUILD_PARALLEL_LEVEL=$(( (${NBPROC} + 1) / 2 ))
variables
:
FEDORA_30
:
"
${CI_REGISTRY}/olena/pylene/fedora-rawhide"
# stdlibc++ 9.1.1-2 not yet in fedora-30
...
...
@@ -15,6 +13,7 @@ variables:
PACKAGE_TAG
:
"
testing"
# Conan tag
PACKAGE_VERSION
:
"
head"
# Version to build
CONAN_USER
:
"
lrde"
CMAKE_BUILD_PARALLEL_LEVEL
:
6
#########
# Build #
...
...
@@ -43,17 +42,40 @@ build-docker-automatic:
# Test #
########
windows-debug
:
stage
:
test
script
:
-
Invoke-BatchFile -Path $env:VCVAR2019 -Parameters $env:ARCH
-
mkdir build; cd build
-
conan install .. -s build_type=Debug --build missing
-
rm Findrange-v3.cmake
-
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=debug -D CMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake"
-
cmake --build . --target build-tests
-
ctest -L UnitTests --schedule-random --output-on-failure
dependencies
:
[]
artifacts
:
reports
:
junit
:
[
build/tests/UT*.xml
,
build/bench/tests/UT*.xml
]
expire_in
:
15 days
tags
:
[
windows
]
when
:
manual
variables
:
VCVAR2019
:
'
C:\Program
Files
(x86)\Microsoft
Visual
Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat'
ARCH
:
x64
.job-build-linux-base
:
&distcheck-linux-base
stage
:
test
script
:
-
mkdir build && cd build
-
conan install .. -pr pylene_default --build missing -e CXX=g++ -e CC=gcc
-
rm Findrange-v3.cmake
-
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=$PYLENE_CONFIGURATION -DPYLENE_CODE_COVERAGE=OFF -DSANITIZE_ADDRESS=$ASAN -DSANITIZE_MEMORY=$MSAN -DSANITIZE_UNDEFINED=$UBSAN $OTHER_CMAKE_ARGS
-
cmake --build . --target build-fixtures --config $PYLENE_CONFIGURATION
-
cmake --build . --target Pylene --config $PYLENE_CONFIGURATION
-
cmake --build . --target build-tests --config $PYLENE_CONFIGURATION
-
ctest -L UnitTests --schedule-random --output-on-failure
-
cmake --build . --target dist --config $PYLENE_CONFIGURATION
dependencies
:
[]
artifacts
:
reports
:
...
...
@@ -65,15 +87,14 @@ build-docker-automatic:
script
:
-
mkdir build && cd build
-
conan install .. -pr pylene_default --build missing -e CXX=g++ -e CC=gcc
-
rm Findrange-v3.cmake
-
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=$PYLENE_CONFIGURATION -DPYLENE_CODE_COVERAGE=ON -DGCOV_PATH=$COV -DSANITIZE_ADDRESS=$ASAN -DSANITIZE_MEMORY=$MSAN -DSANITIZE_UNDEFINED=$UBSAN $OTHER_CMAKE_ARGS
-
cmake --build . --target build-fixtures --config $PYLENE_CONFIGURATION
-
cmake --build . --target Pylene --config $PYLENE_CONFIGURATION
-
cmake --build . --target build-tests --config $PYLENE_CONFIGURATION
-
ctest -L UnitTests --schedule-random --output-on-failure
-
cmake --build . --target run-tests_coverage-gcovr-html --config $PYLENE_CONFIGURATION
-
cmake --build . --target run-tests_coverage-lcov --config $PYLENE_CONFIGURATION
-
lcov --list run-tests_coverage-lcov.info
-
cmake --build . --target dist --config $PYLENE_CONFIGURATION
dependencies
:
[]
artifacts
:
paths
:
...
...
@@ -127,19 +148,33 @@ distcheck-linux-gcc9-release:
UBSAN
:
"
OFF"
OTHER_CMAKE_ARGS
:
"
-DCMAKE_CXX_EXTENSIONS=OFF"
# This fixes a GCC ICE
distcheck-linux-gcc9-debug-
cov-
asan-ubsan
:
<<
:
*distcheck-linux-
coverag
e
distcheck-linux-gcc9-debug-asan-ubsan
:
<<
:
*distcheck-linux-
bas
e
image
:
${FEDORA_30}
variables
:
PYLENE_CONFIGURATION
:
"
Debug"
CXX
:
"
g++"
CC
:
"
gcc"
COV
:
"
/usr/bin/gcov"
ASAN
:
"
ON"
MSAN
:
"
OFF"
UBSAN
:
"
ON"
OTHER_CMAKE_ARGS
:
"
-DCMAKE_CXX_EXTENSIONS=OFF"
# This fixes a GCC ICE
distcheck-linux-gcc9-debug-coverage
:
<<
:
*distcheck-linux-coverage
image
:
${FEDORA_30}
variables
:
PYLENE_CONFIGURATION
:
"
Debug"
CXX
:
"
g++"
CC
:
"
gcc"
COV
:
"
/usr/bin/gcov"
ASAN
:
"
OFF"
MSAN
:
"
OFF"
UBSAN
:
"
OFF"
OTHER_CMAKE_ARGS
:
"
-DCMAKE_CXX_EXTENSIONS=OFF"
# This fixes a GCC ICE
when
:
manual
# distcheck-linux-clang7-release:
# <<: *distcheck-linux-base
# image: ${FEDORA_29}
...
...
@@ -201,6 +236,7 @@ distcheck-linux-gcc9-debug-cov-asan-ubsan:
script
:
-
mkdir build && cd build
-
conan install .. -pr $BUILD_PROFILE --build missing -e CXX=g++ -e CC=gcc
-
rm Findrange-v3.cmake
-
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=$PYLENE_CONFIGURATION
-
cmake --build . --target fetch-external-data --config $PYLENE_CONFIGURATION
-
cmake --build . --target build-bench --config $PYLENE_CONFIGURATION
...
...
@@ -258,6 +294,7 @@ distbench-linux-clang8-release:
script
:
-
mkdir build && cd build
-
conan install .. -pr pylene_default --build missing -e CXX=g++ -e CC=gcc
-
rm Findrange-v3.cmake
-
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
-
cmake --build . --target build-doc --config Release
-
mkdir ../public && mv doc/sphinx/* ../public/
...
...
CMakeLists.txt
View file @
d6c62704
...
...
@@ -72,12 +72,14 @@ endif()
#### MSVC Compiler Configuration
if
(
MSVC
)
#string(REGEX REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_compile_options
(
"/wd4458"
# masque le membre de classe
"/wd4456"
# masque la déclaration locale précédente
"/wd5030"
# l'attribut 'noinline' n'est pas reconnu
"/wd4457"
# la déclaration de '?' masque le paramètre de fonction
"/wd4996"
# '...': was declared deprecated
)
add_compile_options
(
"/WX"
"/W
4
"
"/wd4244"
"/wd4127"
"/permissive-"
)
add_compile_options
(
"/WX"
"/W
3
"
"/wd4244"
"/wd4127"
"/permissive-"
)
add_compile_definitions
(
_SCL_SECURE_NO_WARNINGS
)
add_compile_definitions
(
_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
)
add_compile_definitions
(
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
)
...
...
README.md
View file @
d6c62704
...
...
@@ -20,9 +20,9 @@ External dependancies:
[
FreeImage
](
www.freeimage.sourceforge.net
)
(
only
for IO)
# Status
*
GCC
8.2.0
*
Clang
6.0.1
*
MSVC
15.8.1
*
GCC
9+ with -fconcepts
*
~~
Clang
~~
*
MSVC
2019
[

](https://gitlab.lrde.epita.fr/olena/pylene/commits/dev)
[

](https://gitlab.lrde.epita.fr/olena/pylene/commits/dev)
...
...
bench/CMakeLists.txt
View file @
d6c62704
project
(
bench
)
find_package
(
benchmark REQUIRED
)
find_package
(
GTest REQUIRED
)
find_package
(
GTest
MODULE
REQUIRED
)
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_LIST_DIR
}
/cmake"
${
CMAKE_MODULE_PATH
}
)
...
...
bench/tests/CMakeLists.txt
View file @
d6c62704
project
(
tests
)
find_package
(
Threads REQUIRED
)
find_package
(
GTest REQUIRED
)
find_package
(
GTest
MODULE
REQUIRED
)
include_directories
(
${
GTEST_INCLUDE_DIRS
}
)
...
...
cmake/FindFreeImage.cmake
View file @
d6c62704
# Find the FreeImage library.
#
# This module defines
# FreeImage_FOUND - True if FreeImage was found.
# FreeImage_INCLUDE_DIRS - Include directories for FreeImage headers.
# FreeImage_LIBRARIES - Libraries for FreeImage.
# Once done this will define
# FreeImage_FOUND - System has FreeImage
# FreeImage_INCLUDE_DIRS - The FreeImage include directories
# FreeImage_LIBRARIES - The libraries needed to use FreeImage
# FreeImage_DEFINITIONS - Compiler switches required for using FreeImage
#
# To specify an additional directory to search, set FreeImage_ROOT.
#
# Copyright (c) 2010, Ewen Cheslack-Postava
# Based on FindSQLite3.cmake by:
# Copyright (c) 2006, Jaroslaw Staniek, <js@iidea.pl>
# Extended by Siddhartha Chaudhuri, 2008.
#
# Redistribution and use is allowed according to the terms of the BSD license.
#
SET
(
FreeImage_FOUND FALSE
)
SET
(
FreeImage_INCLUDE_DIRS
)
SET
(
FreeImage_LIBRARIES
)
SET
(
SEARCH_PATHS
$ENV{ProgramFiles}/freeimage/include
$ENV{SystemDrive}/freeimage/include
$ENV{ProgramFiles}/freeimage
$ENV{SystemDrive}/freeimage
# It also creates the IMPORTED target: FreeImage::FreeImage
find_path
(
FreeImage_INCLUDE_DIR NAMES FreeImage.h
)
find_library
(
FreeImage_LIBRARY_RELEASE NAMES FreeImage freeimage
)
find_library
(
FreeImage_LIBRARY_DEBUG
NAMES FreeImaged FreeImage_d FreeImage-debug
PATH_SUFFIXES debug
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
FreeImage DEFAULT_MSG
FreeImage_LIBRARY_RELEASE
FreeImage_INCLUDE_DIR
)
mark_as_advanced
(
FreeImage_INCLUDE_DIR
FreeImage_LIBRARY_DEBUG
FreeImage_LIBRARY_RELEASE
)
set
(
FreeImage_LIBRARY
""
)
if
(
FreeImage_LIBRARY_DEBUG
)
list
(
APPEND FreeImage_LIBRARY debug
${
FreeImage_LIBRARY_DEBUG
}
)
endif
()
if
(
FreeImage_LIBRARY_RELEASE
)
list
(
APPEND FreeImage_LIBRARY optimized
${
FreeImage_LIBRARY_RELEASE
}
)
endif
()
set
(
FreeImage_INCLUDE_DIRS
${
FreeImage_INCLUDE_DIR
}
)
set
(
FreeImage_LIBRARIES
${
FreeImage_LIBRARY
}
)
if
(
FreeImage_FOUND
)
if
(
NOT TARGET FreeImage::FreeImage
)
add_library
(
FreeImage::FreeImage UNKNOWN IMPORTED
)
endif
()
if
(
FreeImage_LIBRARY_RELEASE
)
set_property
(
TARGET FreeImage::FreeImage APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE
)
IF
(
FreeImage_ROOT
)
SET
(
SEARCH_PATHS
${
FreeImage_ROOT
}
${
FreeImage_ROOT
}
/include
${
SEARCH_PATHS
}
)
ENDIF
()
FIND_PATH
(
FreeImage_INCLUDE_DIRS
NAMES FreeImage.h
PATHS
${
SEARCH_PATHS
}
NO_DEFAULT_PATH
)
IF
(
NOT FreeImage_INCLUDE_DIRS
)
# now look in system locations
FIND_PATH
(
FreeImage_INCLUDE_DIRS NAMES FreeImage.h
)
ENDIF
(
NOT FreeImage_INCLUDE_DIRS
)
SET
(
FreeImage_LIBRARY_DIRS
)
IF
(
FreeImage_ROOT
)
SET
(
FreeImage_LIBRARY_DIRS
${
FreeImage_ROOT
}
)
IF
(
EXISTS
"
${
FreeImage_ROOT
}
/lib"
)
SET
(
FreeImage_LIBRARY_DIRS
${
FreeImage_LIBRARY_DIRS
}
${
FreeImage_ROOT
}
/lib
)
ENDIF
()
IF
(
EXISTS
"
${
FreeImage_ROOT
}
/lib/static"
)
SET
(
FreeImage_LIBRARY_DIRS
${
FreeImage_LIBRARY_DIRS
}
${
FreeImage_ROOT
}
/lib/static
)
ENDIF
()
ENDIF
()
# FreeImage
# Without system dirs
FIND_LIBRARY
(
FreeImage_LIBRARY
NAMES freeimage
PATHS
${
FreeImage_LIBRARY_DIRS
}
NO_DEFAULT_PATH
)
IF
(
NOT FreeImage_LIBRARY
)
# now look in system locations
FIND_LIBRARY
(
FreeImage_LIBRARY NAMES freeimage
)
ENDIF
(
NOT FreeImage_LIBRARY
)
SET
(
FreeImage_LIBRARIES
)
IF
(
FreeImage_LIBRARY
)
SET
(
FreeImage_LIBRARIES
${
FreeImage_LIBRARY
}
)
ENDIF
()
IF
(
FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES
)
SET
(
FreeImage_FOUND TRUE
)
IF
(
NOT FreeImage_FIND_QUIETLY
)
MESSAGE
(
STATUS
"Found FreeImage: headers at
${
FreeImage_INCLUDE_DIRS
}
, libraries at
${
FreeImage_LIBRARY_DIRS
}
::
${
FreeImage_LIBRARIES
}
"
)
ENDIF
(
NOT FreeImage_FIND_QUIETLY
)
ELSE
(
FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES
)
SET
(
FreeImage_FOUND FALSE
)
IF
(
FreeImage_FIND_REQUIRED
)
MESSAGE
(
FATAL_ERROR
"FreeImage not found"
)
ELSE
(
FreeImage_FIND_REQUIRED
)
MESSAGE
(
STATUS
"FreeImage not found"
)
ENDIF
(
FreeImage_FIND_REQUIRED
)
ENDIF
(
FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES
)
MARK_AS_ADVANCED
(
FreeImage_INCLUDE_DIRS FreeImage_LIBRARIES
)
set_target_properties
(
FreeImage::FreeImage PROPERTIES
IMPORTED_LOCATION_RELEASE
"
${
FreeImage_LIBRARY_RELEASE
}
"
)
endif
()
if
(
FreeImage_LIBRARY_DEBUG
)
set_property
(
TARGET FreeImage::FreeImage APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG
)
set_target_properties
(
FreeImage::FreeImage PROPERTIES
IMPORTED_LOCATION_DEBUG
"
${
FreeImage_LIBRARY_DEBUG
}
"
)
endif
()
set_target_properties
(
FreeImage::FreeImage PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
"
${
FreeImage_INCLUDE_DIR
}
"
)
endif
()
fixtures/ImageCompare/CMakeLists.txt
View file @
d6c62704
find_package
(
GTest REQUIRED
)
find_package
(
GTest MODULE REQUIRED
)
find_package
(
fmt 6.0 REQUIRED
)
add_library
(
ImageCompare
)
target_include_directories
(
ImageCompare PUBLIC include
)
target_link_libraries
(
ImageCompare PUBLIC Pylene::Pylene GTest::GTest
)
target_link_libraries
(
ImageCompare PUBLIC Pylene::Pylene GTest::GTest
fmt::fmt
)
target_sources
(
ImageCompare PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/fixtures/ImageCompare/image_compare.hpp
...
...
fixtures/ImageCompare/include/fixtures/ImageCompare/image_compare.hpp
View file @
d6c62704
...
...
@@ -7,7 +7,7 @@
#include <mln/core/rangev3/view/zip.hpp>
#include <mln/io/experimental/imprint.hpp>
#include <range/v3/
begin_end
.hpp>
#include <range/v3/
range/access
.hpp>
#include <string>
#include <functional>
...
...
@@ -128,7 +128,7 @@ namespace fixtures::ImageCompare
{
linecmp_fn
=
[](
const
void
*
a
,
const
void
*
b
,
std
::
size_t
n
)
->
int
{
return
!
std
::
equal
(
reinterpret_cast
<
const
TA
*>
(
a
),
reinterpret_cast
<
const
TA
*>
(
a
)
+
n
,
reinterpret_cast
<
const
T
A
*>
(
b
));
reinterpret_cast
<
const
T
B
*>
(
b
));
};
}
...
...
pylene/CMakeLists.txt
View file @
d6c62704
...
...
@@ -17,12 +17,17 @@ if (TBB_FOUND AND PYLENE_USE_TBB)
else
()
set
(
PYLENE_USE_TBB OFF
)
#FIXME use a config file
target_compile_definitions
(
Pylene
INTERFACE
MLN_NO_TBB
)
target_compile_definitions
(
Pylene
PUBLIC
MLN_NO_TBB
)
endif
()
# FIXME: still useful ?
if
(
UNIX AND NOT APPLE
)
target_link_libraries
(
Pylene INTERFACE rt
)
elseif
(
MSVC
)
#
target_compile_options
(
Pylene PUBLIC
"/wd4275"
# non dll-interface class '...' used as base for dll-interface (fmt lib)
"/wd5104"
# found 'L#x' in macro replacement list, did you mean
)
endif
()
...
...
@@ -32,11 +37,9 @@ target_include_directories(Pylene PUBLIC
$<INSTALL_INTERFACE:include>
)
target_include_directories
(
Pylene SYSTEM PUBLIC
${
Boost_INCLUDE_DIR
}
)
target_include_directories
(
Pylene PUBLIC
${
FreeImage_INCLUDE_DIRS
}
)
set_property
(
TARGET Pylene APPEND
PROPERTY INTERFACE_LINK_DIRECTORIES
${
FreeImage_LIBRARY_DIR
}
${
Boost_LIBRARY_DIRS
}
)
target_link_libraries
(
Pylene PUBLIC range-v3::range-v3
)
target_link_libraries
(
Pylene PUBLIC range-v3
)
target_link_libraries
(
Pylene PUBLIC fmt::fmt
)
target_link_libraries
(
Pylene PRIVATE FreeImage::FreeImage
)
# Set sources
...
...
@@ -61,9 +64,12 @@ target_sources(Pylene PRIVATE
)
# Compiler configurations
target_compile_features
(
Pylene PUBLIC cxx_std_17
)
target_compile_features
(
Pylene PUBLIC cxx_std_20
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
target_compile_options
(
Pylene PUBLIC -fconcepts
)
endif
()
target_compile_options
(
Pylene PUBLIC -fconcepts
)
target_compile_definitions
(
Pylene PUBLIC PYLENE_CONCEPT_TS_ENABLED
)
# Add concepts support for gcc > 8 with -fconcepts
...
...
pylene/include/mln/core/box.hpp
View file @
d6c62704
...
...
@@ -101,6 +101,8 @@ namespace mln::experimental
return
size
(
2
);
}
using
Impl
::
cursor
;
using
Impl
::
backward_cursor
;
using
Impl
::
begin_cursor
;
using
Impl
::
end_cursor
;
using
Impl
::
rbegin_cursor
;
...
...
@@ -531,6 +533,8 @@ namespace mln::experimental
void
rbegin_cursor
()
const
{};
void
end_cursor
()
const
{}
void
rend_cursor
()
const
{};
using
cursor
=
void
;
using
backward_cursor
=
void
;
int
m_dim
=
0
;
...
...
@@ -628,6 +632,8 @@ namespace mln::experimental
void
rbegin_cursor
()
const
{};
void
end_cursor
()
const
{}
void
rend_cursor
()
const
{};
using
cursor
=
void
;
using
backward_cursor
=
void
;
...
...
pylene/include/mln/core/canvas/local_algorithm.hpp
View file @
d6c62704
...
...
@@ -11,10 +11,11 @@ namespace mln::canvas
{
template
<
class
SE
,
class
I
,
class
J
,
class
Self
=
void
>
#ifdef PYLENE_CONCEPT_TS_ENABLED
requires
concepts
::
StructuringElement
<
SE
,
image_point_t
<
I
>>&&
concepts
::
Image
<
I
>&&
concepts
::
Image
<
J
>
#endif
class
LocalAlgorithm
// This concept check makes an ICE with MSVC
#ifndef _MSC_VER
requires
concepts
::
StructuringElement
<
SE
,
image_point_t
<
I
>>&&
concepts
::
Image
<
I
>&&
concepts
::
Image
<
J
>
#endif
class
LocalAlgorithm
{
static_assert
(
mln
::
is_a
<
SE
,
experimental
::
StructuringElement
>
());
static_assert
(
mln
::
is_a
<
I
,
experimental
::
Image
>
());
...
...
@@ -32,8 +33,8 @@ namespace mln::canvas
public:
LocalAlgorithm
(
const
SE
&
se
,
I
&
f
,
J
&
g
)
:
m_se
{
se
}
,
m_i
(
f
)
,
m_j
(
g
)
,
m_i
{
f
}
,
m_j
{
g
}
{
}
...
...
pylene/include/mln/core/concept/new/archetype/image.hpp
View file @
d6c62704
...
...
@@ -8,7 +8,7 @@
#include <mln/core/image/private/image_traits.hpp>
#include <mln/core/image/private/pixel_traits.hpp>
#include <range/v3/range
_
traits.hpp>
#include <range/v3/range
/
traits.hpp>
#include <type_traits>
...
...
pylene/include/mln/core/concept/new/archetype/structuring_element.hpp
View file @
d6c62704
...
...
@@ -5,7 +5,7 @@
#include <mln/core/concept/new/neighborhoods.hpp>
#include <mln/core/neighborhood/neighborhood_traits.hpp>
#include <range/v3/
iterator_
range.hpp>
#include <range/v3/
view/sub
range.hpp>
namespace
mln
::
archetypes
...
...
@@ -32,10 +32,10 @@ namespace mln::archetypes
using
decomposable
=
std
::
false_type
;
using
separable
=
std
::
false_type
;
::
ranges
::
iterator_
range
<
P
*>
operator
()(
P
p
);
::
ranges
::
sub
range
<
P
*>
operator
()(
P
p
);
::
ranges
::
iterator_
range
<
Pix
*>
operator
()(
Pix
px
);
::
ranges
::
iterator_
range
<
P
*>
offsets
()
const
;
::
ranges
::
sub
range
<
Pix
*>
operator
()(
Pix
px
);
::
ranges
::
sub
range
<
P
*>
offsets
()
const
;
};
...
...
@@ -57,7 +57,7 @@ namespace mln::archetypes
using
decomposable
=
std
::
true_type
;
bool
is_decomposable
()
const
;
::
ranges
::
iterator_
range
<
mln
::
archetypes
::
StructuringElement
<
P
,
Pix
>*>
decompose
()
const
;
::
ranges
::
sub
range
<
mln
::
archetypes
::
StructuringElement
<
P
,
Pix
>*>
decompose
()
const
;
};
template
<
class
P
,
class
Pix
>
...
...
@@ -66,7 +66,7 @@ namespace mln::archetypes
using
separable
=
std
::
true_type
;
bool
is_separable
()
const
;
::
ranges
::
iterator_
range
<
mln
::
archetypes
::
StructuringElement
<
P
,
Pix
>*>
separate
()
const
;
::
ranges
::
sub
range
<
mln
::
archetypes
::
StructuringElement
<
P
,
Pix
>*>
separate
()
const
;
};
template
<
class
P
,
class
Pix
>
...
...
pylene/include/mln/core/concept/new/domains.hpp
View file @
d6c62704
...
...
@@ -35,7 +35,7 @@ namespace mln::concepts
concept
SizedDomain
=
Domain
<
Dom
>
&&
requires
(
const
Dom
cdom
)
{
{
cdom
.
size
()
}
->
::
concepts
::
unsigned_integral
&&
;
{
cdom
.
size
()
}
->
::
concepts
::
unsigned_integral
;
};
// ShapedDomain
...
...
@@ -44,7 +44,7 @@ namespace mln::concepts
SizedDomain
<
Dom
>
&&
requires
(
const
Dom
cdom
)
{
{
cdom
.
shape
()
}
->
::
ranges
::
range_value_t
<
Dom
>
;
{
cdom
.
extents
()
}
->
::
ranges
::
cpp20
::
forward_range
&&
;
{
cdom
.
extents
()
}
->
::
ranges
::
cpp20
::
forward_range
;
};
#endif // PYLENE_CONCEPT_TS_ENABLED
...
...
pylene/include/mln/core/concept/new/images.hpp
View file @
d6c62704
...
...
@@ -74,11 +74,11 @@ namespace mln::concepts
::
concepts
::
common_reference_with
<
image_value_t
<
I
>&&
,
const
image_value_t
<
I
>&>
&&
requires
(
I
ima
,
const
I
cima
,
image_domain_t
<
I
>
d
,
image_point_t
<
I
>
p
)
{
{
cima
.
template
ch_value
<
mln
::
archetypes
::
Value
>()
}
->
::
concepts
::
convertible_to
<
image_ch_value_t
<
I
,
mln
::
archetypes
::
Value
>>
&&
;
{
cima
.
concretize
()
}
->
::
concepts
::
convertible_to
<
image_concrete_t
<
I
>>
&&
;
->
::
concepts
::
convertible_to
<
image_ch_value_t
<
I
,
mln
::
archetypes
::
Value
>>
;
{
cima
.
concretize
()
}
->
::
concepts
::
convertible_to
<
image_concrete_t
<
I
>>
;
{
cima
.
domain
()
}
->
image_domain_t
<
I
>
;
{
ima
.
new_pixels
()
}
->
mln
::
ranges
::
mdrange
&&
;
{
ima
.
new_values
()
}
->
mln
::
ranges
::
mdrange
&&
;
{
ima
.
new_pixels
()
}
->
mln
::
ranges
::
mdrange
;
{
ima
.
new_values
()
}
->
mln
::
ranges
::
mdrange
;
requires
::
concepts
::
convertible_to
<
mln
::
ranges
::
mdrange_value_t
<
decltype
(
ima
.
new_pixels
())
>
,
image_pixel_t
<
I
>>
;
requires
::
concepts
::
convertible_to
<
mln
::
ranges
::
mdrange_value_t
<
decltype
(
ima
.
new_values
())
>
,
image_value_t
<
I
>>
;
};
...
...
@@ -93,7 +93,7 @@ namespace mln::concepts
Image
<
I
>
&&
OutputPixel
<
image_pixel_t
<
I
>>
&&
requires
(
I
ima
)
{
{
ima
.
new_values
()
}
->
mln
::
ranges
::
output_mdrange
<
image_value_t
<
I
>>
&&
;
{
ima
.
new_values
()
}
->
mln
::
ranges
::
output_mdrange
<
image_value_t
<
I
>>
;
// Check Writability of each pixel of the range
requires
OutputPixel
<
std
::
common_type_t
<
...
...
@@ -201,8 +201,8 @@ namespace mln::concepts
Image
<
I
>
&&
::
concepts
::
derived_from
<
image_category_t
<
I
>
,
bidirectional_image_tag
>
&&
requires
(
I
ima
)
{
{
ima
.
new_pixels
()
}
->
mln
::
ranges
::
reversible_mdrange
&&
;
{
ima
.
new_values
()
}
->
mln
::
ranges
::
reversible_mdrange
&&
;
{
ima
.
new_pixels
()
}
->
mln
::
ranges
::
reversible_mdrange
;
{
ima
.
new_values
()
}
->
mln
::
ranges
::
reversible_mdrange
;
};
...
...
@@ -225,7 +225,7 @@ namespace mln::concepts
BidirectionalImage
<
I
>
&&
::
concepts
::
derived_from
<
image_category_t
<
I
>
,
raw_image_tag
>
&&
requires
(
I
ima
,
const
I
cima
,
int
dim
)
{
{
ima
.
data
()
}
->
::
concepts
::
convertible_to
<
const
image_value_t
<
I
>*>
&&
;
// data() may be proxied by a view
{
ima
.
data
()
}
->
::
concepts
::
convertible_to
<
const
image_value_t
<
I
>*>
;
// data() may be proxied by a view
{
cima
.
strides
(
dim
)
}
->
std
::
ptrdiff_t
;
};
...
...
@@ -241,7 +241,7 @@ namespace mln::concepts
WritableBidirectionalImage
<
I
>
&&
RawImage
<
I
>
&&
requires
(
I
ima
,
image_value_t
<
I
>
v
)
{
{
ima
.
data
()
}
->
::
concepts
::
convertible_to
<
image_value_t
<
I
>*>
&&
;
{
ima
.
data
()
}
->
::
concepts
::
convertible_to
<
image_value_t
<
I
>*>
;
{
*
(
ima
.
data
())
=
v
};
};
...
...
pylene/include/mln/core/concept/new/neighborhoods.hpp
View file @
d6c62704
...
...
@@ -25,10 +25,10 @@ namespace mln::concepts
concept
Neighborhood
=
StructuringElement
<
SE
,
P
>
&&
requires
(
SE
se
,
P
p
,
mln
::
archetypes
::
PixelT
<
P
>
px
)
{
{
se
.
before
(
p
)
}
->
::
ranges
::
cpp20
::
forward_range
&&
;
{
se
.
after
(
p
)
}
->
::
ranges
::
cpp20
::
forward_range
&&
;
{
se
.
before
(
px
)
}
->
::
ranges
::
cpp20
::
forward_range
&&
;
{
se
.
after
(
px
)
}
->
::
ranges
::
cpp20
::
forward_range
&&
;
{
se
.
before
(
p
)
}
->
::
ranges
::
cpp20
::
forward_range
;
{
se
.
after
(
p
)
}
->
::
ranges
::
cpp20
::
forward_range
;
{
se
.
before
(
px
)
}
->
::
ranges
::
cpp20
::
forward_range
;
{
se
.
after
(
px
)
}
->
::
ranges
::
cpp20
::
forward_range
;
requires
::
concepts
::
convertible_to
<::
ranges
::
range_value_t
<
decltype
(
se
.
before
(
p
))
>
,
P
>
;
requires
::
concepts
::
convertible_to
<::
ranges
::
range_value_t
<
decltype
(
se
.
after
(
p
))
>
,
P
>
;
...
...
pylene/include/mln/core/concept/new/pixels.hpp
View file @
d6c62704
...
...
@@ -40,9 +40,13 @@ namespace mln
!
std
::
is_const_v
<
pixel_value_t
<
Pix
>>
&&
!
std
::
is_reference_v
<
pixel_value_t
<
Pix
>>
&&
requires
(
const
Pix
cpix
,
Pix
pix
,
pixel_point_t
<
Pix
>
p
)
{
{
cpix
.
point
()
}
->
::
concepts
::
convertible_to
<
pixel_point_t
<
Pix
>>&&
;
{
cpix
.
point
()
}
->
::
concepts
::
convertible_to
<
pixel_point_t
<
Pix
>>
;
#if (__GNUG__) // see https://stackoverflow.com/questions/55198202/unable-to-deduce-placeholder-type-in-concept
{
cpix
.
val
()
}
->
::
concepts
::
convertible_to
<
pixel_reference_t
<
Pix
>>&&
;
{
pix
.
shift
(
p
)
}
#else
{
cpix
.
val
()
}
->
::
concepts
::
convertible_to
<
pixel_reference_t
<
Pix
>>
;
#endif
{
pix
.
shift
(
p
)
};
};