Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1278467
ci: :green_heart: update trigger for "releases/**" branches
dubusster Dec 11, 2023
e65f0d2
build: :tada: removing plugin architecture and fix some bug in cmake …
dubusster Dec 1, 2023
83bd4ea
build: :wrench: add LibrirTargets.cmake
dubusster Dec 12, 2023
e771155
build: :bookmark: bump version 5.0.0
dubusster Dec 13, 2023
c6dcc04
build: :wrench: create setup.py by configuring it
dubusster Dec 13, 2023
8ff898e
ci: :construction_worker: add codecov
dubusster Dec 13, 2023
71f8991
test: :test_tube: add test for video_io
dubusster Dec 14, 2023
401cd36
test: :white_check_mark: passing some tests
dubusster Dec 14, 2023
8b16ebc
test: :white_check_mark: add registration tests
dubusster Dec 14, 2023
6d6353e
build: :adhesive_bandage: fix missing requirement in setup.py.in
dubusster Dec 14, 2023
5533749
chore: :fire: remove WEST related scripts
dubusster Dec 14, 2023
0266c85
test: :white_check_mark: remove west related tests + various testing
dubusster Dec 14, 2023
7833171
refactor: :recycle: huge code cleaning
dubusster Dec 15, 2023
362fafd
test: :white_check_mark: add pcr related tests + remove survir_data
dubusster Dec 15, 2023
33b8c86
refactor: :recycle: remove some unnecessary methods on frame attributes
dubusster Dec 18, 2023
902522d
test: :white_check_mark: add stub test on emissivity
dubusster Dec 18, 2023
d0900ad
refactor: :recycle: remove optical tempartures as it is not relevant
dubusster Dec 18, 2023
3727992
chore: :label: some typing and import clean
dubusster Dec 18, 2023
689ae1e
test: :white_check_mark: add several tests on registrator, test_manag…
dubusster Dec 18, 2023
773626a
chore: :fire: remove all ZFile
dubusster Dec 19, 2023
c510480
refactor: ♻️ enable_bad_pixels to bad_pixels_correction property
dubusster Dec 19, 2023
e98cd2b
build: :sparkles: move from setup.py to pyproject.toml
dubusster Dec 20, 2023
92b0674
build: :wrench: update build scripts
dubusster Dec 20, 2023
7654524
build: :bug: fix package_data in pyproject.toml
dubusster Dec 20, 2023
f9ada37
build: :wrench: add __version__ in __init__.py when installing
dubusster Dec 21, 2023
2620ed0
ci: :wrench: add coverage badge on README.md
dubusster Dec 21, 2023
e42429e
refactor: :fire: remove extractInfos method
dubusster Jan 4, 2024
22c39d1
refactor: :recycle: exposing tostring_binary32 and serializeTimePoint
dubusster Jan 4, 2024
765b23c
refactor: :fire: remove WEST specific parameters
dubusster Jan 8, 2024
4cb4d7d
refactor: ♻️ fix loadTranslationFile method
dubusster Jan 8, 2024
bc7fac3
chore: :see_no_evil: update gitignore
dubusster Jan 8, 2024
6df4d0a
test: :white_check_mark: remove west related tests
dubusster Jan 8, 2024
ff6dd9b
refactor: :recycle: add setCalibration to IRVideoLoader
dubusster Jan 10, 2024
a0966fc
refactor: :recycle: add is_in_T to IRFileLoader
dubusster Jan 11, 2024
e4c5afc
Merge branch 'main' into releases/v5.0.0
dubusster Jan 12, 2024
c97b9b1
fix: :bug: discriminate return value in flip_calibration
dubusster Jan 17, 2024
92e6fbb
test: :white_check_mark: add test_flip_camera_calibration
dubusster Jan 17, 2024
b427112
build: :fire: remove README.md waste
dubusster Jan 17, 2024
b327a21
build: :pushpin: set kvazaar version to 2.2.0
dubusster Jan 18, 2024
5c76db5
test: ✅ passing tests
dubusster Jan 19, 2024
570e554
test: :white_check_mark: update tests
dubusster Jan 19, 2024
2ed92a0
fix: :bug: missing calibration in constructor
dubusster Feb 2, 2024
e027e2d
refacto: :recycle: add _parse_calibration_index
dubusster Feb 19, 2024
7c8d871
perf: :zap: add check before getting _frame_attributes_d
dubusster Feb 19, 2024
0357d0e
docs: :memo: fix comment in calibration method
dubusster Feb 19, 2024
5ad2150
Added prototype for video downsampling
Thermadiag Feb 20, 2024
e4dc380
Merge remote-tracking branch 'origin/downsampler' into releases/v5.0.0
dubusster Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = src/python/librir/tools/_thermavip.py
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "releases/**" ]
workflow_dispatch:
inputs:
compiler:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "releases/**" ]
workflow_dispatch:
inputs:
compiler:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "releases/**" ]
workflow_dispatch:
workflow_call:

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install ruff pytest pytest-cov
pip install -e build/install
pip install -e build/install/python

- name: Test with pytest
continue-on-error: false
run: |
python -m pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=librir tests/python -m "not thermavip" | tee pytest-coverage.txt

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# - name: Pytest coverage comment
# uses: MishaKav/pytest-coverage-comment@main
# with:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,7 @@ plugins/*

.vscode/*

src/python/setup.py
src/python/pyproject.toml
src/python/README.md
src/python/librir/libs
3 changes: 3 additions & 0 deletions 3rd_64/build-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ else
echo "Dir $FILE does not exist."
git clone https://github.com/ultravideo/kvazaar.git
fi
cd kvazaar
git checkout v2.2.0
cd ..

FILE=kvazaar/install/lib/pkgconfig/kvazaar.pc
if [ -f $FILE ]; then
Expand Down
140 changes: 42 additions & 98 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cmake_minimum_required(VERSION 3.16)

project(librir
VERSION 4.2.0
VERSION 5.0.0
DESCRIPTION "librir"
HOMEPAGE_URL "https://github.com/IRFM/librir"
LANGUAGES CXX C
Expand All @@ -12,50 +12,36 @@ project(librir
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(GNUInstallDirs)

option(LOCAL_INSTALL "Install locally" ON)
option(WITH_WEST "Fetch WEST plugin" OFF)

IF(LOCAL_INSTALL)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)
SET(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/install)
MESSAGE(STATUS ${CMAKE_INSTALL_PREFIX})
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)

IF(NOT MSVC)
SET(CMAKE_INSTALL_RPATH $ORIGIN)

SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
#~ SET(CMAKE_INSTALL_RPATH_USE_ORIGIN TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
ENDIF()
ENDIF()


IF(WITH_WEST)
IF(EXISTS ${PROJECT_SOURCE_DIR}/plugins/west)
message(STATUS "Pulling WEST repository...")
execute_process(COMMAND git pull WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/plugins/west)
ELSE()
message(STATUS "Cloning WEST repository...")
execute_process(COMMAND git clone http://irfm-gitlab.intra.cea.fr/data-analysis/infrared/west.git ${PROJECT_SOURCE_DIR}/plugins/west)
ENDIF()
endif()

include(GNUInstallDirs)

IF (UNIX)
execute_process(COMMAND "chmod 100755 configure_ffmpeg")
ENDIF()

IF (NOT MSVC)
# Create a dummy target to build ffmpeg as a prebuild step
add_custom_target(ffmpeg BYPRODUCTS "${PROJECT_SOURCE_DIR}/build_ffmpeg.h"
COMMAND ${PROJECT_SOURCE_DIR}/configure_ffmpeg)
add_executable(dummy ${PROJECT_SOURCE_DIR}/dummy.c "${PROJECT_SOURCE_DIR}/build_ffmpeg.h")
target_include_directories(dummy PRIVATE "${PROJECT_SOURCE_DIR}")

# Create a dummy target to build ffmpeg as a prebuild step
add_custom_target(ffmpeg BYPRODUCTS "${PROJECT_SOURCE_DIR}/build_ffmpeg.h"
COMMAND ${PROJECT_SOURCE_DIR}/configure_ffmpeg)
add_executable(dummy ${PROJECT_SOURCE_DIR}/dummy.c "${PROJECT_SOURCE_DIR}/build_ffmpeg.h")
target_include_directories(dummy PRIVATE "${PROJECT_SOURCE_DIR}")
ENDIF()


Expand All @@ -72,99 +58,57 @@ IF (WIN32)
add_definitions("-D_WINDOWS")
ENDIF()



configure_file(rir_config.h.in rir_config.h)
install(FILES ${CMAKE_BINARY_DIR}/rir_config.h DESTINATION include)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rir_config.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)

option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
# set(THREADS_PREFER_PTHREAD_FLAG ON)
add_subdirectory(extra)

INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})


# # DOCTEST
# set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_BINARY_DIR}/doctest/doctest.h)
# set(doctest_FOUND FALSE)
# # Expose required variable (DOCTEST_INCLUDE_DIR) to parent scope
# set(DOCTEST_INCLUDE_DIR ${CMAKE_BINARY_DIR}/doctest/src/doctest CACHE INTERNAL "Path to include folder for doctest")
# IF(EXISTS ${DOCTEST_INCLUDE_DIR}/doctest/doctest.h)
# set(doctest_FOUND TRUE)
# endif()
# MESSAGE(STATUS ${doctest_FOUND})
# if(NOT doctest_FOUND)
# include(ExternalProject)
# find_package(Git)
# if(Git_FOUND)
# ExternalProject_Add(
# doctest
# PREFIX ${CMAKE_BINARY_DIR}/doctest
# GIT_REPOSITORY https://github.com/onqtam/doctest.git
# TIMEOUT 10
# UPDATE_COMMAND ${GIT_EXECUTABLE} pull
# CONFIGURE_COMMAND ""
# BUILD_COMMAND ""
# INSTALL_COMMAND ""
# LOG_DOWNLOAD ON
# )
# endif()
# endif()
# include_directories(${DOCTEST_INCLUDE_DIR})

# list(APPEND TARGETS ${PRESENT_PLUGINS})
# message(STATUS "PRESENT_PLUGINS : " ${PRESENT_PLUGINS})
# message(STATUS "TARGETS : " ${TARGETS})
# add it globally
# TODO: move all elements in extra folder to dedicated FetchContent/find_package modules
add_subdirectory(extra)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

# Create global variable used in librir.pc.in
# Plugins can add libraries to link with for generated librir.pc
set(PLUGINS_LIBS "" CACHE INTERNAL "")

set(PLUGINS_PYTHON_REQUIRE "" CACHE INTERNAL "")

# Pusue compilation
add_subdirectory(src)
add_subdirectory(plugins)
add_subdirectory(tests)

# enable_testing()
# TOREMOVE

# find_package(Python COMPONENTS Interpreter)
# IF(NOT Python_FOUND)

# MESSAGE(STATUS "PYTHON NOT FOUND")

# endif()

# MESSAGE(STATUS "found python")


# Perform this action once more (already done in src/CMakeLists.txt) to copy plugins binaries
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/
DESTINATION ${CMAKE_INSTALL_PREFIX}/librir/libs
)

# # Perform this action to copy shared objects into python source folder (for devlopment purposes)
# install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/
# DESTINATION ${CMAKE_SOURCE_DIR}/src/python/librir/libs
# )

# Generate requirements.txt
configure_file(requirements.txt.in requirements.txt @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/requirements.txt DESTINATION ${CMAKE_INSTALL_PREFIX})


#set(INCLUDE_DIR "include" CACHE PATH "Location of header files" )
#set(LIB_DIR "lib lib64" CACHE PATH "Location of libraries" )
#set(LIBRARIES "tools geometry signal_processing video_io" CACHE PATH "Libraries" )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt DESTINATION ${CMAKE_INSTALL_PREFIX})


install(
TARGETS ${LIBRIR_TARGETS}
PUBLIC_HEADER
ARCHIVE
RUNTIME
)
install(
TARGETS ${LIBRIR_TARGETS}
EXPORT LibrirTargets
)
install(EXPORT LibrirTargets
FILE LibrirTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/librir
NAMESPACE librir::
)


# Configure and install PackageConfig files
include(CMakePackageConfigHelpers)
configure_package_config_file(cmake/librirConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/librirConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake
PATH_VARS
PLUGINS_LIBS)
#INCLUDE_DIR LIB_DIR LIBRARIES PLUGINS_LIBS)
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
)

write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/librirConfigVersion.cmake
Expand All @@ -173,7 +117,7 @@ write_basic_package_version_file(

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librirConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/librirConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake/librir )
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/librir )



Expand All @@ -182,5 +126,5 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librirConfig.cmake
list(TRANSFORM PLUGINS_LIBS PREPEND "-l")
configure_file(librir.pc.in librir.pc @ONLY)
configure_file(librir.pc.in ${CMAKE_INSTALL_LIBDIR}/pkgconfig/librir.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/librir.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librir.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build on Linux](https://github.com/IRFM/librir/actions/workflows/build-linux.yml/badge.svg)](https://github.com/IRFM/librir/actions/workflows/build-linux.yml)
[![Build on Windows](https://github.com/IRFM/librir/actions/workflows/build-windows.yml/badge.svg?branch=main)](https://github.com/IRFM/librir/actions/workflows/build-windows.yml)
[![codecov](https://codecov.io/gh/IRFM/librir/graph/badge.svg?token=33OAGARS5K)](https://codecov.io/gh/IRFM/librir)

# Librir

Expand Down
10 changes: 1 addition & 9 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@echo off

SET USE_WEST=0
SET CMAKE_OPTIONS=-DLOCAL_INSTALL=ON
SET CMAKE_BUILD=Release
SET WHEEL=0
Expand All @@ -16,12 +15,6 @@ IF NOT "%1"=="" (
SET CMAKE_BUILD=Debug
) ELSE IF "%1"=="-d" (
SET CMAKE_BUILD=Debug
) ELSE IF "%1"=="--with" (
SET URL=%2
SHIFT
cd plugins
CALL :clone_pull %URL%
cd ..
) ELSE IF "%1"=="--build-wheel" (
SET WHEEL=1
) ELSE IF "%1"=="--global" (
Expand All @@ -47,7 +40,7 @@ REM Build wheel if necessary
IF "%WHEEL%" == "1" (
cd install
python -c "import librir;print('librir is importable !')"
python setup.py bdist_wheel
pip wheel --no-deps .
cd ..
)
cd ..
Expand All @@ -59,7 +52,6 @@ echo "Build script for librir"
echo
echo "Usage:"
echo "--help display help"
echo "--with download and compile the given plugin using its git url"
echo "--debug debug build only (default is release only)"
echo "--build-wheel build Python wheel package"
echo "--global global installation instead of local one"
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ make install
# Build wheel if necessary
if [ "$WHEEL" -eq "1" ]; then
echo "Build wheel"
cd install
cd install/python
python -c "import librir;print('librir is importable !')"
python setup.py bdist_wheel
pip wheel --no-deps .
cd ..
fi

Expand Down
17 changes: 2 additions & 15 deletions extra/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# TODO: get blosc, minizip, jpeg-9b, charls from official repositories with FetchContent/find_package

IF(MSVC)
SET(MINIZIP_SRC
Expand Down Expand Up @@ -84,10 +84,6 @@ SET(MINIZIP_SRC
)
ENDIF()

# SET(ZSTD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zstd PARENT_SCOPE)

# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/zstd)


add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/blosc)
SET(BLOSC_SRC ${BLOSC_SRC} PARENT_SCOPE)
Expand All @@ -102,13 +98,4 @@ SET(JPEG9B_SRC ${JPEG9B_SRC} PARENT_SCOPE)
SET(CHARLS_SRC ${CHARLS_SRC} PARENT_SCOPE)


SET(EXTRAS_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)

# SET(ZSTD_INCLUDE_DIR
# ${ZSTD_INCLUDE_DIR}
# PARENT_SCOPE
# )
# SET(ZSTD_SRC
# ${ZSTD_SRC}
# PARENT_SCOPE
# )
SET(EXTRAS_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
8 changes: 4 additions & 4 deletions librir.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ libdir="${prefix}/lib"
includedir="${prefix}/include"

Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Description: @PROJECT_DESCRIPTION@
URL: @PROJECT_HOMEPAGE_URL@
Version: @PROJECT_VERSION@
Cflags: -I"${includedir}"
Libs: -L"${libdir}" -ltools -lgeometry -lsignal_processing -lvideo_io @PLUGINS_LIBS@
Libs.private: -L"${libdir}" -ltools -lgeometry -lsignal_processing -lvideo_io @PLUGINS_LIBS@
Libs: -L"${libdir}" -ltools -lgeometry -lsignal_processing -lvideo_io
Libs.private: -L"${libdir}" -ltools -lgeometry -lsignal_processing -lvideo_io
Loading