From 8e27afdb47cbb467167cc65b9fa84f25d8c8d6ba Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Mon, 6 Nov 2023 16:58:11 +0100 Subject: [PATCH 01/32] Move czicompress source to subfolder --- .github/actions/cmake-build/action.yml | 7 + .github/workflows/codeql.yml | 6 +- .../{cmake.yml => czicompress_cmake.yml} | 16 +- .reuse/dep5 | 4 +- README.md | 283 +---------------- .clang-format => czicompress/.clang-format | 0 .gitignore => czicompress/.gitignore | 0 .runsettings => czicompress/.runsettings | 0 CMakeLists.txt => czicompress/CMakeLists.txt | 0 .../CMakeSettings.json | 0 CPPLINT.cfg => czicompress/CPPLINT.cfg | 0 LICENSE => czicompress/LICENSE | 0 czicompress/README.md | 291 ++++++++++++++++++ ...D_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt | 0 {app => czicompress/app}/CMakeLists.txt | 0 .../app}/CZICompress_Config.h.in | 0 {app => czicompress/app}/CZIcompress.cpp | 0 .../app}/commandlineargshelper.cpp | 0 .../app}/commandlineargshelper.h | 0 .../app}/czicompress-longpaths.manifest | 0 .../czicompress-longpaths.manifest.license | 0 {capi => czicompress/capi}/CMakeLists.txt | 0 .../capi}/CZICompress_Config.h.in | 0 .../capi}/CZICompress_Resource.rc.in | 0 {capi => czicompress/capi}/capi.cpp | 0 {capi => czicompress/capi}/capi.h | 0 {cmake => czicompress/cmake}/SemVer.cmake | 0 {lib => czicompress/lib}/CMakeLists.txt | 0 .../lib}/CZICompress_Config.h.in | 0 {lib => czicompress/lib}/inc_libCZI.h | 0 {lib => czicompress/lib}/include/IConsoleio.h | 0 {lib => czicompress/lib}/include/IOperation.h | 0 {lib => czicompress/lib}/include/command.h | 0 .../lib}/include/commandlineoptions.h | 0 .../lib}/include/compressionstrategy.h | 0 .../lib}/include/progressinfo.h | 0 .../utils/errorhandling/winerrorformatting.h | 0 .../lib}/include/utils/utf8/utf8converter.h | 0 .../lib}/src/actionwithsubblockstatistics.h | 0 .../lib}/src/commandlineoptions.cpp | 0 {lib => czicompress/lib}/src/consoleio.cpp | 0 {lib => czicompress/lib}/src/consoleio.h | 0 {lib => czicompress/lib}/src/copyczi.cpp | 0 {lib => czicompress/lib}/src/copyczi.h | 0 {lib => czicompress/lib}/src/operation.cpp | 0 {lib => czicompress/lib}/src/operation.h | 0 {lib => czicompress/lib}/src/progressinfo.cpp | 0 .../errorhandling/winerrorformatting.cpp | 0 .../utf8/platforms/posix/utf8converter.cpp | 0 .../utf8/platforms/windows/utf8converter.cpp | 0 {tests => czicompress/tests}/CMakeLists.txt | 0 {tests => czicompress/tests}/libczi_utils.cpp | 0 {tests => czicompress/tests}/libczi_utils.h | 0 .../tests}/test_commandlineparsing.cpp | 0 .../tests}/test_copyoperation.cpp | 0 .../tests}/test_utf8_utils.cpp | 0 56 files changed, 316 insertions(+), 291 deletions(-) rename .github/workflows/{cmake.yml => czicompress_cmake.yml} (91%) rename .clang-format => czicompress/.clang-format (100%) rename .gitignore => czicompress/.gitignore (100%) rename .runsettings => czicompress/.runsettings (100%) rename CMakeLists.txt => czicompress/CMakeLists.txt (100%) rename CMakeSettings.json => czicompress/CMakeSettings.json (100%) rename CPPLINT.cfg => czicompress/CPPLINT.cfg (100%) rename LICENSE => czicompress/LICENSE (100%) create mode 100644 czicompress/README.md rename THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt => czicompress/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt (100%) rename {app => czicompress/app}/CMakeLists.txt (100%) rename {app => czicompress/app}/CZICompress_Config.h.in (100%) rename {app => czicompress/app}/CZIcompress.cpp (100%) rename {app => czicompress/app}/commandlineargshelper.cpp (100%) rename {app => czicompress/app}/commandlineargshelper.h (100%) rename {app => czicompress/app}/czicompress-longpaths.manifest (100%) rename {app => czicompress/app}/czicompress-longpaths.manifest.license (100%) rename {capi => czicompress/capi}/CMakeLists.txt (100%) rename {capi => czicompress/capi}/CZICompress_Config.h.in (100%) rename {capi => czicompress/capi}/CZICompress_Resource.rc.in (100%) rename {capi => czicompress/capi}/capi.cpp (100%) rename {capi => czicompress/capi}/capi.h (100%) rename {cmake => czicompress/cmake}/SemVer.cmake (100%) rename {lib => czicompress/lib}/CMakeLists.txt (100%) rename {lib => czicompress/lib}/CZICompress_Config.h.in (100%) rename {lib => czicompress/lib}/inc_libCZI.h (100%) rename {lib => czicompress/lib}/include/IConsoleio.h (100%) rename {lib => czicompress/lib}/include/IOperation.h (100%) rename {lib => czicompress/lib}/include/command.h (100%) rename {lib => czicompress/lib}/include/commandlineoptions.h (100%) rename {lib => czicompress/lib}/include/compressionstrategy.h (100%) rename {lib => czicompress/lib}/include/progressinfo.h (100%) rename {lib => czicompress/lib}/include/utils/errorhandling/winerrorformatting.h (100%) rename {lib => czicompress/lib}/include/utils/utf8/utf8converter.h (100%) rename {lib => czicompress/lib}/src/actionwithsubblockstatistics.h (100%) rename {lib => czicompress/lib}/src/commandlineoptions.cpp (100%) rename {lib => czicompress/lib}/src/consoleio.cpp (100%) rename {lib => czicompress/lib}/src/consoleio.h (100%) rename {lib => czicompress/lib}/src/copyczi.cpp (100%) rename {lib => czicompress/lib}/src/copyczi.h (100%) rename {lib => czicompress/lib}/src/operation.cpp (100%) rename {lib => czicompress/lib}/src/operation.h (100%) rename {lib => czicompress/lib}/src/progressinfo.cpp (100%) rename {lib => czicompress/lib}/src/utils/errorhandling/winerrorformatting.cpp (100%) rename {lib => czicompress/lib}/src/utils/utf8/platforms/posix/utf8converter.cpp (100%) rename {lib => czicompress/lib}/src/utils/utf8/platforms/windows/utf8converter.cpp (100%) rename {tests => czicompress/tests}/CMakeLists.txt (100%) rename {tests => czicompress/tests}/libczi_utils.cpp (100%) rename {tests => czicompress/tests}/libczi_utils.h (100%) rename {tests => czicompress/tests}/test_commandlineparsing.cpp (100%) rename {tests => czicompress/tests}/test_copyoperation.cpp (100%) rename {tests => czicompress/tests}/test_utf8_utils.cpp (100%) diff --git a/.github/actions/cmake-build/action.yml b/.github/actions/cmake-build/action.yml index 22c6f30..bc4a2b2 100644 --- a/.github/actions/cmake-build/action.yml +++ b/.github/actions/cmake-build/action.yml @@ -20,6 +20,9 @@ inputs: platform: description: 'OS platform' required: true + src-dir: + description: 'The directory with the sources' + required: true runs: using: "composite" steps: @@ -33,11 +36,13 @@ runs: - name: Set toolchain path shell: bash + working-directory: ${{inputs.src-dir}} run: echo "TOOLCHAIN_PATH=${{inputs.path-toolchain}}" >> "$GITHUB_ENV" - name: Install dependencies if: inputs.package == 'ON' shell: bash + working-directory: ${{inputs.src-dir}} run: | # We install the following packages: eigen3, catch2, cli11. Installing them with vcpkg (and caching them) # is faster than downloading and building them from source (which is the default behavior of the CZICompress-build-system). @@ -45,6 +50,7 @@ runs: - name: Configure CMake shell: bash + working-directory: ${{inputs.src-dir}} # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type # @@ -53,5 +59,6 @@ runs: - name: Build software shell: bash + working-directory: ${{inputs.src-dir}} # Build your program with the given configuration run: cmake --build build --config ${{inputs.build-type}} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f1c435e..b7fd5ca 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,10 @@ permissions: jobs: analyze: - name: Analyze + name: Analyze CPP + defaults: + run: + working-directory: ${{github.workspace}}/czicompress runs-on: ubuntu-latest strategy: @@ -50,6 +53,7 @@ jobs: build-type: Release package: ON platform: x64-linux + src-dir: '${{github.workspace}}/czicompress' - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/cmake.yml b/.github/workflows/czicompress_cmake.yml similarity index 91% rename from .github/workflows/cmake.yml rename to .github/workflows/czicompress_cmake.yml index ff299c1..809142f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -4,8 +4,10 @@ name: CMake Build on: push: branches: ["main"] # run only when merge with main branch + paths: ["czicompress/**"] pull_request: branches: ["main"] # run only when merge with main branch + paths: ["czicompress/**"] permissions: contents: read @@ -17,6 +19,9 @@ env: jobs: build-tests: + defaults: + run: + working-directory: ${{github.workspace}}/czicompress name: ${{matrix.config.name}} runs-on: ${{matrix.config.os}} @@ -46,7 +51,7 @@ jobs: package: ON, path-cache: '${{ github.workspace }}\vcpkg\installed', path-toolchain: 'C:/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'windows' + os-id: 'windows', } - { name: ubuntu-release-package-on, @@ -55,7 +60,7 @@ jobs: package: ON, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'linux' + os-id: 'linux', } steps: @@ -71,17 +76,18 @@ jobs: build-type: ${{env.BUILD_TYPE}} package: ${{matrix.config.package}} platform: ${{matrix.config.platform}} + src-dir: '${{github.workspace}}/czicompress' - name: Run unit tests - working-directory: ${{github.workspace}}/build + working-directory: ${{github.workspace}}/czicompress/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{env.BUILD_TYPE}} - name: Prepare licenses - working-directory: ${{github.workspace}} shell: bash run: | + set -e mkdir ./czicompress-${{matrix.config.name}} cp -R ./THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt ./czicompress-${{matrix.config.name}}/ cp -R ./build/app/THIRD_PARTY_LICENSES.txt ./czicompress-${{matrix.config.name}}/ @@ -89,14 +95,12 @@ jobs: # gather the binaries - name: Prepare Linux binaries if: matrix.config.os == 'ubuntu-20.04' - working-directory: ${{github.workspace}} shell: bash run: | cp ./build/app/czicompress ./build/capi/libczicompressc.so ./czicompress-${{matrix.config.name}}/ - name: Prepare Windows binaries if: matrix.config.os == 'windows-latest' - working-directory: ${{github.workspace}} shell: bash run: | cp ./build/app/${{env.BUILD_TYPE}}/*.exe ./build/capi/${{env.BUILD_TYPE}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/ diff --git a/.reuse/dep5 b/.reuse/dep5 index 7ad3a9f..1b16637 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,10 +3,10 @@ Upstream-Name: czicompress Upstream-Contact: Carl Zeiss Microscopy GmbH Source: https://github.com/ZEISS/czicompress -Files: cla_*.txt CMakeSettings.json CODE_OF_CONDUCT.md CONTRIBUTING.md README.md SECURITY.md THIRD_PARTY_LICENSES*.txt +Files: cla_*.txt czicompress/CMakeSettings.json CODE_OF_CONDUCT.md CONTRIBUTING.md README.md SECURITY.md czicompress/THIRD_PARTY_LICENSES*.txt czicompress/README.md Copyright: 2023 Carl Zeiss Microscopy GmbH License: MIT -Files: .github/* .gitignore .editorconfig .runsettings CPPLINT.cfg .clang-format +Files: .github/* .gitignore czicompress/.editorconfig czicompress/.gitignore czicompress/.runsettings czicompress/CPPLINT.cfg czicompress/.clang-format Copyright: 2023 Carl Zeiss Microscopy GmbH License: CC0-1.0 diff --git a/README.md b/README.md index 48d1b06..8c11db1 100644 --- a/README.md +++ b/README.md @@ -7,285 +7,4 @@ Reduce the size of existing CZI files by converting them to zstd-compressed CZI files. -Copies the content of a CZI-file into another CZI-file changing the compression of the image data. -With the 'compress' command, uncompressed image data is converted to Zstd-compressed image data. -With the 'decompress' command, compressed image data is converted to uncompressed data. - -The tool is based on [libczi](https://github.com/ZEISS/libczi.git). - -## Table of contents - -- [Download](#download) -- [Usage](#usage) - - [Examples](#examples) - - [Single file](#single-file) - - [Multiple files (bash shell)](#multiple-files-bash-shell) - - [Multiple files (Powershell)](#multiple-files-powershell) -- [Build and Test](#build-and-test) - - [Pre-requisites](#pre-requisites) - - [Build in Visual Studio](#build-in-visual-studio) - - [Build in command line](#build-in-command-line) - - [Quick build](#quick-build) - - [Build with preferred compiler](#build-with-preferred-compiler) - - [Tests](#tests) -- [Known issues](#known-issues) -- [Guidelines](#guidelines) -- [Versioning](#versioning) -- [Licensing](#licensing) -- [Credits to Third Party Components](#credits-to-third-party-components) -- [Disclaimer](#disclaimer) - -## Download -We have not yet published any Releases. Meanwhile, you can download binaries from the artifacts of the latest [Build workflow run](https://github.com/zeissmicroscopy/czicompress/actions/workflows/cmake.yml?query=branch%3Amain). -Click on the topmost successful run and download the binaries for your platform: -* czicompress-windows-64-release-msvc-package-off for Windows -* czicompress-ubuntu-release-llvm-package-off for Linux - -Clicking on these artifacts will download a ZIP file with the executable. The executable is a stand-alone binary. You can put it anywhere you like. - -## Usage - -Start the executable from the command line, providing the required command line arguments. - -``` -Usage: czicompress.exe [OPTIONS] - -Options: - -h,--help Print this help message and exit - - -c,--command COMMAND - Specifies the mode of operation: 'compress' to convert to a - zstd-compressed CZI, 'decompress' to convert to a CZI - containing only uncompressed data. - - -i,--input SOURCE_FILE - The source CZI-file to be processed. - - -o,--output DESTINATION_FILE - The destination CZI-file to be written. - - -s,--strategy STRATEGY - Choose which subblocks of the source file are compressed. - STRATEGY can be one of 'all', 'uncompressed', - 'uncompressed_and_zstd'. The default is 'uncompressed'. - - -t,--compression_options COMPRESSION_OPTIONS - Specify compression parameters. The default is - 'zstd1:ExplicitLevel=1;PreProcess=HiLoByteUnpack'. - - -w,--overwrite If the output file exists, try to overwrite it. - - --ignore_duplicate_subblocks BOOLEAN - If this option is enabled, the operation will ignore if - duplicate subblocks are encountered in the source document. - Otherwise, an error will be reported. The default is 'on'. - - -Copies the content of a CZI-file into another CZI-file changing the compression -of the image data. -With the 'compress' command, uncompressed image data is converted to -Zstd-compressed image data. This can reduce the file size substantially. With -the 'decompress' command, compressed image data is converted to uncompressed -data. -For the 'compress' command, a compression strategy can be specified with the -'--strategy' option. It controls which subblocks of the source file will be -compressed. The source document may already contain compressed data (possibly -with a lossy compression scheme). In this case it is undesirable to compress the -data with lossless zstd, as that will almost certainly increase the file size. -Therefore, the "uncompressed" strategy compresses only uncompressed subblocks. -The "uncompressed_and_zstd" strategy compresses the subblocks that are -uncompressed OR compressed with Zstd, and the "all" strategy compresses all -subblocks, regardless of their current compression status. Some compression -schemes that can occur in a CZI-file cannot be decompressed by this tool. Data -compressed with such a scheme will be copied verbatim to the destination file, -regardless of the command and strategy chosen. -``` - -### Examples - -#### Single file -~~~ -czicompress -c compress -i MyImage.czi -o MyImage.zstd.czi -~~~ - -#### Multiple files (bash shell) -* Put czicompress on the PATH -~~~cs -export PATH="${PATH}:/dir/of/czicompress" -~~~ -* Put the following lines into a file called czicompress.sh: -~~~sh -#!/bin/bash -f="$1" -output="${f%%czi}zstd.czi" -echo -n "${f} -> ${output}: " -if [[ -f "$output" ]] -then - echo "Output file already exists." - rm -i "$output" -fi - -if [[ -f "$output" ]] -then - exit 1 -fi - -czicompress --command compress -i "$f" -o "$output" -status=$? -if [[ $status -eq 0 ]] -then - echo OK -fi - -exit $status -~~~ -* Then run -~~~sh -find -type f -name '*.czi' -not -iname '*.zstd.czi' -exec bash czicompress.sh '{}' \; -~~~ - -#### Multiple files (Powershell) -* Put czicompress on the PATH -~~~powershell -$env:Path += ";/dir/of/czicompress" -~~~ -* Put the following lines into a file called czicompress.ps1: -~~~powershell -param( - [Parameter(Mandatory=$true)] - [string]$directory, - [Parameter(Mandatory=$false)] - [string]$command = "compress", - [Parameter(Mandatory=$false)] - [string]$fileExtension = "czi", - [Parameter(Mandatory=$false)] - [string]$outputSuffix = ".zstd", - [Parameter(Mandatory=$false)] - [switch]$recursive = $false -) - -$cziCompressExe = "czicompress.exe" - -$filterString = "*.$($fileExtension)" - -if ($recursive) { - $files = Get-ChildItem -Path $directory -Filter $filterString -Recurse -} else { - $files = Get-ChildItem -Path $directory -Filter $filterString -} - -$files = $files | Where-Object { - $_.Name -notlike "*$outputSuffix$filterString" -} - -$files | ForEach-Object { - $outFileName = "$($_.DirectoryName)\$($_.BaseName)$outputSuffix$($_.Extension)" - Write-Host "$($_) -> $($outFileName)" - if ((Test-Path -Path $outFileName)) { - Write-Host "Output file already exists... Removing" - Remove-Item $outFileName - } - if ((Test-Path -Path $outFileName)) { - Write-Host "Unable to remove file" - # This will act as a continue because this code is executed as a script block and not like a classic for-each loop - return - } - - # The backticks here are to escape the double quotes which exist in case we have spaces in file path. - $execArguments = "& $($cziCompressExe) -i `"$_`" -o `"$($outFileName)`" --command $($command)" - iex $execArguments -} - -exit 0 -~~~ -* Then run -~~~powershell -./czicompress.ps1 -Directory . -~~~ - -## Build and Test - -Build either with Visual Studio or with CMake in command line. - -### Pre-requisites - -The `CZICompress` source codes are implemented using C++17 standard and can be compiled on Windows or Linux and with multiple compilers. You can compile codes by using IDE like Microsoft Visual Studio (MSVS), Visual Studio Code (VSCode) or any other IDE that works with `CMake`. Make sure that on your machine you have one of these tools: - -| | Windows | Linux | -| ---------- | ------------------- | ------------- | -| Build tool | CMake | CMake | -| Compilers | MSVC | GNU, LLVM | -| IDE | MSVS, VSCode, CLion | VSCode, CLion | - - -### Build in Visual Studio - -To build `czicompress` in *Microsoft Visual Studio* (or in *Visual Studio Code*) follow these steps: -1. Open `czicompress` folder in Visual Studio. -2. In the *Solution Explorer* select `CMakeLists.txt` file and make right click. -3. In the popped up menu select `Configure czicompress` (`Configure All Projects` in VSCode). -4. When configuration is finished, right click on `CMakeLists.txt` and the popped up menu select `Build` (`Build All Projects` in the VSCode). - -This configures and builds software using default compilers. - -### Build in command line - -#### Quick build - -On Windows or Linux platform, open the command line window in the cloned `czicompress` directory and type this to configure and build the sources: - -```bash -cmake -B build -DCMAKE_BUILD_TYPE=Release -cmake --build build -j 10 -``` - -This configures `Release` build using system default compiler. After the build, for the Windows platform the `czicompress.exe` executable is located in the `.\build\app\Release\` subdirectory of `czicompress` project directory and for the Linux it is located in the `./build/app/` subdirectory of `czicompress` project directory. - -#### Build with preferred compiler - -If you want to compile using a specific preferred compiler, either set environment variables `CXX` for the C++ compiler and `CC` for the C compiler, or specify compilers as `cmake` options. - -**Example 1:** if you want to compile under Linux or WSL ([Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/about) with LLVM compilers, before configuring build with `cmake` set environment variables. -```bash -export CC=/usr/bin/clang && export CXX=/usr/bin/clang++ -cmake -B ./build -DCMAKE_BUILD_TYPE=Release -``` - -**Example 2:** set the preferred C/C++ compilers as `cmake` options -```bash -cmake -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -``` - -When the configuration is finished, make a build and via parameter `-j` specify the number of parallel jobs you want to run: -```bash -cmake --build ./build --config Release -j 10 -``` - -After the build, the `czicompress` executable will be in `./build/app/czicompress`. - -### Tests - -After the build, run the tests by executing `./build/tests/czicompress_tests`. - -## Known issues - -When compiling in Visual Studio for the first time, you may need to double compile. The Visual Studio is using "Ninja" for building and for some reason it is reporting a linker error `LINK: Fatal error LNK1168: cannot open app\czicompress.exe for writing` despite the fact that the `czicompress.exe` is created. - - -## Guidelines -[Code of Conduct](./CODE_OF_CONDUCT.md) -[Contributing](./CONTRIBUTING.md) - -## Versioning -For czicompress the [semantic versioning scheme 2.0](https://semver.org/) is to be applied. The version number is defined in the top-level [CMakeLists.txt](./CMakeLists.txt). This is the only place where the version number is defined. When making changes, this version number needs to be updated accordingly. For determining whether a change is a breaking one, the source code level is decisive; i.e. not binary compatibility (of the resulting static or dynamic library) is to be considered, but the case of re-compiling with the changed sources. A borderline case are maybe changes in the CMake-files - here the best judgement is to be applied whether a change in the compilation result will occur. - -## Licensing -Carl Zeiss Microscopy GmbH provides czicompress under the [MIT License](./LICENSE). - -## Credits to Third Party Components -As part of our CI/CD, the following 3rd party components are re-distributed: -- [libCZI + 3rd Party Source Code Components](https://github.com/ZEISS/libczi/tree/main#credits-to-third-party-components) -- [libCZI Linked Dependencies + czicompress Linked Dependencies](./THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt) - -## Disclaimer -ZEISS, ZEISS.com are registered trademarks of Carl Zeiss AG. +[More ...](czicompress/README.md) \ No newline at end of file diff --git a/.clang-format b/czicompress/.clang-format similarity index 100% rename from .clang-format rename to czicompress/.clang-format diff --git a/.gitignore b/czicompress/.gitignore similarity index 100% rename from .gitignore rename to czicompress/.gitignore diff --git a/.runsettings b/czicompress/.runsettings similarity index 100% rename from .runsettings rename to czicompress/.runsettings diff --git a/CMakeLists.txt b/czicompress/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to czicompress/CMakeLists.txt diff --git a/CMakeSettings.json b/czicompress/CMakeSettings.json similarity index 100% rename from CMakeSettings.json rename to czicompress/CMakeSettings.json diff --git a/CPPLINT.cfg b/czicompress/CPPLINT.cfg similarity index 100% rename from CPPLINT.cfg rename to czicompress/CPPLINT.cfg diff --git a/LICENSE b/czicompress/LICENSE similarity index 100% rename from LICENSE rename to czicompress/LICENSE diff --git a/czicompress/README.md b/czicompress/README.md new file mode 100644 index 0000000..48d1b06 --- /dev/null +++ b/czicompress/README.md @@ -0,0 +1,291 @@ +# czicompress +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![REUSE status](https://api.reuse.software/badge/github.com/ZEISS/czicompress)](https://api.reuse.software/info/github.com/ZEISS/czicompress) +[![CMake](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml) +[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml) +[![MegaLinter](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml) + +Reduce the size of existing CZI files by converting them to zstd-compressed CZI files. + +Copies the content of a CZI-file into another CZI-file changing the compression of the image data. +With the 'compress' command, uncompressed image data is converted to Zstd-compressed image data. +With the 'decompress' command, compressed image data is converted to uncompressed data. + +The tool is based on [libczi](https://github.com/ZEISS/libczi.git). + +## Table of contents + +- [Download](#download) +- [Usage](#usage) + - [Examples](#examples) + - [Single file](#single-file) + - [Multiple files (bash shell)](#multiple-files-bash-shell) + - [Multiple files (Powershell)](#multiple-files-powershell) +- [Build and Test](#build-and-test) + - [Pre-requisites](#pre-requisites) + - [Build in Visual Studio](#build-in-visual-studio) + - [Build in command line](#build-in-command-line) + - [Quick build](#quick-build) + - [Build with preferred compiler](#build-with-preferred-compiler) + - [Tests](#tests) +- [Known issues](#known-issues) +- [Guidelines](#guidelines) +- [Versioning](#versioning) +- [Licensing](#licensing) +- [Credits to Third Party Components](#credits-to-third-party-components) +- [Disclaimer](#disclaimer) + +## Download +We have not yet published any Releases. Meanwhile, you can download binaries from the artifacts of the latest [Build workflow run](https://github.com/zeissmicroscopy/czicompress/actions/workflows/cmake.yml?query=branch%3Amain). +Click on the topmost successful run and download the binaries for your platform: +* czicompress-windows-64-release-msvc-package-off for Windows +* czicompress-ubuntu-release-llvm-package-off for Linux + +Clicking on these artifacts will download a ZIP file with the executable. The executable is a stand-alone binary. You can put it anywhere you like. + +## Usage + +Start the executable from the command line, providing the required command line arguments. + +``` +Usage: czicompress.exe [OPTIONS] + +Options: + -h,--help Print this help message and exit + + -c,--command COMMAND + Specifies the mode of operation: 'compress' to convert to a + zstd-compressed CZI, 'decompress' to convert to a CZI + containing only uncompressed data. + + -i,--input SOURCE_FILE + The source CZI-file to be processed. + + -o,--output DESTINATION_FILE + The destination CZI-file to be written. + + -s,--strategy STRATEGY + Choose which subblocks of the source file are compressed. + STRATEGY can be one of 'all', 'uncompressed', + 'uncompressed_and_zstd'. The default is 'uncompressed'. + + -t,--compression_options COMPRESSION_OPTIONS + Specify compression parameters. The default is + 'zstd1:ExplicitLevel=1;PreProcess=HiLoByteUnpack'. + + -w,--overwrite If the output file exists, try to overwrite it. + + --ignore_duplicate_subblocks BOOLEAN + If this option is enabled, the operation will ignore if + duplicate subblocks are encountered in the source document. + Otherwise, an error will be reported. The default is 'on'. + + +Copies the content of a CZI-file into another CZI-file changing the compression +of the image data. +With the 'compress' command, uncompressed image data is converted to +Zstd-compressed image data. This can reduce the file size substantially. With +the 'decompress' command, compressed image data is converted to uncompressed +data. +For the 'compress' command, a compression strategy can be specified with the +'--strategy' option. It controls which subblocks of the source file will be +compressed. The source document may already contain compressed data (possibly +with a lossy compression scheme). In this case it is undesirable to compress the +data with lossless zstd, as that will almost certainly increase the file size. +Therefore, the "uncompressed" strategy compresses only uncompressed subblocks. +The "uncompressed_and_zstd" strategy compresses the subblocks that are +uncompressed OR compressed with Zstd, and the "all" strategy compresses all +subblocks, regardless of their current compression status. Some compression +schemes that can occur in a CZI-file cannot be decompressed by this tool. Data +compressed with such a scheme will be copied verbatim to the destination file, +regardless of the command and strategy chosen. +``` + +### Examples + +#### Single file +~~~ +czicompress -c compress -i MyImage.czi -o MyImage.zstd.czi +~~~ + +#### Multiple files (bash shell) +* Put czicompress on the PATH +~~~cs +export PATH="${PATH}:/dir/of/czicompress" +~~~ +* Put the following lines into a file called czicompress.sh: +~~~sh +#!/bin/bash +f="$1" +output="${f%%czi}zstd.czi" +echo -n "${f} -> ${output}: " +if [[ -f "$output" ]] +then + echo "Output file already exists." + rm -i "$output" +fi + +if [[ -f "$output" ]] +then + exit 1 +fi + +czicompress --command compress -i "$f" -o "$output" +status=$? +if [[ $status -eq 0 ]] +then + echo OK +fi + +exit $status +~~~ +* Then run +~~~sh +find -type f -name '*.czi' -not -iname '*.zstd.czi' -exec bash czicompress.sh '{}' \; +~~~ + +#### Multiple files (Powershell) +* Put czicompress on the PATH +~~~powershell +$env:Path += ";/dir/of/czicompress" +~~~ +* Put the following lines into a file called czicompress.ps1: +~~~powershell +param( + [Parameter(Mandatory=$true)] + [string]$directory, + [Parameter(Mandatory=$false)] + [string]$command = "compress", + [Parameter(Mandatory=$false)] + [string]$fileExtension = "czi", + [Parameter(Mandatory=$false)] + [string]$outputSuffix = ".zstd", + [Parameter(Mandatory=$false)] + [switch]$recursive = $false +) + +$cziCompressExe = "czicompress.exe" + +$filterString = "*.$($fileExtension)" + +if ($recursive) { + $files = Get-ChildItem -Path $directory -Filter $filterString -Recurse +} else { + $files = Get-ChildItem -Path $directory -Filter $filterString +} + +$files = $files | Where-Object { + $_.Name -notlike "*$outputSuffix$filterString" +} + +$files | ForEach-Object { + $outFileName = "$($_.DirectoryName)\$($_.BaseName)$outputSuffix$($_.Extension)" + Write-Host "$($_) -> $($outFileName)" + if ((Test-Path -Path $outFileName)) { + Write-Host "Output file already exists... Removing" + Remove-Item $outFileName + } + if ((Test-Path -Path $outFileName)) { + Write-Host "Unable to remove file" + # This will act as a continue because this code is executed as a script block and not like a classic for-each loop + return + } + + # The backticks here are to escape the double quotes which exist in case we have spaces in file path. + $execArguments = "& $($cziCompressExe) -i `"$_`" -o `"$($outFileName)`" --command $($command)" + iex $execArguments +} + +exit 0 +~~~ +* Then run +~~~powershell +./czicompress.ps1 -Directory . +~~~ + +## Build and Test + +Build either with Visual Studio or with CMake in command line. + +### Pre-requisites + +The `CZICompress` source codes are implemented using C++17 standard and can be compiled on Windows or Linux and with multiple compilers. You can compile codes by using IDE like Microsoft Visual Studio (MSVS), Visual Studio Code (VSCode) or any other IDE that works with `CMake`. Make sure that on your machine you have one of these tools: + +| | Windows | Linux | +| ---------- | ------------------- | ------------- | +| Build tool | CMake | CMake | +| Compilers | MSVC | GNU, LLVM | +| IDE | MSVS, VSCode, CLion | VSCode, CLion | + + +### Build in Visual Studio + +To build `czicompress` in *Microsoft Visual Studio* (or in *Visual Studio Code*) follow these steps: +1. Open `czicompress` folder in Visual Studio. +2. In the *Solution Explorer* select `CMakeLists.txt` file and make right click. +3. In the popped up menu select `Configure czicompress` (`Configure All Projects` in VSCode). +4. When configuration is finished, right click on `CMakeLists.txt` and the popped up menu select `Build` (`Build All Projects` in the VSCode). + +This configures and builds software using default compilers. + +### Build in command line + +#### Quick build + +On Windows or Linux platform, open the command line window in the cloned `czicompress` directory and type this to configure and build the sources: + +```bash +cmake -B build -DCMAKE_BUILD_TYPE=Release +cmake --build build -j 10 +``` + +This configures `Release` build using system default compiler. After the build, for the Windows platform the `czicompress.exe` executable is located in the `.\build\app\Release\` subdirectory of `czicompress` project directory and for the Linux it is located in the `./build/app/` subdirectory of `czicompress` project directory. + +#### Build with preferred compiler + +If you want to compile using a specific preferred compiler, either set environment variables `CXX` for the C++ compiler and `CC` for the C compiler, or specify compilers as `cmake` options. + +**Example 1:** if you want to compile under Linux or WSL ([Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/about) with LLVM compilers, before configuring build with `cmake` set environment variables. +```bash +export CC=/usr/bin/clang && export CXX=/usr/bin/clang++ +cmake -B ./build -DCMAKE_BUILD_TYPE=Release +``` + +**Example 2:** set the preferred C/C++ compilers as `cmake` options +```bash +cmake -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ +``` + +When the configuration is finished, make a build and via parameter `-j` specify the number of parallel jobs you want to run: +```bash +cmake --build ./build --config Release -j 10 +``` + +After the build, the `czicompress` executable will be in `./build/app/czicompress`. + +### Tests + +After the build, run the tests by executing `./build/tests/czicompress_tests`. + +## Known issues + +When compiling in Visual Studio for the first time, you may need to double compile. The Visual Studio is using "Ninja" for building and for some reason it is reporting a linker error `LINK: Fatal error LNK1168: cannot open app\czicompress.exe for writing` despite the fact that the `czicompress.exe` is created. + + +## Guidelines +[Code of Conduct](./CODE_OF_CONDUCT.md) +[Contributing](./CONTRIBUTING.md) + +## Versioning +For czicompress the [semantic versioning scheme 2.0](https://semver.org/) is to be applied. The version number is defined in the top-level [CMakeLists.txt](./CMakeLists.txt). This is the only place where the version number is defined. When making changes, this version number needs to be updated accordingly. For determining whether a change is a breaking one, the source code level is decisive; i.e. not binary compatibility (of the resulting static or dynamic library) is to be considered, but the case of re-compiling with the changed sources. A borderline case are maybe changes in the CMake-files - here the best judgement is to be applied whether a change in the compilation result will occur. + +## Licensing +Carl Zeiss Microscopy GmbH provides czicompress under the [MIT License](./LICENSE). + +## Credits to Third Party Components +As part of our CI/CD, the following 3rd party components are re-distributed: +- [libCZI + 3rd Party Source Code Components](https://github.com/ZEISS/libczi/tree/main#credits-to-third-party-components) +- [libCZI Linked Dependencies + czicompress Linked Dependencies](./THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt) + +## Disclaimer +ZEISS, ZEISS.com are registered trademarks of Carl Zeiss AG. diff --git a/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt b/czicompress/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt similarity index 100% rename from THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt rename to czicompress/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt diff --git a/app/CMakeLists.txt b/czicompress/app/CMakeLists.txt similarity index 100% rename from app/CMakeLists.txt rename to czicompress/app/CMakeLists.txt diff --git a/app/CZICompress_Config.h.in b/czicompress/app/CZICompress_Config.h.in similarity index 100% rename from app/CZICompress_Config.h.in rename to czicompress/app/CZICompress_Config.h.in diff --git a/app/CZIcompress.cpp b/czicompress/app/CZIcompress.cpp similarity index 100% rename from app/CZIcompress.cpp rename to czicompress/app/CZIcompress.cpp diff --git a/app/commandlineargshelper.cpp b/czicompress/app/commandlineargshelper.cpp similarity index 100% rename from app/commandlineargshelper.cpp rename to czicompress/app/commandlineargshelper.cpp diff --git a/app/commandlineargshelper.h b/czicompress/app/commandlineargshelper.h similarity index 100% rename from app/commandlineargshelper.h rename to czicompress/app/commandlineargshelper.h diff --git a/app/czicompress-longpaths.manifest b/czicompress/app/czicompress-longpaths.manifest similarity index 100% rename from app/czicompress-longpaths.manifest rename to czicompress/app/czicompress-longpaths.manifest diff --git a/app/czicompress-longpaths.manifest.license b/czicompress/app/czicompress-longpaths.manifest.license similarity index 100% rename from app/czicompress-longpaths.manifest.license rename to czicompress/app/czicompress-longpaths.manifest.license diff --git a/capi/CMakeLists.txt b/czicompress/capi/CMakeLists.txt similarity index 100% rename from capi/CMakeLists.txt rename to czicompress/capi/CMakeLists.txt diff --git a/capi/CZICompress_Config.h.in b/czicompress/capi/CZICompress_Config.h.in similarity index 100% rename from capi/CZICompress_Config.h.in rename to czicompress/capi/CZICompress_Config.h.in diff --git a/capi/CZICompress_Resource.rc.in b/czicompress/capi/CZICompress_Resource.rc.in similarity index 100% rename from capi/CZICompress_Resource.rc.in rename to czicompress/capi/CZICompress_Resource.rc.in diff --git a/capi/capi.cpp b/czicompress/capi/capi.cpp similarity index 100% rename from capi/capi.cpp rename to czicompress/capi/capi.cpp diff --git a/capi/capi.h b/czicompress/capi/capi.h similarity index 100% rename from capi/capi.h rename to czicompress/capi/capi.h diff --git a/cmake/SemVer.cmake b/czicompress/cmake/SemVer.cmake similarity index 100% rename from cmake/SemVer.cmake rename to czicompress/cmake/SemVer.cmake diff --git a/lib/CMakeLists.txt b/czicompress/lib/CMakeLists.txt similarity index 100% rename from lib/CMakeLists.txt rename to czicompress/lib/CMakeLists.txt diff --git a/lib/CZICompress_Config.h.in b/czicompress/lib/CZICompress_Config.h.in similarity index 100% rename from lib/CZICompress_Config.h.in rename to czicompress/lib/CZICompress_Config.h.in diff --git a/lib/inc_libCZI.h b/czicompress/lib/inc_libCZI.h similarity index 100% rename from lib/inc_libCZI.h rename to czicompress/lib/inc_libCZI.h diff --git a/lib/include/IConsoleio.h b/czicompress/lib/include/IConsoleio.h similarity index 100% rename from lib/include/IConsoleio.h rename to czicompress/lib/include/IConsoleio.h diff --git a/lib/include/IOperation.h b/czicompress/lib/include/IOperation.h similarity index 100% rename from lib/include/IOperation.h rename to czicompress/lib/include/IOperation.h diff --git a/lib/include/command.h b/czicompress/lib/include/command.h similarity index 100% rename from lib/include/command.h rename to czicompress/lib/include/command.h diff --git a/lib/include/commandlineoptions.h b/czicompress/lib/include/commandlineoptions.h similarity index 100% rename from lib/include/commandlineoptions.h rename to czicompress/lib/include/commandlineoptions.h diff --git a/lib/include/compressionstrategy.h b/czicompress/lib/include/compressionstrategy.h similarity index 100% rename from lib/include/compressionstrategy.h rename to czicompress/lib/include/compressionstrategy.h diff --git a/lib/include/progressinfo.h b/czicompress/lib/include/progressinfo.h similarity index 100% rename from lib/include/progressinfo.h rename to czicompress/lib/include/progressinfo.h diff --git a/lib/include/utils/errorhandling/winerrorformatting.h b/czicompress/lib/include/utils/errorhandling/winerrorformatting.h similarity index 100% rename from lib/include/utils/errorhandling/winerrorformatting.h rename to czicompress/lib/include/utils/errorhandling/winerrorformatting.h diff --git a/lib/include/utils/utf8/utf8converter.h b/czicompress/lib/include/utils/utf8/utf8converter.h similarity index 100% rename from lib/include/utils/utf8/utf8converter.h rename to czicompress/lib/include/utils/utf8/utf8converter.h diff --git a/lib/src/actionwithsubblockstatistics.h b/czicompress/lib/src/actionwithsubblockstatistics.h similarity index 100% rename from lib/src/actionwithsubblockstatistics.h rename to czicompress/lib/src/actionwithsubblockstatistics.h diff --git a/lib/src/commandlineoptions.cpp b/czicompress/lib/src/commandlineoptions.cpp similarity index 100% rename from lib/src/commandlineoptions.cpp rename to czicompress/lib/src/commandlineoptions.cpp diff --git a/lib/src/consoleio.cpp b/czicompress/lib/src/consoleio.cpp similarity index 100% rename from lib/src/consoleio.cpp rename to czicompress/lib/src/consoleio.cpp diff --git a/lib/src/consoleio.h b/czicompress/lib/src/consoleio.h similarity index 100% rename from lib/src/consoleio.h rename to czicompress/lib/src/consoleio.h diff --git a/lib/src/copyczi.cpp b/czicompress/lib/src/copyczi.cpp similarity index 100% rename from lib/src/copyczi.cpp rename to czicompress/lib/src/copyczi.cpp diff --git a/lib/src/copyczi.h b/czicompress/lib/src/copyczi.h similarity index 100% rename from lib/src/copyczi.h rename to czicompress/lib/src/copyczi.h diff --git a/lib/src/operation.cpp b/czicompress/lib/src/operation.cpp similarity index 100% rename from lib/src/operation.cpp rename to czicompress/lib/src/operation.cpp diff --git a/lib/src/operation.h b/czicompress/lib/src/operation.h similarity index 100% rename from lib/src/operation.h rename to czicompress/lib/src/operation.h diff --git a/lib/src/progressinfo.cpp b/czicompress/lib/src/progressinfo.cpp similarity index 100% rename from lib/src/progressinfo.cpp rename to czicompress/lib/src/progressinfo.cpp diff --git a/lib/src/utils/errorhandling/winerrorformatting.cpp b/czicompress/lib/src/utils/errorhandling/winerrorformatting.cpp similarity index 100% rename from lib/src/utils/errorhandling/winerrorformatting.cpp rename to czicompress/lib/src/utils/errorhandling/winerrorformatting.cpp diff --git a/lib/src/utils/utf8/platforms/posix/utf8converter.cpp b/czicompress/lib/src/utils/utf8/platforms/posix/utf8converter.cpp similarity index 100% rename from lib/src/utils/utf8/platforms/posix/utf8converter.cpp rename to czicompress/lib/src/utils/utf8/platforms/posix/utf8converter.cpp diff --git a/lib/src/utils/utf8/platforms/windows/utf8converter.cpp b/czicompress/lib/src/utils/utf8/platforms/windows/utf8converter.cpp similarity index 100% rename from lib/src/utils/utf8/platforms/windows/utf8converter.cpp rename to czicompress/lib/src/utils/utf8/platforms/windows/utf8converter.cpp diff --git a/tests/CMakeLists.txt b/czicompress/tests/CMakeLists.txt similarity index 100% rename from tests/CMakeLists.txt rename to czicompress/tests/CMakeLists.txt diff --git a/tests/libczi_utils.cpp b/czicompress/tests/libczi_utils.cpp similarity index 100% rename from tests/libczi_utils.cpp rename to czicompress/tests/libczi_utils.cpp diff --git a/tests/libczi_utils.h b/czicompress/tests/libczi_utils.h similarity index 100% rename from tests/libczi_utils.h rename to czicompress/tests/libczi_utils.h diff --git a/tests/test_commandlineparsing.cpp b/czicompress/tests/test_commandlineparsing.cpp similarity index 100% rename from tests/test_commandlineparsing.cpp rename to czicompress/tests/test_commandlineparsing.cpp diff --git a/tests/test_copyoperation.cpp b/czicompress/tests/test_copyoperation.cpp similarity index 100% rename from tests/test_copyoperation.cpp rename to czicompress/tests/test_copyoperation.cpp diff --git a/tests/test_utf8_utils.cpp b/czicompress/tests/test_utf8_utils.cpp similarity index 100% rename from tests/test_utf8_utils.cpp rename to czicompress/tests/test_utf8_utils.cpp From ae2d7f301077ba3cac9cb36369982c8279be0a5b Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 09:10:28 +0100 Subject: [PATCH 02/32] Add manual trigger for build --- .github/workflows/czicompress_cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 809142f..d3a43b1 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -8,6 +8,7 @@ on: pull_request: branches: ["main"] # run only when merge with main branch paths: ["czicompress/**"] + workflow_dispatch: {} permissions: contents: read From 48213e96ae1ed5a156b3f566b77c0df1ce20c2a4 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 10:05:31 +0100 Subject: [PATCH 03/32] Turn off vcpkg for ubuntu --- .github/workflows/czicompress_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index d3a43b1..300edd7 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -58,7 +58,7 @@ jobs: name: ubuntu-release-package-on, os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros platform: x64-linux, - package: ON, + package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux', From 6933e9e93497a976b5a689a4a7c29a7c20c8efcf Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 13:06:52 +0100 Subject: [PATCH 04/32] Rename codeql for czicompress --- .github/workflows/codeql.yml | 61 ------------------------------------ 1 file changed, 61 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index b7fd5ca..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -name: "CodeQL" - -on: - push: - branches: ["main"] - pull_request: - # The branches below must be a subset of the branches above - branches: ["main"] - schedule: - - cron: "22 16 * * 4" - -permissions: - actions: read - contents: read - security-events: write - -jobs: - analyze: - name: Analyze CPP - defaults: - run: - working-directory: ${{github.workspace}}/czicompress - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: ["cpp"] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - uses: ./.github/actions/cmake-build - with: - path-cache: '/usr/local/share/vcpkg/installed' - path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake' - os-id: 'linux' - build-type: Release - package: ON - platform: x64-linux - src-dir: '${{github.workspace}}/czicompress' - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" From 521c24e35dd467787b92cdae2656a04751e21584 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 13:48:23 +0100 Subject: [PATCH 05/32] Update READMEs --- README.md | 18 +++++++++++++++--- czicompress/README.md | 5 ++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8c11db1..1cead74 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,22 @@ # czicompress [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![REUSE status](https://api.reuse.software/badge/github.com/ZEISS/czicompress)](https://api.reuse.software/info/github.com/ZEISS/czicompress) -[![CMake](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml) -[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml) [![MegaLinter](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml) Reduce the size of existing CZI files by converting them to zstd-compressed CZI files. -[More ...](czicompress/README.md) \ No newline at end of file +# Command line tool and C/C++ libraries +[![CMake](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml) +[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml) + +[czicompress](czicompress/README.md) is a cross-platform command line tool to compress CZIs. czicompress and its source code are provided under the [MIT license](LICENSE). + +# CziShrink desktop app +[czishrink](czishrink/README.md) is a desktop app to compress CZIs. CziShrink is provided under the [GPLv3 license](czishrink/LICENSE.txt). + +## Guidelines +[Code of Conduct](./CODE_OF_CONDUCT.md) +[Contributing](./CONTRIBUTING.md) + +## Disclaimer +ZEISS, ZEISS.com are registered trademarks of Carl Zeiss AG. \ No newline at end of file diff --git a/czicompress/README.md b/czicompress/README.md index 48d1b06..712816c 100644 --- a/czicompress/README.md +++ b/czicompress/README.md @@ -1,8 +1,8 @@ # czicompress [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![REUSE status](https://api.reuse.software/badge/github.com/ZEISS/czicompress)](https://api.reuse.software/info/github.com/ZEISS/czicompress) -[![CMake](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml) -[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml) +[![CMake](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml) +[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml) [![MegaLinter](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml) Reduce the size of existing CZI files by converting them to zstd-compressed CZI files. @@ -271,7 +271,6 @@ After the build, run the tests by executing `./build/tests/czicompress_tests`. When compiling in Visual Studio for the first time, you may need to double compile. The Visual Studio is using "Ninja" for building and for some reason it is reporting a linker error `LINK: Fatal error LNK1168: cannot open app\czicompress.exe for writing` despite the fact that the `czicompress.exe` is created. - ## Guidelines [Code of Conduct](./CODE_OF_CONDUCT.md) [Contributing](./CONTRIBUTING.md) From 0d31a94d07a7de3887bd6e31dbf15dca3f2e243e Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 13:49:07 +0100 Subject: [PATCH 06/32] Add CziShrink to repo --- .github/dependabot.yml | 11 + .github/workflows/czicompress_codeql.yml | 61 + .github/workflows/czishrink_codeql.yml | 44 + .github/workflows/czishrink_dotnet.yml | 126 ++ .jsonlintrc.yml | 5 + .reuse/dep5 | 8 + LICENSES/GPL-3.0-or-later.txt | 232 +++ czishrink/.gitattributes | 2 + czishrink/.gitignore | 457 +++++ czishrink/.images/.gitattributes | 2 + czishrink/.images/CompressionStatistics.gif | 3 + .../.images/CompressionStatistics.gif.license | 3 + czishrink/.images/CompressionStatistics.png | 3 + .../.images/CompressionStatistics.png.license | 3 + czishrink/.images/CziShrink_DarkTheme.png | 3 + .../.images/CziShrink_DarkTheme.png.license | 3 + czishrink/.images/CziShrink_LightTheme.png | 3 + .../.images/CziShrink_LightTheme.png.license | 3 + czishrink/.images/ErrorFileOptions.png | 3 + .../.images/ErrorFileOptions.png.license | 3 + czishrink/.images/Progress.png | 3 + czishrink/.images/Progress.png.license | 3 + czishrink/.images/ProgressAnimation.gif | 3 + .../.images/ProgressAnimation.gif.license | 3 + czishrink/.images/ShareBadgeExample.png | 3 + .../.images/ShareBadgeExample.png.license | 3 + czishrink/.vscode/launch.json | 26 + czishrink/.vscode/settings.json | 3 + czishrink/.vscode/tasks.json | 70 + czishrink/CodeAnalysis.ruleset | 246 +++ czishrink/Directory.Build.props | 16 + czishrink/Directory.Build.targets | 11 + czishrink/Directory.Packages.props | 40 + czishrink/LICENSE.txt | 674 ++++++++ czishrink/NuGet.config | 6 + czishrink/README.md | 152 ++ czishrink/README.pdf | Bin 0 -> 131 bytes ...D_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt | 1524 +++++++++++++++++ czishrink/icon-source/convert-to-ico.sh | 2 + czishrink/icon-source/netczicompress.svg | 241 +++ czishrink/libczicompressc/LICENSE.txt | 21 + .../libczicompressc/THIRD_PARTY_LICENSES.txt | 128 ++ ...D_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt | 1524 +++++++++++++++++ .../libczicompressc/libczicompressc.nuspec | 16 + .../linux-x64/native/libczicompressc.so | 0 .../win-x64/native/libczicompressc.dll | 0 czishrink/netczicompress.Desktop/Program.cs | 75 + czishrink/netczicompress.Desktop/app.manifest | 25 + .../netczicompress.Desktop.csproj | 27 + czishrink/netczicompress.sln | 37 + czishrink/netczicompress/App.axaml | 28 + czishrink/netczicompress/App.axaml.cs | 34 + czishrink/netczicompress/AppComposer.cs | 99 ++ czishrink/netczicompress/Assets/Logo.png | Bin 0 -> 15845 bytes .../netczicompress/Assets/netczicompress.ico | Bin 0 -> 127985 bytes czishrink/netczicompress/FodyWeavers.xml | 3 + .../Models/AggregateStatistics.cs | 29 + ...syncEnumerableToObservableActionAdapter.cs | 70 + .../Models/Clipboard/ClipboardHelper.cs | 32 + .../Models/Clipboard/ClipboardHelperLinux.cs | 59 + .../Models/Clipboard/ClipboardHelperWin32.cs | 331 ++++ .../Models/Clipboard/IClipboardHelper.cs | 24 + .../Models/CompositeObserver.cs | 55 + .../netczicompress/Models/CompressionLevel.cs | 52 + .../netczicompress/Models/CompressionMode.cs | 17 + .../Models/CompressorMessage.cs | 42 + .../netczicompress/Models/CreateProcessor.cs | 7 + .../netczicompress/Models/CsvLogFileWriter.cs | 88 + .../Models/CsvLoggingStrategy.cs | 56 + .../netczicompress/Models/ExecutionOptions.cs | 11 + .../netczicompress/Models/FileLauncher.cs | 144 ++ .../Models/FileProcessingFailedHandler.cs | 113 ++ .../Models/FolderCompressorDecorator.cs | 35 + .../Models/FolderCompressorExtensions.cs | 37 + .../Models/FolderCompressorParameters.cs | 24 + .../netczicompress/Models/IFileLauncher.cs | 25 + .../netczicompress/Models/IFileProcessor.cs | 29 + .../Models/IFolderCompressor.cs | 24 + .../Models/IFolderCompressorRunObserver.cs | 17 + .../netczicompress/Models/ILoggingStrategy.cs | 24 + .../Models/IObservableAction.cs | 31 + .../Models/IProgramNameAndVersion.cs | 15 + .../Models/MultiThreadedFolderCompressor.cs | 267 +++ .../Models/NoOpFileProcessor.cs | 24 + .../Models/ObservableMixin.CompleteOnError.cs | 46 + .../Models/PInvokeFileProcessor.cs | 222 +++ .../Models/ProcessingOptions.cs | 12 + .../Models/ProgramNameAndVersion.cs | 35 + .../netczicompress/Models/ReportProgress.cs | 11 + .../Models/StatisticsRunObserver.cs | 48 + .../netczicompress/Models/TemporaryFile.cs | 148 ++ .../netczicompress/Models/ThreadCount.cs | 46 + .../Models/TraceLoggerFactory.cs | 118 ++ .../Models/VariousExtensions.cs | 57 + czishrink/netczicompress/Styles/Border.axaml | 25 + .../netczicompress/Styles/Button_Unused.axaml | 51 + .../netczicompress/Styles/ComboBox.axaml | 27 + .../netczicompress/Styles/DataGrid.axaml | 50 + .../netczicompress/Styles/GridSplitter.axaml | 13 + .../netczicompress/Styles/ProgressBar.axaml | 16 + czishrink/netczicompress/Styles/TextBox.axaml | 27 + .../Styles/Themes/ControlThemeButton.axaml | 105 ++ .../Themes/ControlThemeProgressBar.axaml | 197 +++ .../Styles/Themes/DarkThemeBrushes.axaml | 54 + .../Styles/Themes/LightThemeBrushes.axaml | 54 + .../netczicompress/Styles/ToggleSwitch.axaml | 13 + czishrink/netczicompress/Usings.cs | 6 + .../ViewModels/AboutViewModel.cs | 49 + .../ViewModels/AggregateIndicationStatus.cs | 13 + .../AggregateIndicationViewModel.cs | 39 + .../AggregateStatisticsViewModel.cs | 122 ++ .../ViewModels/CompressionTaskViewModel.cs | 64 + .../AggregateStatusToAnimationConverter.cs | 26 + .../AggregateStatusToForegroundConverter.cs | 31 + .../AggregateStatusToIconConverter.cs | 24 + .../AggregateStatusToTextConverter.cs | 28 + .../Converters/BytesToStringConverter.cs | 46 + .../CompressionLevelToDecimalConverter.cs | 30 + .../FloatToCompressionRatioStringConverter.cs | 36 + .../Converters/ForwardOnlyConverter.cs | 23 + .../ThreadCountToDecimalConverter.cs | 30 + .../ViewModels/CurrentTasksViewModel.cs | 54 + .../netczicompress/ViewModels/ErrorItem.cs | 20 + .../ViewModels/ErrorListViewModel.cs | 189 ++ .../ViewModels/IAboutViewModel.cs | 21 + .../ViewModels/IAdvancedOptionsViewModel.cs | 28 + .../IAggregateIndicationViewModel.cs | 15 + .../IAggregateStatisticsViewModel.cs | 41 + .../ViewModels/ICompressionTaskViewModel.cs | 19 + .../ViewModels/ICurrentTasksViewModel.cs | 16 + .../ViewModels/IErrorListViewModel.cs | 23 + .../ViewModels/IExecutionControlViewModel.cs | 17 + .../ViewModels/IFolderInputOutputViewModel.cs | 15 + .../ViewModels/ILogFileViewModel.cs | 23 + .../ViewModels/ISettingsViewModel.cs | 28 + .../ViewModels/ImmutableViewModeBase.cs | 19 + .../ViewModels/LogFileViewModel.cs | 79 + .../ViewModels/MainViewModel.cs | 242 +++ .../ViewModels/OperationMode.cs | 15 + .../ViewModels/ViewModelBase.cs | 14 + .../netczicompress/Views/AboutView.axaml | 41 + .../netczicompress/Views/AboutView.axaml.cs | 15 + .../Views/AdvancedOptionsView.axaml | 72 + .../Views/AdvancedOptionsView.axaml.cs | 12 + .../Views/AggregateIndicationView.axaml | 62 + .../Views/AggregateIndicationView.axaml.cs | 11 + .../Views/AggregateStatisticsView.axaml | 206 +++ .../Views/AggregateStatisticsView.axaml.cs | 45 + .../Views/CompressionResultBadge.axaml | 192 +++ .../Views/CompressionResultBadge.axaml.cs | 12 + .../Views/CurrentTasksView.axaml | 58 + .../Views/CurrentTasksView.axaml.cs | 15 + .../netczicompress/Views/ErrorListView.axaml | 68 + .../Views/ErrorListView.axaml.cs | 66 + .../Views/FolderInputOutputView.axaml | 46 + .../Views/FolderInputOutputView.axaml.cs | 15 + .../netczicompress/Views/FolderPicker.axaml | 27 + .../Views/FolderPicker.axaml.cs | 85 + czishrink/netczicompress/Views/MainView.axaml | 149 ++ .../netczicompress/Views/MainView.axaml.cs | 15 + .../netczicompress/Views/MainWindow.axaml | 35 + .../netczicompress/Views/MainWindow.axaml.cs | 147 ++ .../Views/NotificationEventArgs.cs | 23 + .../netczicompress/Views/SettingsView.axaml | 85 + .../Views/SettingsView.axaml.cs | 15 + .../Views/StartStopBarView.axaml | 26 + .../Views/StartStopBarView.axaml.cs | 15 + .../netczicompress/netczicompress.csproj | 32 + .../netczicompressTests/AppComposerTests.cs | 50 + .../CompressionLevelSpecimenBuilder.cs | 27 + .../CorrectValueObjectAutoDataAttribute.cs | 19 + .../ThreadCountSpecimenBuilder.cs | 27 + .../Customizations/ValidInlineAutoData.cs | 19 + ...cludePropertiesByAttributeSelectionRule.cs | 41 + .../FluentAssertionsConfig.cs | 22 + .../Models/AggregateStatisticsTests.cs | 56 + ...numerableToObservableActionAdapterTests.cs | 131 ++ .../Models/CompositeObserverTests.cs | 70 + .../Models/CompressionLevelTests.cs | 43 + .../Models/CompressorMessageTests.cs | 47 + .../Models/CsvLogFileWriterTests.cs | 103 ++ .../Models/CsvLoggingStrategyTests.cs | 152 ++ .../Models/FileLauncherTests.cs | 279 +++ .../FileProcessingFailedHandlerTests.cs | 88 + .../Models/FolderCompressorDecoratorTests.cs | 52 + .../Models/FolderCompressorExtensionsTests.cs | 98 ++ .../Mocks/FileProcessorMockExtensions.cs | 52 + .../Mocks/FolderCompressorMockExtensions.cs | 53 + .../FolderCompressorRunMockExtensions.cs | 62 + .../Models/Mocks/ObservableExtensions.cs | 29 + .../Models/Mocks/ProgressRecorder.cs | 40 + .../Models/Mocks/Recorder{T}.cs | 34 + .../Models/Mocks/SchedulerMock.cs | 42 + .../MultiThreadedFolderCompressorTests.cs | 622 +++++++ .../Models/NoOpFileProcessorTests.cs | 39 + .../Models/PInvokeFileProcessorTests.cs | 164 ++ .../Models/ProgramNameAndVersionTests.cs | 45 + .../Models/StatisticsRunObserverTests.cs | 109 ++ .../Models/TemporaryFileTests.cs | 239 +++ .../Models/ThreadCountTests.cs | 40 + .../Models/TraceLoggerFactoryTests.cs | 182 ++ czishrink/netczicompressTests/Usings.cs | 22 + .../ViewModels/AboutViewModelTests.cs | 114 ++ .../AggregateIndicationViewModelTests.cs | 106 ++ .../AggregateStatisticsViewModelTests.cs | 102 ++ .../CompressionTaskViewModelTests.cs | 81 + ...ggregateStatusToAnimationConverterTests.cs | 39 + ...gregateStatusToForegroundConverterTests.cs | 60 + .../AggregateStatusToIconConverterTests.cs | 29 + .../AggregateStatusToTextConverterTests.cs | 40 + .../Converters/BytesToStringConverterTests.cs | 57 + ...tToCompressionRatioStringConverterTests.cs | 47 + .../ViewModels/CurrentTasksViewModelTests.cs | 126 ++ .../ViewModels/ErrorItemTests.cs | 67 + .../ViewModels/ErrorListViewModelTests.cs | 445 +++++ .../ViewModels/LogFileViewModelTests.cs | 367 ++++ .../MainViewModelTests.ChildViewModels.cs | 37 + .../ViewModels/MainViewModelTests.Modes.cs | 104 ++ .../MainViewModelTests.OverallStatus.cs | 313 ++++ .../MainViewModelTests.PropertyChanged.cs | 79 + .../MainViewModelTests.StartCommand.cs | 232 +++ .../MainViewModelTests.StopCommand.cs | 96 ++ czishrink/netczicompressTests/mandelbrot.czi | Bin 0 -> 101600 bytes .../netczicompressTests.csproj | 48 + .../libczicompressc.0.5.1-alpha.0.nupkg | 3 + czishrink/stylecop.json | 12 + czishrink/upgrade-libczicompressc.ps1 | 363 ++++ 227 files changed, 18181 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/czicompress_codeql.yml create mode 100644 .github/workflows/czishrink_codeql.yml create mode 100644 .github/workflows/czishrink_dotnet.yml create mode 100644 .jsonlintrc.yml create mode 100644 LICENSES/GPL-3.0-or-later.txt create mode 100644 czishrink/.gitattributes create mode 100644 czishrink/.gitignore create mode 100644 czishrink/.images/.gitattributes create mode 100644 czishrink/.images/CompressionStatistics.gif create mode 100644 czishrink/.images/CompressionStatistics.gif.license create mode 100644 czishrink/.images/CompressionStatistics.png create mode 100644 czishrink/.images/CompressionStatistics.png.license create mode 100644 czishrink/.images/CziShrink_DarkTheme.png create mode 100644 czishrink/.images/CziShrink_DarkTheme.png.license create mode 100644 czishrink/.images/CziShrink_LightTheme.png create mode 100644 czishrink/.images/CziShrink_LightTheme.png.license create mode 100644 czishrink/.images/ErrorFileOptions.png create mode 100644 czishrink/.images/ErrorFileOptions.png.license create mode 100644 czishrink/.images/Progress.png create mode 100644 czishrink/.images/Progress.png.license create mode 100644 czishrink/.images/ProgressAnimation.gif create mode 100644 czishrink/.images/ProgressAnimation.gif.license create mode 100644 czishrink/.images/ShareBadgeExample.png create mode 100644 czishrink/.images/ShareBadgeExample.png.license create mode 100644 czishrink/.vscode/launch.json create mode 100644 czishrink/.vscode/settings.json create mode 100644 czishrink/.vscode/tasks.json create mode 100644 czishrink/CodeAnalysis.ruleset create mode 100644 czishrink/Directory.Build.props create mode 100644 czishrink/Directory.Build.targets create mode 100644 czishrink/Directory.Packages.props create mode 100644 czishrink/LICENSE.txt create mode 100644 czishrink/NuGet.config create mode 100644 czishrink/README.md create mode 100644 czishrink/README.pdf create mode 100644 czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt create mode 100644 czishrink/icon-source/convert-to-ico.sh create mode 100644 czishrink/icon-source/netczicompress.svg create mode 100644 czishrink/libczicompressc/LICENSE.txt create mode 100644 czishrink/libczicompressc/THIRD_PARTY_LICENSES.txt create mode 100644 czishrink/libczicompressc/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt create mode 100644 czishrink/libczicompressc/libczicompressc.nuspec create mode 100644 czishrink/libczicompressc/runtimes/linux-x64/native/libczicompressc.so create mode 100644 czishrink/libczicompressc/runtimes/win-x64/native/libczicompressc.dll create mode 100644 czishrink/netczicompress.Desktop/Program.cs create mode 100644 czishrink/netczicompress.Desktop/app.manifest create mode 100644 czishrink/netczicompress.Desktop/netczicompress.Desktop.csproj create mode 100644 czishrink/netczicompress.sln create mode 100644 czishrink/netczicompress/App.axaml create mode 100644 czishrink/netczicompress/App.axaml.cs create mode 100644 czishrink/netczicompress/AppComposer.cs create mode 100644 czishrink/netczicompress/Assets/Logo.png create mode 100644 czishrink/netczicompress/Assets/netczicompress.ico create mode 100644 czishrink/netczicompress/FodyWeavers.xml create mode 100644 czishrink/netczicompress/Models/AggregateStatistics.cs create mode 100644 czishrink/netczicompress/Models/AsyncEnumerableToObservableActionAdapter.cs create mode 100644 czishrink/netczicompress/Models/Clipboard/ClipboardHelper.cs create mode 100644 czishrink/netczicompress/Models/Clipboard/ClipboardHelperLinux.cs create mode 100644 czishrink/netczicompress/Models/Clipboard/ClipboardHelperWin32.cs create mode 100644 czishrink/netczicompress/Models/Clipboard/IClipboardHelper.cs create mode 100644 czishrink/netczicompress/Models/CompositeObserver.cs create mode 100644 czishrink/netczicompress/Models/CompressionLevel.cs create mode 100644 czishrink/netczicompress/Models/CompressionMode.cs create mode 100644 czishrink/netczicompress/Models/CompressorMessage.cs create mode 100644 czishrink/netczicompress/Models/CreateProcessor.cs create mode 100644 czishrink/netczicompress/Models/CsvLogFileWriter.cs create mode 100644 czishrink/netczicompress/Models/CsvLoggingStrategy.cs create mode 100644 czishrink/netczicompress/Models/ExecutionOptions.cs create mode 100644 czishrink/netczicompress/Models/FileLauncher.cs create mode 100644 czishrink/netczicompress/Models/FileProcessingFailedHandler.cs create mode 100644 czishrink/netczicompress/Models/FolderCompressorDecorator.cs create mode 100644 czishrink/netczicompress/Models/FolderCompressorExtensions.cs create mode 100644 czishrink/netczicompress/Models/FolderCompressorParameters.cs create mode 100644 czishrink/netczicompress/Models/IFileLauncher.cs create mode 100644 czishrink/netczicompress/Models/IFileProcessor.cs create mode 100644 czishrink/netczicompress/Models/IFolderCompressor.cs create mode 100644 czishrink/netczicompress/Models/IFolderCompressorRunObserver.cs create mode 100644 czishrink/netczicompress/Models/ILoggingStrategy.cs create mode 100644 czishrink/netczicompress/Models/IObservableAction.cs create mode 100644 czishrink/netczicompress/Models/IProgramNameAndVersion.cs create mode 100644 czishrink/netczicompress/Models/MultiThreadedFolderCompressor.cs create mode 100644 czishrink/netczicompress/Models/NoOpFileProcessor.cs create mode 100644 czishrink/netczicompress/Models/ObservableMixin.CompleteOnError.cs create mode 100644 czishrink/netczicompress/Models/PInvokeFileProcessor.cs create mode 100644 czishrink/netczicompress/Models/ProcessingOptions.cs create mode 100644 czishrink/netczicompress/Models/ProgramNameAndVersion.cs create mode 100644 czishrink/netczicompress/Models/ReportProgress.cs create mode 100644 czishrink/netczicompress/Models/StatisticsRunObserver.cs create mode 100644 czishrink/netczicompress/Models/TemporaryFile.cs create mode 100644 czishrink/netczicompress/Models/ThreadCount.cs create mode 100644 czishrink/netczicompress/Models/TraceLoggerFactory.cs create mode 100644 czishrink/netczicompress/Models/VariousExtensions.cs create mode 100644 czishrink/netczicompress/Styles/Border.axaml create mode 100644 czishrink/netczicompress/Styles/Button_Unused.axaml create mode 100644 czishrink/netczicompress/Styles/ComboBox.axaml create mode 100644 czishrink/netczicompress/Styles/DataGrid.axaml create mode 100644 czishrink/netczicompress/Styles/GridSplitter.axaml create mode 100644 czishrink/netczicompress/Styles/ProgressBar.axaml create mode 100644 czishrink/netczicompress/Styles/TextBox.axaml create mode 100644 czishrink/netczicompress/Styles/Themes/ControlThemeButton.axaml create mode 100644 czishrink/netczicompress/Styles/Themes/ControlThemeProgressBar.axaml create mode 100644 czishrink/netczicompress/Styles/Themes/DarkThemeBrushes.axaml create mode 100644 czishrink/netczicompress/Styles/Themes/LightThemeBrushes.axaml create mode 100644 czishrink/netczicompress/Styles/ToggleSwitch.axaml create mode 100644 czishrink/netczicompress/Usings.cs create mode 100644 czishrink/netczicompress/ViewModels/AboutViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/AggregateIndicationStatus.cs create mode 100644 czishrink/netczicompress/ViewModels/AggregateIndicationViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/AggregateStatisticsViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/CompressionTaskViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/AggregateStatusToAnimationConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/AggregateStatusToForegroundConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/AggregateStatusToIconConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/AggregateStatusToTextConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/BytesToStringConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/CompressionLevelToDecimalConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/FloatToCompressionRatioStringConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/ForwardOnlyConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/Converters/ThreadCountToDecimalConverter.cs create mode 100644 czishrink/netczicompress/ViewModels/CurrentTasksViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/ErrorItem.cs create mode 100644 czishrink/netczicompress/ViewModels/ErrorListViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/IAboutViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/IAdvancedOptionsViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/IAggregateIndicationViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/IAggregateStatisticsViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/ICompressionTaskViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/ICurrentTasksViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/IErrorListViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/IExecutionControlViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/IFolderInputOutputViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/ILogFileViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/ISettingsViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/ImmutableViewModeBase.cs create mode 100644 czishrink/netczicompress/ViewModels/LogFileViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/MainViewModel.cs create mode 100644 czishrink/netczicompress/ViewModels/OperationMode.cs create mode 100644 czishrink/netczicompress/ViewModels/ViewModelBase.cs create mode 100644 czishrink/netczicompress/Views/AboutView.axaml create mode 100644 czishrink/netczicompress/Views/AboutView.axaml.cs create mode 100644 czishrink/netczicompress/Views/AdvancedOptionsView.axaml create mode 100644 czishrink/netczicompress/Views/AdvancedOptionsView.axaml.cs create mode 100644 czishrink/netczicompress/Views/AggregateIndicationView.axaml create mode 100644 czishrink/netczicompress/Views/AggregateIndicationView.axaml.cs create mode 100644 czishrink/netczicompress/Views/AggregateStatisticsView.axaml create mode 100644 czishrink/netczicompress/Views/AggregateStatisticsView.axaml.cs create mode 100644 czishrink/netczicompress/Views/CompressionResultBadge.axaml create mode 100644 czishrink/netczicompress/Views/CompressionResultBadge.axaml.cs create mode 100644 czishrink/netczicompress/Views/CurrentTasksView.axaml create mode 100644 czishrink/netczicompress/Views/CurrentTasksView.axaml.cs create mode 100644 czishrink/netczicompress/Views/ErrorListView.axaml create mode 100644 czishrink/netczicompress/Views/ErrorListView.axaml.cs create mode 100644 czishrink/netczicompress/Views/FolderInputOutputView.axaml create mode 100644 czishrink/netczicompress/Views/FolderInputOutputView.axaml.cs create mode 100644 czishrink/netczicompress/Views/FolderPicker.axaml create mode 100644 czishrink/netczicompress/Views/FolderPicker.axaml.cs create mode 100644 czishrink/netczicompress/Views/MainView.axaml create mode 100644 czishrink/netczicompress/Views/MainView.axaml.cs create mode 100644 czishrink/netczicompress/Views/MainWindow.axaml create mode 100644 czishrink/netczicompress/Views/MainWindow.axaml.cs create mode 100644 czishrink/netczicompress/Views/NotificationEventArgs.cs create mode 100644 czishrink/netczicompress/Views/SettingsView.axaml create mode 100644 czishrink/netczicompress/Views/SettingsView.axaml.cs create mode 100644 czishrink/netczicompress/Views/StartStopBarView.axaml create mode 100644 czishrink/netczicompress/Views/StartStopBarView.axaml.cs create mode 100644 czishrink/netczicompress/netczicompress.csproj create mode 100644 czishrink/netczicompressTests/AppComposerTests.cs create mode 100644 czishrink/netczicompressTests/Customizations/CompressionLevelSpecimenBuilder.cs create mode 100644 czishrink/netczicompressTests/Customizations/CorrectValueObjectAutoDataAttribute.cs create mode 100644 czishrink/netczicompressTests/Customizations/ThreadCountSpecimenBuilder.cs create mode 100644 czishrink/netczicompressTests/Customizations/ValidInlineAutoData.cs create mode 100644 czishrink/netczicompressTests/ExcludePropertiesByAttributeSelectionRule.cs create mode 100644 czishrink/netczicompressTests/FluentAssertionsConfig.cs create mode 100644 czishrink/netczicompressTests/Models/AggregateStatisticsTests.cs create mode 100644 czishrink/netczicompressTests/Models/AsyncEnumerableToObservableActionAdapterTests.cs create mode 100644 czishrink/netczicompressTests/Models/CompositeObserverTests.cs create mode 100644 czishrink/netczicompressTests/Models/CompressionLevelTests.cs create mode 100644 czishrink/netczicompressTests/Models/CompressorMessageTests.cs create mode 100644 czishrink/netczicompressTests/Models/CsvLogFileWriterTests.cs create mode 100644 czishrink/netczicompressTests/Models/CsvLoggingStrategyTests.cs create mode 100644 czishrink/netczicompressTests/Models/FileLauncherTests.cs create mode 100644 czishrink/netczicompressTests/Models/FileProcessingFailedHandlerTests.cs create mode 100644 czishrink/netczicompressTests/Models/FolderCompressorDecoratorTests.cs create mode 100644 czishrink/netczicompressTests/Models/FolderCompressorExtensionsTests.cs create mode 100644 czishrink/netczicompressTests/Models/Mocks/FileProcessorMockExtensions.cs create mode 100644 czishrink/netczicompressTests/Models/Mocks/FolderCompressorMockExtensions.cs create mode 100644 czishrink/netczicompressTests/Models/Mocks/FolderCompressorRunMockExtensions.cs create mode 100644 czishrink/netczicompressTests/Models/Mocks/ObservableExtensions.cs create mode 100644 czishrink/netczicompressTests/Models/Mocks/ProgressRecorder.cs create mode 100644 czishrink/netczicompressTests/Models/Mocks/Recorder{T}.cs create mode 100644 czishrink/netczicompressTests/Models/Mocks/SchedulerMock.cs create mode 100644 czishrink/netczicompressTests/Models/MultiThreadedFolderCompressorTests.cs create mode 100644 czishrink/netczicompressTests/Models/NoOpFileProcessorTests.cs create mode 100644 czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs create mode 100644 czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs create mode 100644 czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs create mode 100644 czishrink/netczicompressTests/Models/TemporaryFileTests.cs create mode 100644 czishrink/netczicompressTests/Models/ThreadCountTests.cs create mode 100644 czishrink/netczicompressTests/Models/TraceLoggerFactoryTests.cs create mode 100644 czishrink/netczicompressTests/Usings.cs create mode 100644 czishrink/netczicompressTests/ViewModels/AboutViewModelTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/AggregateIndicationViewModelTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/AggregateStatisticsViewModelTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToAnimationConverterTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToForegroundConverterTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToIconConverterTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToTextConverterTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/Converters/BytesToStringConverterTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/Converters/FloatToCompressionRatioStringConverterTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs create mode 100644 czishrink/netczicompressTests/ViewModels/MainViewModelTests.ChildViewModels.cs create mode 100644 czishrink/netczicompressTests/ViewModels/MainViewModelTests.Modes.cs create mode 100644 czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs create mode 100644 czishrink/netczicompressTests/ViewModels/MainViewModelTests.PropertyChanged.cs create mode 100644 czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs create mode 100644 czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs create mode 100644 czishrink/netczicompressTests/mandelbrot.czi create mode 100644 czishrink/netczicompressTests/netczicompressTests.csproj create mode 100644 czishrink/packages_local/libczicompressc.0.5.1-alpha.0.nupkg create mode 100644 czishrink/stylecop.json create mode 100644 czishrink/upgrade-libczicompressc.ps1 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1fb8a36 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# yamllint disable rule:document-start +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "nuget" + directory: "/czishrink" + schedule: + interval: "weekly" + day: "wednesday" diff --git a/.github/workflows/czicompress_codeql.yml b/.github/workflows/czicompress_codeql.yml new file mode 100644 index 0000000..6dceeb9 --- /dev/null +++ b/.github/workflows/czicompress_codeql.yml @@ -0,0 +1,61 @@ +--- +name: "CodeQL (czicompress)" + +on: + push: + branches: ["main"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + schedule: + - cron: "22 16 * * 4" + +permissions: + actions: read + contents: read + security-events: write + +jobs: + analyze: + name: Analyze CPP + defaults: + run: + working-directory: ${{github.workspace}}/czicompress + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: ["cpp"] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + - uses: ./.github/actions/cmake-build + with: + path-cache: '/usr/local/share/vcpkg/installed' + path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake' + os-id: 'linux' + build-type: Release + package: ON + platform: x64-linux + src-dir: '${{github.workspace}}/czicompress' + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/czishrink_codeql.yml b/.github/workflows/czishrink_codeql.yml new file mode 100644 index 0000000..1004c0f --- /dev/null +++ b/.github/workflows/czishrink_codeql.yml @@ -0,0 +1,44 @@ +--- +name: "CodeQL" + +on: + # push: + # branches: [main] + # paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] + # pull_request: + # branches: [main] + # paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] + workflow_dispatch: {} + +permissions: read-all + +jobs: + analyze: + name: Analyze CziShrink + defaults: + run: + working-directory: ${{github.workspace}}/czishrink + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: ['csharp'] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + queries: security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + with: + working-directory: czishrink + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml new file mode 100644 index 0000000..bc3b88d --- /dev/null +++ b/.github/workflows/czishrink_dotnet.yml @@ -0,0 +1,126 @@ +--- +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net +permissions: + pull-requests: write + contents: read + +name: .NET + +on: + push: + branches: ["main"] + paths: ["czishrink/**"] + pull_request: + branches: ["main"] + paths: ["czishrink/**"] + workflow_dispatch: {} + +jobs: + build: + defaults: + run: + working-directory: czishrink + name: ${{matrix.config.name}} + runs-on: ${{matrix.config.os}} + + strategy: + fail-fast: false + matrix: + config: + - { + name: windows, + os: windows-latest, + osfamily: win, + } + - { + name: ubuntu, + os: ubuntu-latest, + osfamily: linux, + } + + steps: + - uses: actions/checkout@v3 + with: + lfs: true + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore -c Release + + - name: Test + run: > + dotnet test + -c Release + --no-build + --verbosity normal + --logger trx + --results-directory "TestResults" + -p:CollectCoverage=true + -p:CoverletOutputFormat=cobertura + -p:CoverletOutput=${{ github.workspace }}/TestResults/coverage.cobertura.xml + -p:ExcludeByAttribute=GeneratedCodeAttribute%2cObsoleteAttribute + -p:ExcludeByFile=**/*.axaml%2c**/*.g.cs + -p:Exclude='[netczicompress]netczicompress.Views.*' + + - name: Upload dotnet test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results-${{ matrix.config.name }} + path: TestResults + # Use always() to also publish test results when there are test failures + if: ${{ always() }} + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + if: matrix.config.name == 'ubuntu' + with: + filename: TestResults/coverage.cobertura.xml + badge: true + fail_below_min: false + format: markdown + hide_branch_rate: false + hide_complexity: false + indicators: true + output: both + thresholds: '60 80' + + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' && matrix.config.name == 'ubuntu' + with: + recreate: true + path: code-coverage-results.md + + - name: Publish + if: github.event_name == 'push' + run: > + dotnet publish netczicompress.Desktop/netczicompress.Desktop.csproj + -c Release + -a x64 + --self-contained + -p:PublishSingleFile=true + -p:PublishReadyToRun=true + -p:PublishReadyToRunShowWarnings=true + -o ${{ github.workspace }}/publish + + - name: Get Version from Directory.Build.props + id: getversion + uses: m-ringler/get-xpath@v3 + with: + xml-file: czishrink/Directory.Build.props + xpath: 'concat(//VersionPrefix/text(), "-", //VersionSuffix/text())' + + - name: Upload published binaries + uses: actions/upload-artifact@v3 + if: github.event_name == 'push' + with: + name: CziShrink_${{ steps.getversion.outputs.info }}_${{ matrix.config.osfamily}}-x64 + path: publish diff --git a/.jsonlintrc.yml b/.jsonlintrc.yml new file mode 100644 index 0000000..0ad9eb6 --- /dev/null +++ b/.jsonlintrc.yml @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +# +# SPDX-License-Identifier: MIT +--- +comments: true diff --git a/.reuse/dep5 b/.reuse/dep5 index 1b16637..9c3ee9d 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -10,3 +10,11 @@ License: MIT Files: .github/* .gitignore czicompress/.editorconfig czicompress/.gitignore czicompress/.runsettings czicompress/CPPLINT.cfg czicompress/.clang-format Copyright: 2023 Carl Zeiss Microscopy GmbH License: CC0-1.0 + +Files: czishrink/*.axaml czishrink/*.json czishrink/*.nuspec czishrink/*.txt czishrink/*.ico czishrink/*.png czishrink/*.props czishrink/*.targets czishrink/*.sh czishrink/*.svg czishrink/*.csproj czishrink/*.gitattributes czishrink/*.nupkg czishrink/*.md czishrink/*.pdf czishrink/*.config czishrink/*.ruleset czishrink/*.ps1 czishrink/*.czi czishrink/*.xml czishrink/*.sln czishrink/*.manifest README.md +Copyright: 2023 Carl Zeiss Microscopy GmbH +License: GPL-3.0-or-later + +Files: czishrink/*/mandelbrot.czi +Copyright: 2023 Carl Zeiss Microscopy GmbH +License: CC0-1.0 \ No newline at end of file diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt new file mode 100644 index 0000000..f6cdd22 --- /dev/null +++ b/LICENSES/GPL-3.0-or-later.txt @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/czishrink/.gitattributes b/czishrink/.gitattributes new file mode 100644 index 0000000..9f77107 --- /dev/null +++ b/czishrink/.gitattributes @@ -0,0 +1,2 @@ +*.nupkg filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text diff --git a/czishrink/.gitignore b/czishrink/.gitignore new file mode 100644 index 0000000..5777b2a --- /dev/null +++ b/czishrink/.gitignore @@ -0,0 +1,457 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* +coverage/ + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +# *.nupkg +!packages_local/libczicompress.*.*.*.nupkg + +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# JetBrains Rider +.idea/ +*.sln.iml + +## +## Visual Studio Code +## +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json diff --git a/czishrink/.images/.gitattributes b/czishrink/.images/.gitattributes new file mode 100644 index 0000000..5f9b1ec --- /dev/null +++ b/czishrink/.images/.gitattributes @@ -0,0 +1,2 @@ +*.gif filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/czishrink/.images/CompressionStatistics.gif b/czishrink/.images/CompressionStatistics.gif new file mode 100644 index 0000000..39f9b7f --- /dev/null +++ b/czishrink/.images/CompressionStatistics.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:726be9bd09cacdfd49e01b58f6d80156a5efc67a30627c39c23efb2de7a0d1f5 +size 133010 diff --git a/czishrink/.images/CompressionStatistics.gif.license b/czishrink/.images/CompressionStatistics.gif.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/CompressionStatistics.gif.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.images/CompressionStatistics.png b/czishrink/.images/CompressionStatistics.png new file mode 100644 index 0000000..922dbd7 --- /dev/null +++ b/czishrink/.images/CompressionStatistics.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b40420e046216d79b71590b7f483710bbd145dd9faab31f27f8aed727afcf27 +size 37074 diff --git a/czishrink/.images/CompressionStatistics.png.license b/czishrink/.images/CompressionStatistics.png.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/CompressionStatistics.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.images/CziShrink_DarkTheme.png b/czishrink/.images/CziShrink_DarkTheme.png new file mode 100644 index 0000000..c13d78a --- /dev/null +++ b/czishrink/.images/CziShrink_DarkTheme.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30e8a384b90d46641b5fc90f71811ddf1253be598a25b95a2fc9da36f827c183 +size 58582 diff --git a/czishrink/.images/CziShrink_DarkTheme.png.license b/czishrink/.images/CziShrink_DarkTheme.png.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/CziShrink_DarkTheme.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.images/CziShrink_LightTheme.png b/czishrink/.images/CziShrink_LightTheme.png new file mode 100644 index 0000000..c928c86 --- /dev/null +++ b/czishrink/.images/CziShrink_LightTheme.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c29c18cb7ca1fa56cf428552f53700a87c3e8a40e1b503a535d9e6d9a445a26 +size 58426 diff --git a/czishrink/.images/CziShrink_LightTheme.png.license b/czishrink/.images/CziShrink_LightTheme.png.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/CziShrink_LightTheme.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.images/ErrorFileOptions.png b/czishrink/.images/ErrorFileOptions.png new file mode 100644 index 0000000..aa9fd64 --- /dev/null +++ b/czishrink/.images/ErrorFileOptions.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:722d6b25afc98772bc955585e812447d7d8e38fe69b0b15751417e920f0201c3 +size 29773 diff --git a/czishrink/.images/ErrorFileOptions.png.license b/czishrink/.images/ErrorFileOptions.png.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/ErrorFileOptions.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.images/Progress.png b/czishrink/.images/Progress.png new file mode 100644 index 0000000..9a0cdf2 --- /dev/null +++ b/czishrink/.images/Progress.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6c38065cdaabfbc3583032eb687c3d595087d90ec60a99315614d194188d001 +size 41259 diff --git a/czishrink/.images/Progress.png.license b/czishrink/.images/Progress.png.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/Progress.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.images/ProgressAnimation.gif b/czishrink/.images/ProgressAnimation.gif new file mode 100644 index 0000000..58f839d --- /dev/null +++ b/czishrink/.images/ProgressAnimation.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e025a74d53bf41cdff7a48aa17516e811a43b92aa4c48fcc8c6c62f804b1865 +size 1208046 diff --git a/czishrink/.images/ProgressAnimation.gif.license b/czishrink/.images/ProgressAnimation.gif.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/ProgressAnimation.gif.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.images/ShareBadgeExample.png b/czishrink/.images/ShareBadgeExample.png new file mode 100644 index 0000000..479e66a --- /dev/null +++ b/czishrink/.images/ShareBadgeExample.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0ffafc2a5a56e8e30c349828f7e3a7d213776444e4febdfa9bc4698b35110f8 +size 5055 diff --git a/czishrink/.images/ShareBadgeExample.png.license b/czishrink/.images/ShareBadgeExample.png.license new file mode 100644 index 0000000..cfacb07 --- /dev/null +++ b/czishrink/.images/ShareBadgeExample.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH + +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/czishrink/.vscode/launch.json b/czishrink/.vscode/launch.json new file mode 100644 index 0000000..42947bb --- /dev/null +++ b/czishrink/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/netczicompress.Desktop/bin/x64/Debug/net7.0/CziShrink", + "args": [], + "cwd": "${workspaceFolder}/netczicompress.Desktop", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/czishrink/.vscode/settings.json b/czishrink/.vscode/settings.json new file mode 100644 index 0000000..d09b546 --- /dev/null +++ b/czishrink/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dotnet.defaultSolution": "netczicompress.sln" +} \ No newline at end of file diff --git a/czishrink/.vscode/tasks.json b/czishrink/.vscode/tasks.json new file mode 100644 index 0000000..2b17345 --- /dev/null +++ b/czishrink/.vscode/tasks.json @@ -0,0 +1,70 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/netczicompress.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/netczicompress.Desktop/netczicompress.Desktop.csproj", + "-c", "Release", + "--use-current-runtime", "true", + "--self-contained", + "-p:PublishSingleFile=true", + "-p:PublishReadyToRun=true", + "-p:PublishReadyToRunShowWarnings=true" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Watch (Tests)", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "test", + "--project", + "netczicompressTests" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Test with Coverage", + "command": "dotnet", + "type": "process", + "args": [ + "test", + "/p:CollectCoverage=true", + "/p:CoverletOutputFormat=lcov%2ccobertura", + "/p:CoverletOutput=${workspaceFolder}/coverage/", + "/p:ExcludeByAttribute=GeneratedCodeAttribute%2cObsoleteAttribute", + "/p:ExcludeByFile=**/*.axaml%2c**/*.g.cs", + "/p:Exclude=[netczicompress]netczicompress.Views.*" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Generate coverage report", + "command": "reportgenerator", + "type": "shell", + "args": [ + "-reports:${workspaceFolder}/coverage/coverage.info", + "-targetdir:${workspaceFolder}/coverage/covstats" + ], + "problemMatcher": [] + } + ] +} diff --git a/czishrink/CodeAnalysis.ruleset b/czishrink/CodeAnalysis.ruleset new file mode 100644 index 0000000..f0d70a0 --- /dev/null +++ b/czishrink/CodeAnalysis.ruleset @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/Directory.Build.props b/czishrink/Directory.Build.props new file mode 100644 index 0000000..4066629 --- /dev/null +++ b/czishrink/Directory.Build.props @@ -0,0 +1,16 @@ + + + net7.0 + latest + enable + True + enable + true + $(MSBuildThisFileDirectory)CodeAnalysis.ruleset + True + true + + 1.0.0 + alpha.45 + + diff --git a/czishrink/Directory.Build.targets b/czishrink/Directory.Build.targets new file mode 100644 index 0000000..7976089 --- /dev/null +++ b/czishrink/Directory.Build.targets @@ -0,0 +1,11 @@ + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/czishrink/Directory.Packages.props b/czishrink/Directory.Packages.props new file mode 100644 index 0000000..626af95 --- /dev/null +++ b/czishrink/Directory.Packages.props @@ -0,0 +1,40 @@ + + + 4.18.0 + 11.0.5 + 19.5.1 + 19.2.69 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/czishrink/LICENSE.txt b/czishrink/LICENSE.txt new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/czishrink/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/czishrink/NuGet.config b/czishrink/NuGet.config new file mode 100644 index 0000000..1475046 --- /dev/null +++ b/czishrink/NuGet.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/czishrink/README.md b/czishrink/README.md new file mode 100644 index 0000000..7ceeaea --- /dev/null +++ b/czishrink/README.md @@ -0,0 +1,152 @@ +# CziShrink +An open source and cross-platform GUI for [CziCompress](https://github.com/zeissmicroscopy/czicompress), made with Avalonia UI and .NET. + +## Table of contents + + - [Overview](#overview) + - [Download](#download) + - [System Requirements](#system-requirements) + - [Theme Support](#theme-support) + - [I/O](#io) + - [Parameters](#parameters) + - [Operations](#operations) + - [Progress Update](#progress-update) + - [Compression Statistics](#compression-statistics) + - [Sharing](#sharing) + - [Errors](#errors) + - [Logs](#logs) + - [FAQ](#faq) + - [Known Issues](#known-issues) + - [Potential Future Enhancements](#potential-future-enhancements) + - [Feedback](#feedback) + +## Overview + +## System Requirements + +### Windows + - Windows 10 or later +### Linux + - Supported OS: + - Debian 9 (Stretch) and higher + - Ubuntu 16.04 and higher + - X11 + - Clipboad functionality requires xclip to be installed + +## Theme Support +Dark and a light themes are set automatically based on your OS settings. +There is currently no way to manually set this. + +![Light Theme](.images/CziShrink_LightTheme.png)![Dark Theme](.images/CziShrink_DarkTheme.png) + +## I/O + +Input and output folders are selected, and the tool will operate on all CZI-documents within the input folder. +The intent of the tool is to be a bulk-compression utility. + +## Parameters + +### Operations + +| Operation | Description | +|-----------|-------------| +| Compress uncompressed data |Compresses only uncompresed subblocks and copies others.| +| Compress uncompressed and Zstd-compressed data|Compresses subblocks that were orginally uncompressed or compressed with zstd. | +| Compress all data |Compresses all subblocks regardless of current compression method (if possible). | +| Decompress all data |Decompresses all possible subblocks. | +| Dry Run |Finds all CZI files in the input folder but does not create any output CZI files. Like the other operations, it creates a CSV report in the output folder.| + +## Progress Update +CZI Shrink scans the input folder for CZI files. +And whenever it finds one, the file is immediately queued for processing. +CZI Shrink will usually process several files in parallel, depending on the state of the queue and the number of CPUs in your computer. +Progress is displayed for all files that are currently being processed. + +![Progress Updates](.images/Progress.png) + +## Compression Statistics + +Compression statistics are updated during the operation. +They provide some insight about what is going on. + +![Compression Statistics](.images/CompressionStatistics.png) + +### Sharing + +Upon completing an operation a new button should appear which will copy a bitmap to your clipboard containing a badge showing off how much the application was able to compress your files. + +![Compression Statistics Badge](.images/ShareBadgeExample.png) + +## Errors + +Files that are unable to be (un)compressed will appear in the bottom dialog with their error message. These entries can also be found in the [log file](#logs). +The error list also allows navigating directly to the files in question. + +![Error List](.images/ErrorFileOptions.png) + + +## Logs + +Logs are saved in the output directory. +The filename of this log is constructed as `CziShrink__`. +The timestamp itself is in the form of `T` while the `COMPRESSION_OPTION` will correspond +to the operation selected in the UI. + +Logs are produced during operation, however flushing of buffer to file does not occur as fast +as possible, so you may notice/experience a latency between the tasks that appear on the UI and +the actual entries written. +In some cases you may see no log output until the operation has completed if a reasonably constrained input directory is chosen. + +### Format +| InputFile | SizeInput | SizeOutput | SizeRatio | SizeDelta | TimeToProcess | Status | ErrorMessage| +| ----------|-----------|------------|-----------|-----------|---------------|--------|-------------| +| Sample_file.czi | 696480 | 564992 |0.811210659| 131488 | 00:00:00.0672709 |SUCCESS|| +| Sample_file2.czi| 1107888032 | 0 | 0 | -1 | |ERROR | Illegal data detected at offset 235352768 -> Invalid SubBlock-magic | +## FAQ +- Is the compression lossy? + - The tool uses [Zstandard](https://github.com/facebook/zstd) which is a fast and lossless compression algorithm. +- What happens to files that the tool is not able to compress? Are they still copied to the output folder? + - The file is not copied to the output folder and a log entry detailing the error is produced. + + +## Known Issues + +- Folder enumeration fails on network drives if connection drops. +- Non-X-Y-subblock CZIs will produce an error when attempting to compress. +- Multi-file CZI can't be converted. + - Ensure file is not currently opened in ZEN. +- Error encountered while compression file rarely causes creation of a corrupted output czi file. + +## Potential Future Enhancements + +This is a list of possible future enhancements based on feedback. +Any item on this list may be added or removed at any point in time based on prioritization. +There is no guarantee that any items on this list will be added, rather it is just to show what topics are on the radar. +- Localization +- Cache/Remember previously used options (folders, compression, etc) per-user + +## Contributing + +### Notes for Contributors +* Test changes at least on Linux and Windows. +* Note that the app will change appearance when the system theme is changed (Windows: Settings -> Personalization -> Colors -> Choose your colors: Light/Dark/Custom). Make sure that GUI changes look good both in the Light and in the Dark Theme. See https://docs.avaloniaui.net/docs/next/guides/styles-and-resources/how-to-use-theme-variants + +## How to upgrade libczicompressc automatically +1. Create a 'classic' personal access token at https://github.com/settings/tokens, authorize it for the ZEISS organization via the "Configure SSO" button, and store it in a GITHUB_TOKEN environment variable. +2. Open a Powershell terminal and run [./upgrade-libczicompressc.ps1](./upgrade-libczicompressc.ps1). Run `get-help ./upgrade-libczicompressc.ps1` for more info. + +## How to upgrade libczicompressc manually +1. Build libczicompressc.so on linux-x64 and libczicompressc.dll on win-x64 in release mode, or (preferred) get them from the [github CI build](https://github.com/zeissmicroscopy/czicompress/actions/workflows/cmake.yml). +1. Put the binaries into [libczicompressc/runtimes/linux-x64/native](libczicompressc/runtimes/linux-x64/native) and [libczicompressc/runtimes/win-x64/native](libczicompressc/runtimes/win-x64/native) +1. Update the nuspec file [libczicompressc/libczicompressc.nuspec](libczicompressc/libczicompressc.nuspec): + * `package/metadata/version` must be the 'ProductVersion' of libczicompressc.dll (explorer: Properties/Details) + * `package/metadata/repository[@commit]` must be the git commit from which the binaries were built +1. [Install nuget if necessary](https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools#cli-tools). +1. Open a shell in [libczicompressc](libczicompressc), and run `path/to/nuget pack libczicompressc.nuspec` +1. Move the resulting nupkg into [packages_local](packages_local) and delete the old package from there. +1. Change the version of libczicompressc in [Directory.Packages.props](Directory.Packages.props) +1. If major or minor version has changed, change the expected version number in [PInvokeFileProcessor](https://github.com/m-ringler/netczicompress/blob/a254a4a919120ad61aad707f39749709f0a36e1a/netczicompress/Models/PInvokeFileProcessor.cs#L124). +1. Rebuild netczicompress.sln +1. Run netczicompressTests +1. Undo git changes to the libczicompressc.dll and libczicompressc.so files (no need to commit them, they are in the nupkg). +1. Commit the remaining changes with message "Upgrade libczicompressc to new version: x.y.z" diff --git a/czishrink/README.pdf b/czishrink/README.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ee9c7f5cd6892feb45bb6e573853e9977c180ac4 GIT binary patch literal 131 zcmWN?NfN>!5CFhCuiyiQW!RG6%&-VmDk%qZ@b%i4zUrIDe96An$%j(+v2KsX+yDNd zEzhUovu1S}F-MWy(fV*u*fZD)1!F}j2-;J#1ll;031LqKlkqLJN})I)0>2wdCC7-G NwBYfr(t0r7i62BAD4GBO literal 0 HcmV?d00001 diff --git a/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt b/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt new file mode 100644 index 0000000..6686074 --- /dev/null +++ b/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt @@ -0,0 +1,1524 @@ +============= Free and Open Source Software Disclosure Statement ============== + +For czicompress + +This product includes copyrighted software from third parties that may be +distributed under different licenses than this product as given below. + +In case we missed to list a specific software and/or underlying license, +we appreciate your upfront notice. + +This product may include copyrighted software that is distributed under a +license that requires us to provide the source code of that software and +instructions on how to build and install it, such as the GNU GPL or GNU +LGPL or other reciprocal licenses. Unless otherwise stated the original +source code of such software has not been modified. As recipient and user of +this product you may obtain the complete source code for such copyrighted +software as well as build and install instructions from us for a period of +three years starting with the reception of the product and valid for as +long as we offer spare parts or customer support for that product model +and at no charge. + +In any of such cases, please send an email to opensource@zeiss.com +referencing your product's name, version, and manufacturing ZEISS entity. + + +List of third-party software: +----------------------------------- + +=============================================================================== + +------------------------------------------------------------------------------- +| Catch2 3.4.0 (used under Boost Software License 1.0) https://discord.gg/4CWS9zD +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Boost Software License - Version 1.0 +==================================== + + +August 17th, 2003 +----------------- + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by this +license (the "Software") to use, reproduce, display, distribute, execute, and +transmit the Software, and to prepare derivative works of the Software, and to +permit third-parties to whom the Software is furnished to do so, all subject to +the following: +The copyright notices in the Software and this entire statement, including the +above license grant, this restriction and the following disclaimer, must be +included in all copies of the Software, in whole or in part, and all derivative +works of the Software, unless such copies or derivative works are solely in the +form of machine-executable object code generated by a source language processor. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES +OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| CLIUtils/CLI11 v2.3.2 (used under BSD 3-clause "New" or "Revised" License) https://cliutils.gitlab.io/CLI11Tutorial +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner under NSF AWARD 1414736. All Rights Reserved. +Copyright (c) 2012 - 2017, Lars Bilke. All Rights Reserved. +Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| D3.js 3.5.17 (used under BSD 3-clause "New" or "Revised" License) http://d3js.org/ +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2010 Stanford Visualization Group. All Rights Reserved. +Copyright (c) 2011 Jason Davies. All Rights Reserved. +Copyright 2001 Robert Penner. All Rights Reserved. +Copyright (c) 2008-2012 Charles Karney. +Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State. +Copyright (c) 2010 SimpleGeo and Stamen Design. All Rights Reserved. +Copyright (c) 2010-2016 Michael Bostock. All Rights Reserved. +Copyright (C) 2010-2013 Raymond Hill. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) 2010, Stanford Visualization Group +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Stanford University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + +------------------------------------------------------------------------------- +| gmdh 1.0 (used under MIT License) https://github.com/bauman-team/GMDH +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright 2001-2009 Kitware, Inc. +Copyright (C) 2018 David Hyde. +Copyright (C) 2009 Benjamin Schindler. +Copyright 2012 Continuum Analytics, Inc. All Rights Reserved. +Copyright (C) 2002-2007 Yves Renard This file is a part of GETFEM++. +Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). +Copyright (C) 2011 Timothy E. Holy. +Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. +Copyright (C) 2020 Jens Wehner. +Copyright 2017 The TensorFlow Authors. All Rights Reserved. +Copyright 2013-2016 Florent Pruvost. +Copyright (C) EDF R. +Copyright (C) 2012 Desire Nuentsa Wakam. +Copyright (C) 2009-2013 Jitse Niesen. +Copyright (C) 2009 Ilya Baran. +(C) William Swanson, Paul Fultz define PYBIND11_EVAL0(...) __VA_ARGS__ define PYBIND11_EVAL1(...) PYBIND11_EVAL0(PYBIND11_EVAL0(PYBIND11_EVAL0(__VA_ARGS__))) define PYBIND11_EVAL2( +Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. +Copyright (C) 2013 Pavel Holoborodko. +Copyright (c) 2016-2017, 2020 Wenzel Jakob. All Rights Reserved. +Copyright : EDF 2001 $Header$. +Copyright (C) 2014 yoco. +Copyright (C) 2013 Jean Ceccato. +Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. +Copyright (C) 2011-2013 Chen-Pang He. +Copyright (C) 2006-2011, 2015 Benoit Jacob. +copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. +Copyright (c) 2019 Dawid Pilarski. +Copyright (C) 2013 Pierre Zoppitelli. +Copyright (C) 2020 Everton Constantino. +Copyright (C) 2019 David Tellenbach. +(C) Desire NUENTSA WAKAM, INRIA include include include include include include include +Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. +Copyright (c) 2016 Sergey Lyskov and Wenzel Jakob. +(C) Desire NUENTSA WAKAM, INRIA include include include include include include ifd +Copyright (c) Fabian Giesen, 2016. All Rights Reserved. +Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. +Copyright (C) 2012 Alexey Korepanov. +Copyright (C) 1998-2010, 2015-2016. +Copyright (c) 2020 Wenzel Jakob and Henry Schreiner. +Copyright (C) 2015-2016 Eugene Brevdo. +Copyright (C) 2011 Andreas Platen. +Copyright (C) 2017 Viktor Csomor. +Copyright (C) 2020 Antonio Sanchez. +Copyright (c) 2017 Henry F. Schreiner. +Copyright (C) 2017 Kyle Macfarlan. +Copyright (C) 2012-2013 D. +Copyright (C) 2009 Thomas Capricelli This code initially comes from MINPACK whose original authors are:. +Copyright (C) 2008 Daniel Gomez Ferro. +Copyright (C) 2013 Nicolas Carre. +Copyright (C) 2012 David Harmon. +Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. +Copyright (c) 2021 Laramie Leavitt (Google LLC). +Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). +Copyright (c) 2019 Roland Dreier. +copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. +Copyright (C) 2016 Dmitry Vyukov. +Copyright (c) 2007 Allen Winter. +Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. +Copyright (c) 2006-2007 Montel Laurent. +Copyright (C) 2009 Mark Borgerding mark a borgerding net. +Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). +Copyright (C) 2009 Ricard Marxer. +Copyright (c) 2016 Sergey Lyskov. +Copyright 2003-2009 Mark Borgerding template struct kiss_cpx_fft. +Copyright 2012-2013 Mathieu Faverge. +Copyright (C) 2016 Igor Babuschkin. +Copyright (C) 2009 Kenneth Riddile. +Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. +Copyright (C) 2005 the Regents of the University of Minnesota. +Copyright (c) 2007 Alexander Neundorf. +Copyright 2018-2019, 2022 Google LLC. All Rights Reserved. +Copyright (C) 2019 Joel Holdsworth. +Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. +Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. Permition is granted to use, copy, distribute and prepare derivative works of this library for any purpose and without fee, provided, that the above. +Copyright (C) 2020 Jan van Dijk. +Copyright (C) 2009 Rohit Garg. +Copyright (c) 2017 Borja Zarco (Google LLC). +Copyright (C) 2009-2010 Thomas Capricelli. +Copyright (C) 2020 Arm Limited and Contributors. +Copyright (C) 2015 Vijay Vasudevan. +Copyright (C) 2009 Claire Maurice. +Copyright (C) 2017 Codeplay Software Limited. +Copyright (C) 2014-2015 Jianwei Cui. +Copyright (C) 2009-2013 Hauke Heibel. +Copyright (C) 2010 Vincent Lejeune. +Copyright (C) 2008-2009 Guillaume Saupin. +Copyright (C) 2020 Sebastien Boisvert. +Copyright (C) 2009 Mathieu Gautier. +Copyright (C) 2013 Christoph Hertzberg. +Copyright (C) 2008 Gael Guennebaud NOTE The functions of this file have been adapted from the GMM++ library. +Copyright (C) 2012-2013 Desire Nuentsa. +Copyright (C) 2017 Gagan Goel. +Copyright (C) 2014-2017 Benoit Steiner. +Copyright (C) 2020-2021 C. Antonio Sanchez. +Copyright (c) 2018 Hudson River Trading LLC. +Copyright (C) 2014-2015 Navdeep Jaitly. +Copyright (C) 2009 Thomas Capricelli include. +Copyright (c) 2016-2017 Jason Rhinelander. +Copyright (c) 2016 Pim Schellart. +Copyright (C) 2012 The Android Open Source Project. +Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. +Copyright (c) 2016 Ivan Smirnov. +Copyright (C) 2007 Michael Olbrich. +Copyright (c) 2020 The Eigen Authors. +Copyright (c) 2009 Boudewijn Rempt. +Copyright (C) 2012 desire Nuentsa. +(C) Copyright .. +Copyright 2012 Cedric Castagnede. +Copyright (C) 2012 Desire Nuentsa This code initially comes from MINPACK whose original authors are:. +Copyright (C) 2008-2019 Gael Guennebaud. +Copyright (C) 2012 Giacomo Po. +Copyright (c) 2016 Ben North. +copyright: (c) 2013 by Ihor Kalnytskyi +Copyright (C) 2018 Andy Davis. +Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = Moshier Permission has been kindly provided by the original author to incorporate the Cephes software into the Eigen codebase: Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140. +Copyright 2012-2016 Inria. All Rights Reserved. +Copyright (C) 2008-2009 Gael Guennebaud NOTE The class IterationController has been adapted from the iteration. +Copyright (C) 2013 Christian Seiler. +Copyright (C) 2009, 2012 Keir Mierle. +Copyright (c) 2016 Klemens D. Morgenstern. +Copyright (c) 2010 Intel Corp. All Rights Reserved. +Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditio. +Copyright (C) 2008-2016 Konstantinos Margaritis. +Copyright (c) 2006 Timothy A. Davis. +Copyright (c) 2011-2014 Willow Garage, Inc. +Copyright (C) 2016 Tobias Wood. +Copyright (C) 2011-2012, 2014 Kolja Brix. +Copyright (C) 2010 Manuel Yguel. +Copyright (C) 2015 Tal Hadad. +Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee This file is part of the Iterative Template Library. +Copyright (C) 2015 Ke Yang. +Copyright 2005-2010, 2013, 2015, 2018-2021 Google Inc. All Rights Reserved. +Copyright (C) 2018 Eugene Zhulenev. +Copyright (C) 2007 Julien Pommier. +Copyright (C) 2018 Wave Computing, Inc. Written by:. +Copyright 2016-2018 Codeplay Software Ltd. +Copyright (C) 2012 Desire Nuentsa The algorithm of this. +Copyright (c) 2016 Klemens Morgenstern and. +Copyright (C) 2012 Desire NUENTSA WAKAM. +Copyright (c) 2012 Erik Edlund Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a. +Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). +Copyright (C) 2018 Deven Desai. +Copyright (C) 2020 Chris Schoutrop. +Copyright (C) 2010 Daniel Lowengrub. +Copyright 2012-2013 Emmanuel Agullo. +Copyright (C) 2014 Eric Martin. +Copyright (c) 2016 Trent Houliston and. +Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). +Copyright (c) 2019 Pranav. +Copyright (C) 2013 Gauthier Brun. +Copyright (c) 2021 The Pybind Development Team. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License +=============== + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| libeigen/eigen 3.4.0 (used under (GNU Lesser General Public License v2.1 or later AND BSD 3-clause "New" or "Revised" License AND Mozilla Public License 2.0)) https://gitlab.com/libeigen/eigen.git +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (C) 2018 David Hyde. +Copyright (C) 2009 Benjamin Schindler. +Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). +Copyright (C) 2011 Timothy E. Holy. +Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. +Copyright (C) 2020 Jens Wehner. +Copyright 2017 The TensorFlow Authors. All Rights Reserved. +Copyright 2013-2016 Florent Pruvost. +Copyright (C) EDF R. +Copyright (C) 2012 Desire Nuentsa Wakam. +Copyright (C) 2009-2013 Jitse Niesen. +Copyright (C) 2009 Ilya Baran. +Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. +Copyright (C) 2013 Pavel Holoborodko. +Copyright : EDF 2001 $Header$. +Copyright (C) 2014 yoco. +Copyright (C) 2013 Jean Ceccato. +Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. +Copyright (C) 2011-2013 Chen-Pang He. +Copyright (C) 2006-2011, 2015 Benoit Jacob. +copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. +Copyright (C) 2013 Pierre Zoppitelli. +Copyright (C) 2020 Everton Constantino. +Copyright (C) 2019 David Tellenbach. +Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. +Copyright (c) Fabian Giesen, 2016. All Rights Reserved. +Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. +Copyright (C) 2012 Alexey Korepanov. +Copyright (C) 1998-2010, 2015-2016. +Copyright (C) 2015-2016 Eugene Brevdo. +Copyright (C) 2011 Andreas Platen. +Copyright (C) 2017 Viktor Csomor. +Copyright (C) 2020 Antonio Sanchez. +Copyright 2003-2009 Mark Borgerding. +Copyright (C) 2017 Kyle Macfarlan. +Copyright (C) 2012-2013 D. +Copyright (C) 2008 Daniel Gomez Ferro. +Copyright (C) 2013 Nicolas Carre. +Copyright (C) 2012 David Harmon. +Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. +Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). +Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions. +copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. +Copyright (C) 2016 Dmitry Vyukov. +Copyright (c) 2007 Allen Winter. +Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. +Copyright (c) 2006-2007 Montel Laurent. +Copyright (C) 2009 Mark Borgerding mark a borgerding net. +Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). +Copyright (C) 2009 Ricard Marxer. +Copyright 2012-2013 Mathieu Faverge. +Copyright (C) 2016 Igor Babuschkin. +Copyright (C) 2009 Kenneth Riddile. +Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. +Copyright (C) 2005 the Regents of the University of Minnesota. +Copyright (c) 2007 Alexander Neundorf. +Copyright (C) 2019 Joel Holdsworth. +Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. +Copyright (C) 2002-2007 Yves Renard. +Copyright (C) 2020 Jan van Dijk. +Copyright (C) 2008-2019, 20013, 20015 Gael Guennebaud. +Copyright (C) 2009 Rohit Garg. +Copyright (C) 2009-2010 Thomas Capricelli. +Copyright (C) 2020 Arm Limited and Contributors. +Copyright (C) 2015 Vijay Vasudevan. +Copyright (C) 2009 Claire Maurice. +Copyright (C) 2017 Codeplay Software Limited. +Copyright (C) 2014-2015 Jianwei Cui. +Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = NumTr Moshier. +Copyright (C) 2009-2013 Hauke Heibel. +Copyright (C) 2010 Vincent Lejeune. +Copyright (C) 2008-2009 Guillaume Saupin. +Copyright (C) 2020 Sebastien Boisvert. +Copyright (C) 2009 Mathieu Gautier. +Copyright (C) 2013 Christoph Hertzberg. +Copyright (C) 2012-2013 Desire Nuentsa. +Copyright (C) 2017 Gagan Goel. +Copyright (C) 2014-2017 Benoit Steiner. +Copyright (C) 2020-2021 C. Antonio Sanchez. +Copyright (C) 2014-2015 Navdeep Jaitly. +Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee. +Copyright (C) 2012 The Android Open Source Project. +Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. +Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. +Copyright (C) 2007 Michael Olbrich. +Copyright (c) 2020 The Eigen Authors. +Copyright (c) 2009 Boudewijn Rempt. +Copyright (C) 2012 desire Nuentsa. +Copyright 2012 Cedric Castagnede. +Copyright (C) 2012 Giacomo Po. +Copyright (C) 2018 Andy Davis. +Copyright 2012-2016 Inria. All Rights Reserved. +Copyright (C) 2013 Christian Seiler. +Copyright (C) 2009, 2012 Keir Mierle. +Copyright 2007-2009 Kitware, Inc. +Copyright (C) 2008-2016 Konstantinos Margaritis. +Copyright (c) 2006 Timothy A. Davis. +Copyright (c) 2011-2014 Willow Garage, Inc. +Copyright (C) 2016 Tobias Wood. +Copyright (C) 2011-2012, 2014 Kolja Brix. +Copyright (C) 2010 Manuel Yguel. +Copyright (C) 2015 Tal Hadad. +Copyright (C) 2015 Ke Yang. +Copyright (C) 2018 Eugene Zhulenev. +Copyright (C) 2007 Julien Pommier. +Copyright (C) 2018 Wave Computing, Inc. Written by:. +Copyright 2016-2018 Codeplay Software Ltd. +Copyright (C) 2012 Desire NUENTSA WAKAM. +Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). +Copyright (C) 2018 Deven Desai. +Copyright (C) 2020 Chris Schoutrop. +(C) Desire NUENTSA WAKAM, INRIA +Copyright (C) 2010 Daniel Lowengrub. +Copyright 2012-2013 Emmanuel Agullo. +Copyright (C) 2014 Eric Martin. +Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). +Copyright (C) 2013 Gauthier Brun. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +GNU Lesser General Public License +================================= + +Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + + of this license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also counts + + as the successor of the GNU Library Public License, version 2, hence + + the version number 2.1.] + + +Preamble +-------- + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public Licenses are intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, but we +suggest you first think carefully about whether this license or the ordinary +General Public License is the better strategy to use in any particular case, +based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. +Our General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for this service if you wish); +that you receive source code or can get it if you want it; that you can change +the software and use pieces of it in new free programs; and that you are informed +that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to +deny you these rights or to ask you to surrender these rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a +fee, you must give the recipients all the rights that we gave you. You must make +sure that they, too, receive or can get the source code. If you link other code +with the library, you must provide complete object files to the recipients, so +that they can relink them with the library after making changes to the library +and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and +(2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone else +and passed on, the recipients should know that what they have is not the original +version, so that the original author's reputation will not be affected by +problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent holder. +Therefore, we insist that any patent license obtained for a version of the +library must be consistent with the full freedom of use specified in this +license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the ordinary +General Public License. We use this license for certain libraries in order to +permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License therefore +permits such linking only if the entire combination fits its criteria of freedom. +The Lesser General Public License permits more lax criteria for linking other +code with the library. + +We call this license the "Lesser" General Public License because it does Less to +protect the user's freedom than the ordinary General Public License. It also +provides other free software developers Less of an advantage over competing +non-free programs. These disadvantages are the reason we use the ordinary General +Public License for many libraries. However, the Lesser license provides +advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto standard. +To achieve this, non-free programs must be allowed to use the library. A more +frequent case is that a free library does the same job as widely used non-free +libraries. In this case, there is little to gain by limiting the free library to +free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables many +more people to use the whole GNU operating system, as well as its variant, the +GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a modified +version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code derived +from the library, whereas the latter must be combined with the library in order +to run. + + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +--------------------------------------------------------------- + +0. This License Agreement applies to any software library or other program which +contains a notice placed by the copyright holder or other authorized party saying +it may be distributed under the terms of this Lesser General Public License (also +called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as +to be conveniently linked with application programs (which use some of those +functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been +distributed under these terms. A "work based on the Library" means either the +Library or any derivative work under copyright law: that is to say, a work +containing the Library or a portion of it, either verbatim or with modifications +and/or translated straightforwardly into another language. (Hereinafter, +translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the source +code for all modules it contains, plus any associated interface definition files, +plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running a program using the +Library is not restricted, and output from such a program is covered only if its +contents constitute a work based on the Library (independent of the use of the +Library in a tool for writing it). Whether that is true depends on what the +Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and disclaimer +of warranty; keep intact all the notices that refer to this License and to the +absence of any warranty; and distribute a copy of this License along with the +Library. + +You may charge a fee for the physical act of transferring a copy, and you may at +your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus +forming a work based on the Library, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all of +these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating + that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all + third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of + data to be supplied by an application program that uses the facility, other + than as an argument passed when the facility is invoked, then you must make + a good faith effort to ensure that, in the event an application does not + supply such function or table, the facility still operates, and performs + whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose + that is entirely well-defined independent of the application. Therefore, + Subsection 2d requires that any application-supplied function or table used + by this function must be optional: if the application does not supply it, + the square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If identifiable + sections of that work are not derived from the Library, and can be + reasonably considered independent and separate works in themselves, then + this License, and its terms, do not apply to those sections when you + distribute them as separate works. But when you distribute the same + sections as part of a whole which is a work based on the Library, the + distribution of the whole must be on the terms of this License, whose + permissions for other licensees extend to the entire whole, and thus to + each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest your + rights to work written entirely by you; rather, the intent is to exercise + the right to control the distribution of derivative or collective works + based on the Library. + + In addition, mere aggregation of another work not based on the Library with + the Library (or with a work based on the Library) on a volume of a storage + or distribution medium does not bring the other work under the scope of + this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. (If a +newer version than version 2 of the ordinary GNU General Public License has +appeared, then you can specify that version instead if you wish.) Do not make any +other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so +the ordinary GNU General Public License applies to all subsequent copies and +derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into +a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, +under Section 2) in object code or executable form under the terms of Sections 1 +and 2 above provided that you accompany it with the complete corresponding +machine-readable source code, which must be distributed under the terms of +Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code from +the same place satisfies the requirement to distribute the source code, even +though third parties are not compelled to copy the source along with the object +code. + +5. A program that contains no derivative of any portion of the Library, but is +designed to work with the Library by being compiled or linked with it, is called +a "work that uses the Library". Such a work, in isolation, is not a derivative +work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions of +the Library), rather than a "work that uses the library". The executable is +therefore covered by this License. Section 6 states terms for distribution of +such executables. + +When a "work that uses the Library" uses material from a header file that is part +of the Library, the object code for the work may be a derivative work of the +Library even though the source code is not. Whether this is true is especially +significant if the work can be linked without the Library, or if the work is +itself a library. The threshold for this to be true is not precisely defined by +law. + +If such an object file uses only numerical parameters, data structure layouts and +accessors, and small macros and small inline functions (ten lines or less in +length), then the use of the object file is unrestricted, regardless of whether +it is legally a derivative work. (Executables containing this object code plus +portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the +object code for the work under the terms of Section 6. Any executables containing +that work also fall under Section 6, whether or not they are linked directly with +the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work +that uses the Library" with the Library to produce a work containing portions of +the Library, and distribute that work under terms of your choice, provided that +the terms permit modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is +used in it and that the Library and its use are covered by this License. You must +supply a copy of this License. If the work during execution displays copyright +notices, you must include the copyright notice for the Library among them, as +well as a reference directing the user to the copy of this License. Also, you +must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable + source code for the Library including whatever changes were used in the + work (which must be distributed under Sections 1 and 2 above); and, if the + work is an executable linked with the Library, with the complete + machine-readable "work that uses the Library", as object code and/or source + code, so that the user can modify the Library and then relink to produce a + modified executable containing the modified Library. (It is understood that + the user who changes the contents of definitions files in the Library will + not necessarily be able to recompile the application to use the modified + definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A + suitable mechanism is one that (1) uses at run time a copy of the library + already present on the user's computer system, rather than copying library + functions into the executable, and (2) will operate properly with a + modified version of the library, if the user installs one, as long as the + modified version is interface-compatible with the version that the work was + made with. + + c) Accompany the work with a written offer, valid for at least three years, + to give the same user the materials specified in Subsection 6a, above, for + a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a + designated place, offer equivalent access to copy the above specified + materials from the same place. + + e) Verify that the user has already received a copy of these materials or + that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable from +it. However, as a special exception, the materials to be distributed need not +include anything that is normally distributed (in either source or binary form) +with the major components (compiler, kernel, and so on) of the operating system +on which the executable runs, unless that component itself accompanies the +executable. + +It may happen that this requirement contradicts the license restrictions of other +proprietary libraries that do not normally accompany the operating system. Such a +contradiction means you cannot use both them and the Library together in an +executable that you distribute. + +7. You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities not +covered by this License, and distribute such a combined library, provided that +the separate distribution of the work based on the Library and of the other +library facilities is otherwise permitted, and provided that you do these two +things: + + a) Accompany the combined library with a copy of the same work based on the + Library, uncombined with any other library facilities. This must be + distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of + it is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense, link with, or distribute the Library is void, and will +automatically terminate your rights under this License. However, parties who have +received copies, or rights, from you under this License will not have their +licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the Library +or its derivative works. These actions are prohibited by law if you do not accept +this License. Therefore, by modifying or distributing the Library (or any work +based on the Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying the Library +or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), +the recipient automatically receives a license from the original licensor to +copy, distribute, link with or modify the Library subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement +or for any other reason (not limited to patent issues), conditions are imposed on +you (whether by court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the conditions of this +License. If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, then as a +consequence you may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by all those +who receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, and the +section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system which is implemented by public license practices. Many people +have made generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that system; it is +up to the author/donor to decide if he or she is willing to distribute software +through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Library under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is +permitted only in or among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the +Lesser General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a +version number of this License which applies to it and "any later version", you +have the option of following the terms and conditions either of that version or +of any later version published by the Free Software Foundation. If the Library +does not specify a license version number, you may choose any version ever +published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the author to +ask for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make exceptions +for this. Our decision will be guided by the two goals of preserving the free +status of all derivatives of our free software and of promoting the sharing and +reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE +LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED +IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY +TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + +END OF TERMS AND CONDITIONS + + +How to Apply These Terms to Your New Libraries +---------------------------------------------- + +If you develop a new library, and you want it to be of the greatest possible use +to the public, we recommend making it free software that everyone can +redistribute and change. You can do so by permitting redistribution under these +terms (or, alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the library. It is safest +to attach them to the start of each source file to most effectively convey the +exclusion of warranty; and each file should have at least the "copyright" line +and a pointer to where the full notice is found. + + one line to give the library's name and an idea of what it does. + + Copyright (C) year name of author + + This library is free software; you can redistribute it and/or + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + + License along with this library; if not, write to the Free Software + + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a +sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in + + the library `Frob' (a library for tweaking knobs) written + + by James Random Hacker. + + signature of Ty Coon, 1 April 1990 + + Ty Coon, President of Vice + +That's all there is to it! + + +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Mozilla Public License +Version 2.0 +====================== + + +1. Definitions +-------------- + + 1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the creation + of, or owns Covered Software. + + 1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + + 1.3. "Contribution" + + means Covered Software of a particular Contributor. + + 1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the notice + in Exhibit A, the Executable Form of such Source Code Form, and Modifications + of such Source Code Form, in each case including portions thereof. + + 1.5. "Incompatible With Secondary Licenses" + + means + + a. + + that the initial Contributor has attached the notice described in Exhibit B + to the Covered Software; or + + b. + + that the Covered Software was made available under the terms of version 1.1 + or earlier of the License, but not also under the terms of a Secondary + License. + + 1.6. "Executable Form" + + means any form of the work other than Source Code Form. + + 1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + + 1.8. "License" + + means this document. + + 1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed + by this License. + + 1.10. "Modifications" + + means any of the following: + + a. + + any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. + + any new file in Source Code Form that contains any Covered Software. + + 1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, process, and + apparatus claims, in any patent Licensable by such Contributor that would be + infringed, but for the grant of the License, by the making, using, selling, + offering for sale, having made, import, or transfer of either its Contributions + or its Contributor Version. + + 1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public License, + Version 3.0, or any later versions of those licenses. + + 1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + + 1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this License. For + legal entities, "You" includes any entity that controls, is controlled by, or + is under common control with You. For purposes of this definition, "control" + means (a) the power, direct or indirect, to cause the direction or management + of such entity, whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial ownership of such + entity. + + +2. License Grants and Conditions +-------------------------------- + + + 2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive + license: + + a. + + under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, modify, + display, perform, distribute, and otherwise exploit its Contributions, + either on an unmodified basis, with Modifications, or as part of a Larger + Work; and + + b. + + under Patent Claims of such Contributor to make, use, sell, offer for sale, + have made, import, and otherwise transfer either its Contributions or its + Contributor Version. + + + 2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + + + 2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding + Section 2.1(b) above, no patent license is granted by a Contributor: + + a. + + for any code that a Contributor has removed from Covered Software; or + + b. + + for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. + + under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the notice + requirements in Section 3.4). + + + 2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to distribute + the Covered Software under a subsequent version of this License (see + Section 10.2) or under the terms of a Secondary License (if permitted under the + terms of Section 3.3). + + + 2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions are + its original creation(s) or it has sufficient rights to grant the rights to its + Contributions conveyed by this License. + + + 2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + + + 2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities +------------------- + + + 3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form of + the Covered Software is governed by the terms of this License, and how they can + obtain a copy of this License. You may not attempt to alter or restrict the + recipients' rights in the Source Code Form. + + + 3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. + + such Covered Software must also be made available in Source Code Form, as + described in Section 3.1, and You must inform recipients of the Executable + Form how they can obtain a copy of such Source Code Form by reasonable + means in a timely manner, at a charge no more than the cost of distribution + to the recipient; and + + b. + + You may distribute such Executable Form under the terms of this License, or + sublicense it under different terms, provided that the license for the + Executable Form does not attempt to limit or alter the recipients' rights + in the Source Code Form under this License. + + + 3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software with + a work governed by one or more Secondary Licenses, and the Covered Software is + not Incompatible With Secondary Licenses, this License permits You to + additionally distribute such Covered Software under the terms of such Secondary + License(s), so that the recipient of the Larger Work may, at their option, + further distribute the Covered Software under the terms of either this License + or such Secondary License(s). + + + 3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations of + liability) contained within the Source Code Form of the Covered Software, + except that You may alter any license notices to the extent required to remedy + known factual inaccuracies. + + + 3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, indemnity + or liability obligations to one or more recipients of Covered Software. + However, You may do so only on Your own behalf, and not on behalf of any + Contributor. You must make it absolutely clear that any such warranty, support, + indemnity, or liability obligation is offered by You alone, and You hereby + agree to indemnify every Contributor for any liability incurred by such + Contributor as a result of warranty, support, indemnity or liability terms You + offer. You may include additional disclaimers of warranty and limitations of + liability specific to any jurisdiction. + + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this License with +respect to some or all of the Covered Software due to statute, judicial order, or +regulation then You must: (a) comply with the terms of this License to the +maximum extent possible; and (b) describe the limitations and the code they +affect. Such description must be placed in a text file included with all +distributions of the Covered Software under this License. Except to the extent +prohibited by statute or regulation, such description must be sufficiently +detailed for a recipient of ordinary skill to be able to understand it. + + +5. Termination +-------------- + + 5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, then + the rights granted under this License from a particular Contributor are + reinstated (a) provisionally, unless and until such Contributor explicitly and + finally terminates Your grants, and (b) on an ongoing basis, if such + Contributor fails to notify You of the non-compliance by some reasonable means + prior to 60 days after You have come back into compliance. Moreover, Your + grants from a particular Contributor are reinstated on an ongoing basis if such + Contributor notifies You of the non-compliance by some reasonable means, this + is the first time You have received notice of non-compliance with this License + from such Contributor, and You become compliant prior to 30 days after Your + receipt of the notice. + + 5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, and + cross-claims) alleging that a Contributor Version directly or indirectly + infringes any patent, then the rights granted to You by any and all + Contributors for the Covered Software under Section 2.1 of this License shall + terminate. + + 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + + +6. Disclaimer of Warranty +------------------------- + +Covered Software is provided under this License on an "as is" basis, without +warranty of any kind, either expressed, implied, or statutory, including, without +limitation, warranties that the Covered Software is free of defects, +merchantable, fit for a particular purpose or non-infringing. The entire risk as +to the quality and performance of the Covered Software is with You. Should any +Covered Software prove defective in any respect, You (not any Contributor) assume +the cost of any necessary servicing, repair, or correction. This disclaimer of +warranty constitutes an essential part of this License. No use of any Covered +Software is authorized under this License except under this disclaimer. + + +7. Limitation of Liability +-------------------------- + +Under no circumstances and under no legal theory, whether tort (including +negligence), contract, or otherwise, shall any Contributor, or anyone who +distributes Covered Software as permitted above, be liable to You for any direct, +indirect, special, incidental, or consequential damages of any character +including, without limitation, damages for lost profits, loss of goodwill, work +stoppage, computer failure or malfunction, or any and all other commercial +damages or losses, even if such party shall have been informed of the possibility +of such damages. This limitation of liability shall not apply to liability for +death or personal injury resulting from such party's negligence to the extent +applicable law prohibits such limitation. Some jurisdictions do not allow the +exclusion or limitation of incidental or consequential damages, so this exclusion +and limitation may not apply to You. + + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the courts of a +jurisdiction where the defendant maintains its principal place of business and +such litigation shall be governed by laws of that jurisdiction, without reference +to its conflict-of-law provisions. Nothing in this Section shall prevent a +party's ability to bring cross-claims or counter-claims. + + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject matter +hereof. If any provision of this License is held to be unenforceable, such +provision shall be reformed only to the extent necessary to make it enforceable. +Any law or regulation which provides that the language of a contract shall be +construed against the drafter shall not be used to construe this License against +a Contributor. + + +10. Versions of the License +--------------------------- + + + 10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section 10.3, + no one other than the license steward has the right to modify or publish new + versions of this License. Each version will be given a distinguishing version + number. + + + 10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of the + License under which You originally received the Covered Software, or under the + terms of any subsequent version published by the license steward. + + + 10.3. Modified Versions + + If you create software not governed by this License, and you want to create a + new license for such software, you may create and use a modified version of + this License if you rename the license and remove any references to the name of + the license steward (except to note that such modified license differs from + this License). + + + 10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses + + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the notice + described in Exhibit B of this License must be attached. + + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public License, + v. 2.0. If a copy of the MPL was not distributed with this file, You can + obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as defined + by the Mozilla Public License, v. 2.0. + +------------------------------------------------------------------------------- +| libzstd-dev 1.5.4 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Meta Platforms, Inc. and affiliates. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| libzstd-dev 1.5.5 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| roboticstoolbox-python 1.0.2 (used under MIT License) https://github.com/petercorke/robotics-toolbox-python +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License +=============== + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| zstd 1.5.5 (used under BSD 3-clause "New" or "Revised" License) http://www.zstd.net +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Martin Liska, SUSE, Meta Platforms, Inc. and affiliates. +Copyright (C) 2012-2016 Yann Collet. +Copyright (c) Yann Collet, Meta Platforms, Inc. and affiliates. +Copyright 2020 Jan Tojnar. +Copyright (c) 1995-2006, 2010-2011 Jean-loup Gailly. +Copyright (c) 2018-present lzutao +Copyright (C) 2004-2017 Mark Adler. +Copyright (c) 2003-2008 Yuta Mori. All Rights Reserved. +Copyright (c) Meta Platforms, Inc. and affiliates. You can contact the author at : and affiliates and affiliates. All Rights Reserved. +Copyright (C) 1989, 1991, 2000-2016 Free Software Foundation, Inc. +Copyright (c) 2016 Tino Reichardt. All Rights Reserved. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +Generated on Fri, 28 Jul 2023 15:38:21 +0200 using Black Duck 2023.4.2. \ No newline at end of file diff --git a/czishrink/icon-source/convert-to-ico.sh b/czishrink/icon-source/convert-to-ico.sh new file mode 100644 index 0000000..2955790 --- /dev/null +++ b/czishrink/icon-source/convert-to-ico.sh @@ -0,0 +1,2 @@ +#!/bin/bash +magick mogrify -path . -format ico -density 600 -define icon:auto-resize=256,128,64,48,40,32,24,16 -background none netczicompress.svg \ No newline at end of file diff --git a/czishrink/icon-source/netczicompress.svg b/czishrink/icon-source/netczicompress.svg new file mode 100644 index 0000000..03de992 --- /dev/null +++ b/czishrink/icon-source/netczicompress.svg @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/czishrink/libczicompressc/LICENSE.txt b/czishrink/libczicompressc/LICENSE.txt new file mode 100644 index 0000000..1749d76 --- /dev/null +++ b/czishrink/libczicompressc/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Carl Zeiss Microscopy GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/czishrink/libczicompressc/THIRD_PARTY_LICENSES.txt b/czishrink/libczicompressc/THIRD_PARTY_LICENSES.txt new file mode 100644 index 0000000..1b833ba --- /dev/null +++ b/czishrink/libczicompressc/THIRD_PARTY_LICENSES.txt @@ -0,0 +1,128 @@ +============= Free and Open Source Software Disclosure Statement ============== + +For libCZI + +This project includes copyrighted software from third parties that may be +distributed under different licenses than this project as given below. + +In case we missed to list a specific software and/or underlying license, +we appreciate your upfront notice. + +This project may include copyrighted software that is distributed under a +license that requires us to provide the source code of that software and +instructions on how to build and install it, such as the GNU GPL or GNU +LGPL or other reciprocal licenses. Unless otherwise stated the original +source code of such software has not been modified. As recipient and user of +this project you may obtain the complete source code for such copyrighted +software as well as build and install instructions from us for a period of +three years starting with the reception of the project and at no charge. + +In any of such cases, please send an email to opensource@zeiss.com +referencing this project's name and version. + + +List of third-party software: +----------------------------------- + +=============================================================================== + +------------------------------------------------------------------------------- +| jxrlib 1.1 (used under BSD 3-clause "New" or "Revised" License) https://github.com/4creators/jxrlib +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright 2013 Microsoft Corporation + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| md5sum (used under RSA MD4 or MD5 Message-Digest Algorithm License) +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +RSA MD4 or MD5 Message-Digest Algorithm License +=============================================== + +License to copy and use this software is granted provided that it is identified +as the "RSA Data Security, Inc. MD4 or MD5 Message-Digest Algorithm" in all +material mentioning or referencing this software or this function. + +License is also granted to make and use derivative works provided that such works +are identified as "derived from the RSA Data Security, Inc. MD4 or MD5 +Message-Digest Algorithm" in all material mentioning or referencing the derived +work. + +RSA Data Security, Inc. makes no representations concerning either the +merchantability of this software or the suitability of this software for any +particular purpose. It is provided "as is" without express or implied warranty of +any kind. + +These notices must be retained in any copies of any part of this documentation +and/or software. + +------------------------------------------------------------------------------- +| pugixml 1.10 (used under MIT License) http://pugixml.org/ +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (C) 2006-2019, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) +Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +This library is distributed under the MIT License: + +Copyright (c) 2006-2019 Arseny Kapoulkine + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE + + +--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +Generated on Thu, 29 Sep 2022 07:40:42 +0200 using Black Duck 2022.4.2. \ No newline at end of file diff --git a/czishrink/libczicompressc/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt b/czishrink/libczicompressc/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt new file mode 100644 index 0000000..6686074 --- /dev/null +++ b/czishrink/libczicompressc/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt @@ -0,0 +1,1524 @@ +============= Free and Open Source Software Disclosure Statement ============== + +For czicompress + +This product includes copyrighted software from third parties that may be +distributed under different licenses than this product as given below. + +In case we missed to list a specific software and/or underlying license, +we appreciate your upfront notice. + +This product may include copyrighted software that is distributed under a +license that requires us to provide the source code of that software and +instructions on how to build and install it, such as the GNU GPL or GNU +LGPL or other reciprocal licenses. Unless otherwise stated the original +source code of such software has not been modified. As recipient and user of +this product you may obtain the complete source code for such copyrighted +software as well as build and install instructions from us for a period of +three years starting with the reception of the product and valid for as +long as we offer spare parts or customer support for that product model +and at no charge. + +In any of such cases, please send an email to opensource@zeiss.com +referencing your product's name, version, and manufacturing ZEISS entity. + + +List of third-party software: +----------------------------------- + +=============================================================================== + +------------------------------------------------------------------------------- +| Catch2 3.4.0 (used under Boost Software License 1.0) https://discord.gg/4CWS9zD +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Boost Software License - Version 1.0 +==================================== + + +August 17th, 2003 +----------------- + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by this +license (the "Software") to use, reproduce, display, distribute, execute, and +transmit the Software, and to prepare derivative works of the Software, and to +permit third-parties to whom the Software is furnished to do so, all subject to +the following: +The copyright notices in the Software and this entire statement, including the +above license grant, this restriction and the following disclaimer, must be +included in all copies of the Software, in whole or in part, and all derivative +works of the Software, unless such copies or derivative works are solely in the +form of machine-executable object code generated by a source language processor. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES +OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| CLIUtils/CLI11 v2.3.2 (used under BSD 3-clause "New" or "Revised" License) https://cliutils.gitlab.io/CLI11Tutorial +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner under NSF AWARD 1414736. All Rights Reserved. +Copyright (c) 2012 - 2017, Lars Bilke. All Rights Reserved. +Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| D3.js 3.5.17 (used under BSD 3-clause "New" or "Revised" License) http://d3js.org/ +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2010 Stanford Visualization Group. All Rights Reserved. +Copyright (c) 2011 Jason Davies. All Rights Reserved. +Copyright 2001 Robert Penner. All Rights Reserved. +Copyright (c) 2008-2012 Charles Karney. +Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State. +Copyright (c) 2010 SimpleGeo and Stamen Design. All Rights Reserved. +Copyright (c) 2010-2016 Michael Bostock. All Rights Reserved. +Copyright (C) 2010-2013 Raymond Hill. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) 2010, Stanford Visualization Group +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Stanford University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + +------------------------------------------------------------------------------- +| gmdh 1.0 (used under MIT License) https://github.com/bauman-team/GMDH +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright 2001-2009 Kitware, Inc. +Copyright (C) 2018 David Hyde. +Copyright (C) 2009 Benjamin Schindler. +Copyright 2012 Continuum Analytics, Inc. All Rights Reserved. +Copyright (C) 2002-2007 Yves Renard This file is a part of GETFEM++. +Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). +Copyright (C) 2011 Timothy E. Holy. +Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. +Copyright (C) 2020 Jens Wehner. +Copyright 2017 The TensorFlow Authors. All Rights Reserved. +Copyright 2013-2016 Florent Pruvost. +Copyright (C) EDF R. +Copyright (C) 2012 Desire Nuentsa Wakam. +Copyright (C) 2009-2013 Jitse Niesen. +Copyright (C) 2009 Ilya Baran. +(C) William Swanson, Paul Fultz define PYBIND11_EVAL0(...) __VA_ARGS__ define PYBIND11_EVAL1(...) PYBIND11_EVAL0(PYBIND11_EVAL0(PYBIND11_EVAL0(__VA_ARGS__))) define PYBIND11_EVAL2( +Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. +Copyright (C) 2013 Pavel Holoborodko. +Copyright (c) 2016-2017, 2020 Wenzel Jakob. All Rights Reserved. +Copyright : EDF 2001 $Header$. +Copyright (C) 2014 yoco. +Copyright (C) 2013 Jean Ceccato. +Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. +Copyright (C) 2011-2013 Chen-Pang He. +Copyright (C) 2006-2011, 2015 Benoit Jacob. +copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. +Copyright (c) 2019 Dawid Pilarski. +Copyright (C) 2013 Pierre Zoppitelli. +Copyright (C) 2020 Everton Constantino. +Copyright (C) 2019 David Tellenbach. +(C) Desire NUENTSA WAKAM, INRIA include include include include include include include +Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. +Copyright (c) 2016 Sergey Lyskov and Wenzel Jakob. +(C) Desire NUENTSA WAKAM, INRIA include include include include include include ifd +Copyright (c) Fabian Giesen, 2016. All Rights Reserved. +Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. +Copyright (C) 2012 Alexey Korepanov. +Copyright (C) 1998-2010, 2015-2016. +Copyright (c) 2020 Wenzel Jakob and Henry Schreiner. +Copyright (C) 2015-2016 Eugene Brevdo. +Copyright (C) 2011 Andreas Platen. +Copyright (C) 2017 Viktor Csomor. +Copyright (C) 2020 Antonio Sanchez. +Copyright (c) 2017 Henry F. Schreiner. +Copyright (C) 2017 Kyle Macfarlan. +Copyright (C) 2012-2013 D. +Copyright (C) 2009 Thomas Capricelli This code initially comes from MINPACK whose original authors are:. +Copyright (C) 2008 Daniel Gomez Ferro. +Copyright (C) 2013 Nicolas Carre. +Copyright (C) 2012 David Harmon. +Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. +Copyright (c) 2021 Laramie Leavitt (Google LLC). +Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). +Copyright (c) 2019 Roland Dreier. +copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. +Copyright (C) 2016 Dmitry Vyukov. +Copyright (c) 2007 Allen Winter. +Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. +Copyright (c) 2006-2007 Montel Laurent. +Copyright (C) 2009 Mark Borgerding mark a borgerding net. +Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). +Copyright (C) 2009 Ricard Marxer. +Copyright (c) 2016 Sergey Lyskov. +Copyright 2003-2009 Mark Borgerding template struct kiss_cpx_fft. +Copyright 2012-2013 Mathieu Faverge. +Copyright (C) 2016 Igor Babuschkin. +Copyright (C) 2009 Kenneth Riddile. +Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. +Copyright (C) 2005 the Regents of the University of Minnesota. +Copyright (c) 2007 Alexander Neundorf. +Copyright 2018-2019, 2022 Google LLC. All Rights Reserved. +Copyright (C) 2019 Joel Holdsworth. +Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. +Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. Permition is granted to use, copy, distribute and prepare derivative works of this library for any purpose and without fee, provided, that the above. +Copyright (C) 2020 Jan van Dijk. +Copyright (C) 2009 Rohit Garg. +Copyright (c) 2017 Borja Zarco (Google LLC). +Copyright (C) 2009-2010 Thomas Capricelli. +Copyright (C) 2020 Arm Limited and Contributors. +Copyright (C) 2015 Vijay Vasudevan. +Copyright (C) 2009 Claire Maurice. +Copyright (C) 2017 Codeplay Software Limited. +Copyright (C) 2014-2015 Jianwei Cui. +Copyright (C) 2009-2013 Hauke Heibel. +Copyright (C) 2010 Vincent Lejeune. +Copyright (C) 2008-2009 Guillaume Saupin. +Copyright (C) 2020 Sebastien Boisvert. +Copyright (C) 2009 Mathieu Gautier. +Copyright (C) 2013 Christoph Hertzberg. +Copyright (C) 2008 Gael Guennebaud NOTE The functions of this file have been adapted from the GMM++ library. +Copyright (C) 2012-2013 Desire Nuentsa. +Copyright (C) 2017 Gagan Goel. +Copyright (C) 2014-2017 Benoit Steiner. +Copyright (C) 2020-2021 C. Antonio Sanchez. +Copyright (c) 2018 Hudson River Trading LLC. +Copyright (C) 2014-2015 Navdeep Jaitly. +Copyright (C) 2009 Thomas Capricelli include. +Copyright (c) 2016-2017 Jason Rhinelander. +Copyright (c) 2016 Pim Schellart. +Copyright (C) 2012 The Android Open Source Project. +Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. +Copyright (c) 2016 Ivan Smirnov. +Copyright (C) 2007 Michael Olbrich. +Copyright (c) 2020 The Eigen Authors. +Copyright (c) 2009 Boudewijn Rempt. +Copyright (C) 2012 desire Nuentsa. +(C) Copyright .. +Copyright 2012 Cedric Castagnede. +Copyright (C) 2012 Desire Nuentsa This code initially comes from MINPACK whose original authors are:. +Copyright (C) 2008-2019 Gael Guennebaud. +Copyright (C) 2012 Giacomo Po. +Copyright (c) 2016 Ben North. +copyright: (c) 2013 by Ihor Kalnytskyi +Copyright (C) 2018 Andy Davis. +Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = Moshier Permission has been kindly provided by the original author to incorporate the Cephes software into the Eigen codebase: Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140. +Copyright 2012-2016 Inria. All Rights Reserved. +Copyright (C) 2008-2009 Gael Guennebaud NOTE The class IterationController has been adapted from the iteration. +Copyright (C) 2013 Christian Seiler. +Copyright (C) 2009, 2012 Keir Mierle. +Copyright (c) 2016 Klemens D. Morgenstern. +Copyright (c) 2010 Intel Corp. All Rights Reserved. +Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditio. +Copyright (C) 2008-2016 Konstantinos Margaritis. +Copyright (c) 2006 Timothy A. Davis. +Copyright (c) 2011-2014 Willow Garage, Inc. +Copyright (C) 2016 Tobias Wood. +Copyright (C) 2011-2012, 2014 Kolja Brix. +Copyright (C) 2010 Manuel Yguel. +Copyright (C) 2015 Tal Hadad. +Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee This file is part of the Iterative Template Library. +Copyright (C) 2015 Ke Yang. +Copyright 2005-2010, 2013, 2015, 2018-2021 Google Inc. All Rights Reserved. +Copyright (C) 2018 Eugene Zhulenev. +Copyright (C) 2007 Julien Pommier. +Copyright (C) 2018 Wave Computing, Inc. Written by:. +Copyright 2016-2018 Codeplay Software Ltd. +Copyright (C) 2012 Desire Nuentsa The algorithm of this. +Copyright (c) 2016 Klemens Morgenstern and. +Copyright (C) 2012 Desire NUENTSA WAKAM. +Copyright (c) 2012 Erik Edlund Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a. +Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). +Copyright (C) 2018 Deven Desai. +Copyright (C) 2020 Chris Schoutrop. +Copyright (C) 2010 Daniel Lowengrub. +Copyright 2012-2013 Emmanuel Agullo. +Copyright (C) 2014 Eric Martin. +Copyright (c) 2016 Trent Houliston and. +Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). +Copyright (c) 2019 Pranav. +Copyright (C) 2013 Gauthier Brun. +Copyright (c) 2021 The Pybind Development Team. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License +=============== + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| libeigen/eigen 3.4.0 (used under (GNU Lesser General Public License v2.1 or later AND BSD 3-clause "New" or "Revised" License AND Mozilla Public License 2.0)) https://gitlab.com/libeigen/eigen.git +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (C) 2018 David Hyde. +Copyright (C) 2009 Benjamin Schindler. +Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). +Copyright (C) 2011 Timothy E. Holy. +Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. +Copyright (C) 2020 Jens Wehner. +Copyright 2017 The TensorFlow Authors. All Rights Reserved. +Copyright 2013-2016 Florent Pruvost. +Copyright (C) EDF R. +Copyright (C) 2012 Desire Nuentsa Wakam. +Copyright (C) 2009-2013 Jitse Niesen. +Copyright (C) 2009 Ilya Baran. +Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. +Copyright (C) 2013 Pavel Holoborodko. +Copyright : EDF 2001 $Header$. +Copyright (C) 2014 yoco. +Copyright (C) 2013 Jean Ceccato. +Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. +Copyright (C) 2011-2013 Chen-Pang He. +Copyright (C) 2006-2011, 2015 Benoit Jacob. +copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. +Copyright (C) 2013 Pierre Zoppitelli. +Copyright (C) 2020 Everton Constantino. +Copyright (C) 2019 David Tellenbach. +Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. +Copyright (c) Fabian Giesen, 2016. All Rights Reserved. +Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. +Copyright (C) 2012 Alexey Korepanov. +Copyright (C) 1998-2010, 2015-2016. +Copyright (C) 2015-2016 Eugene Brevdo. +Copyright (C) 2011 Andreas Platen. +Copyright (C) 2017 Viktor Csomor. +Copyright (C) 2020 Antonio Sanchez. +Copyright 2003-2009 Mark Borgerding. +Copyright (C) 2017 Kyle Macfarlan. +Copyright (C) 2012-2013 D. +Copyright (C) 2008 Daniel Gomez Ferro. +Copyright (C) 2013 Nicolas Carre. +Copyright (C) 2012 David Harmon. +Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. +Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). +Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions. +copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. +Copyright (C) 2016 Dmitry Vyukov. +Copyright (c) 2007 Allen Winter. +Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. +Copyright (c) 2006-2007 Montel Laurent. +Copyright (C) 2009 Mark Borgerding mark a borgerding net. +Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). +Copyright (C) 2009 Ricard Marxer. +Copyright 2012-2013 Mathieu Faverge. +Copyright (C) 2016 Igor Babuschkin. +Copyright (C) 2009 Kenneth Riddile. +Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. +Copyright (C) 2005 the Regents of the University of Minnesota. +Copyright (c) 2007 Alexander Neundorf. +Copyright (C) 2019 Joel Holdsworth. +Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. +Copyright (C) 2002-2007 Yves Renard. +Copyright (C) 2020 Jan van Dijk. +Copyright (C) 2008-2019, 20013, 20015 Gael Guennebaud. +Copyright (C) 2009 Rohit Garg. +Copyright (C) 2009-2010 Thomas Capricelli. +Copyright (C) 2020 Arm Limited and Contributors. +Copyright (C) 2015 Vijay Vasudevan. +Copyright (C) 2009 Claire Maurice. +Copyright (C) 2017 Codeplay Software Limited. +Copyright (C) 2014-2015 Jianwei Cui. +Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = NumTr Moshier. +Copyright (C) 2009-2013 Hauke Heibel. +Copyright (C) 2010 Vincent Lejeune. +Copyright (C) 2008-2009 Guillaume Saupin. +Copyright (C) 2020 Sebastien Boisvert. +Copyright (C) 2009 Mathieu Gautier. +Copyright (C) 2013 Christoph Hertzberg. +Copyright (C) 2012-2013 Desire Nuentsa. +Copyright (C) 2017 Gagan Goel. +Copyright (C) 2014-2017 Benoit Steiner. +Copyright (C) 2020-2021 C. Antonio Sanchez. +Copyright (C) 2014-2015 Navdeep Jaitly. +Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee. +Copyright (C) 2012 The Android Open Source Project. +Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. +Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. +Copyright (C) 2007 Michael Olbrich. +Copyright (c) 2020 The Eigen Authors. +Copyright (c) 2009 Boudewijn Rempt. +Copyright (C) 2012 desire Nuentsa. +Copyright 2012 Cedric Castagnede. +Copyright (C) 2012 Giacomo Po. +Copyright (C) 2018 Andy Davis. +Copyright 2012-2016 Inria. All Rights Reserved. +Copyright (C) 2013 Christian Seiler. +Copyright (C) 2009, 2012 Keir Mierle. +Copyright 2007-2009 Kitware, Inc. +Copyright (C) 2008-2016 Konstantinos Margaritis. +Copyright (c) 2006 Timothy A. Davis. +Copyright (c) 2011-2014 Willow Garage, Inc. +Copyright (C) 2016 Tobias Wood. +Copyright (C) 2011-2012, 2014 Kolja Brix. +Copyright (C) 2010 Manuel Yguel. +Copyright (C) 2015 Tal Hadad. +Copyright (C) 2015 Ke Yang. +Copyright (C) 2018 Eugene Zhulenev. +Copyright (C) 2007 Julien Pommier. +Copyright (C) 2018 Wave Computing, Inc. Written by:. +Copyright 2016-2018 Codeplay Software Ltd. +Copyright (C) 2012 Desire NUENTSA WAKAM. +Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). +Copyright (C) 2018 Deven Desai. +Copyright (C) 2020 Chris Schoutrop. +(C) Desire NUENTSA WAKAM, INRIA +Copyright (C) 2010 Daniel Lowengrub. +Copyright 2012-2013 Emmanuel Agullo. +Copyright (C) 2014 Eric Martin. +Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). +Copyright (C) 2013 Gauthier Brun. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +GNU Lesser General Public License +================================= + +Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + + of this license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also counts + + as the successor of the GNU Library Public License, version 2, hence + + the version number 2.1.] + + +Preamble +-------- + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public Licenses are intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, but we +suggest you first think carefully about whether this license or the ordinary +General Public License is the better strategy to use in any particular case, +based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. +Our General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for this service if you wish); +that you receive source code or can get it if you want it; that you can change +the software and use pieces of it in new free programs; and that you are informed +that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to +deny you these rights or to ask you to surrender these rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a +fee, you must give the recipients all the rights that we gave you. You must make +sure that they, too, receive or can get the source code. If you link other code +with the library, you must provide complete object files to the recipients, so +that they can relink them with the library after making changes to the library +and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and +(2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone else +and passed on, the recipients should know that what they have is not the original +version, so that the original author's reputation will not be affected by +problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent holder. +Therefore, we insist that any patent license obtained for a version of the +library must be consistent with the full freedom of use specified in this +license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the ordinary +General Public License. We use this license for certain libraries in order to +permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License therefore +permits such linking only if the entire combination fits its criteria of freedom. +The Lesser General Public License permits more lax criteria for linking other +code with the library. + +We call this license the "Lesser" General Public License because it does Less to +protect the user's freedom than the ordinary General Public License. It also +provides other free software developers Less of an advantage over competing +non-free programs. These disadvantages are the reason we use the ordinary General +Public License for many libraries. However, the Lesser license provides +advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto standard. +To achieve this, non-free programs must be allowed to use the library. A more +frequent case is that a free library does the same job as widely used non-free +libraries. In this case, there is little to gain by limiting the free library to +free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables many +more people to use the whole GNU operating system, as well as its variant, the +GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a modified +version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code derived +from the library, whereas the latter must be combined with the library in order +to run. + + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +--------------------------------------------------------------- + +0. This License Agreement applies to any software library or other program which +contains a notice placed by the copyright holder or other authorized party saying +it may be distributed under the terms of this Lesser General Public License (also +called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as +to be conveniently linked with application programs (which use some of those +functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been +distributed under these terms. A "work based on the Library" means either the +Library or any derivative work under copyright law: that is to say, a work +containing the Library or a portion of it, either verbatim or with modifications +and/or translated straightforwardly into another language. (Hereinafter, +translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the source +code for all modules it contains, plus any associated interface definition files, +plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running a program using the +Library is not restricted, and output from such a program is covered only if its +contents constitute a work based on the Library (independent of the use of the +Library in a tool for writing it). Whether that is true depends on what the +Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and disclaimer +of warranty; keep intact all the notices that refer to this License and to the +absence of any warranty; and distribute a copy of this License along with the +Library. + +You may charge a fee for the physical act of transferring a copy, and you may at +your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus +forming a work based on the Library, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all of +these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating + that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all + third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of + data to be supplied by an application program that uses the facility, other + than as an argument passed when the facility is invoked, then you must make + a good faith effort to ensure that, in the event an application does not + supply such function or table, the facility still operates, and performs + whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose + that is entirely well-defined independent of the application. Therefore, + Subsection 2d requires that any application-supplied function or table used + by this function must be optional: if the application does not supply it, + the square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If identifiable + sections of that work are not derived from the Library, and can be + reasonably considered independent and separate works in themselves, then + this License, and its terms, do not apply to those sections when you + distribute them as separate works. But when you distribute the same + sections as part of a whole which is a work based on the Library, the + distribution of the whole must be on the terms of this License, whose + permissions for other licensees extend to the entire whole, and thus to + each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest your + rights to work written entirely by you; rather, the intent is to exercise + the right to control the distribution of derivative or collective works + based on the Library. + + In addition, mere aggregation of another work not based on the Library with + the Library (or with a work based on the Library) on a volume of a storage + or distribution medium does not bring the other work under the scope of + this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. (If a +newer version than version 2 of the ordinary GNU General Public License has +appeared, then you can specify that version instead if you wish.) Do not make any +other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so +the ordinary GNU General Public License applies to all subsequent copies and +derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into +a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, +under Section 2) in object code or executable form under the terms of Sections 1 +and 2 above provided that you accompany it with the complete corresponding +machine-readable source code, which must be distributed under the terms of +Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code from +the same place satisfies the requirement to distribute the source code, even +though third parties are not compelled to copy the source along with the object +code. + +5. A program that contains no derivative of any portion of the Library, but is +designed to work with the Library by being compiled or linked with it, is called +a "work that uses the Library". Such a work, in isolation, is not a derivative +work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions of +the Library), rather than a "work that uses the library". The executable is +therefore covered by this License. Section 6 states terms for distribution of +such executables. + +When a "work that uses the Library" uses material from a header file that is part +of the Library, the object code for the work may be a derivative work of the +Library even though the source code is not. Whether this is true is especially +significant if the work can be linked without the Library, or if the work is +itself a library. The threshold for this to be true is not precisely defined by +law. + +If such an object file uses only numerical parameters, data structure layouts and +accessors, and small macros and small inline functions (ten lines or less in +length), then the use of the object file is unrestricted, regardless of whether +it is legally a derivative work. (Executables containing this object code plus +portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the +object code for the work under the terms of Section 6. Any executables containing +that work also fall under Section 6, whether or not they are linked directly with +the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work +that uses the Library" with the Library to produce a work containing portions of +the Library, and distribute that work under terms of your choice, provided that +the terms permit modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is +used in it and that the Library and its use are covered by this License. You must +supply a copy of this License. If the work during execution displays copyright +notices, you must include the copyright notice for the Library among them, as +well as a reference directing the user to the copy of this License. Also, you +must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable + source code for the Library including whatever changes were used in the + work (which must be distributed under Sections 1 and 2 above); and, if the + work is an executable linked with the Library, with the complete + machine-readable "work that uses the Library", as object code and/or source + code, so that the user can modify the Library and then relink to produce a + modified executable containing the modified Library. (It is understood that + the user who changes the contents of definitions files in the Library will + not necessarily be able to recompile the application to use the modified + definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A + suitable mechanism is one that (1) uses at run time a copy of the library + already present on the user's computer system, rather than copying library + functions into the executable, and (2) will operate properly with a + modified version of the library, if the user installs one, as long as the + modified version is interface-compatible with the version that the work was + made with. + + c) Accompany the work with a written offer, valid for at least three years, + to give the same user the materials specified in Subsection 6a, above, for + a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a + designated place, offer equivalent access to copy the above specified + materials from the same place. + + e) Verify that the user has already received a copy of these materials or + that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable from +it. However, as a special exception, the materials to be distributed need not +include anything that is normally distributed (in either source or binary form) +with the major components (compiler, kernel, and so on) of the operating system +on which the executable runs, unless that component itself accompanies the +executable. + +It may happen that this requirement contradicts the license restrictions of other +proprietary libraries that do not normally accompany the operating system. Such a +contradiction means you cannot use both them and the Library together in an +executable that you distribute. + +7. You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities not +covered by this License, and distribute such a combined library, provided that +the separate distribution of the work based on the Library and of the other +library facilities is otherwise permitted, and provided that you do these two +things: + + a) Accompany the combined library with a copy of the same work based on the + Library, uncombined with any other library facilities. This must be + distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of + it is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense, link with, or distribute the Library is void, and will +automatically terminate your rights under this License. However, parties who have +received copies, or rights, from you under this License will not have their +licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the Library +or its derivative works. These actions are prohibited by law if you do not accept +this License. Therefore, by modifying or distributing the Library (or any work +based on the Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying the Library +or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), +the recipient automatically receives a license from the original licensor to +copy, distribute, link with or modify the Library subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement +or for any other reason (not limited to patent issues), conditions are imposed on +you (whether by court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the conditions of this +License. If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, then as a +consequence you may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by all those +who receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, and the +section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system which is implemented by public license practices. Many people +have made generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that system; it is +up to the author/donor to decide if he or she is willing to distribute software +through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Library under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is +permitted only in or among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the +Lesser General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a +version number of this License which applies to it and "any later version", you +have the option of following the terms and conditions either of that version or +of any later version published by the Free Software Foundation. If the Library +does not specify a license version number, you may choose any version ever +published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the author to +ask for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make exceptions +for this. Our decision will be guided by the two goals of preserving the free +status of all derivatives of our free software and of promoting the sharing and +reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE +LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED +IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY +TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + +END OF TERMS AND CONDITIONS + + +How to Apply These Terms to Your New Libraries +---------------------------------------------- + +If you develop a new library, and you want it to be of the greatest possible use +to the public, we recommend making it free software that everyone can +redistribute and change. You can do so by permitting redistribution under these +terms (or, alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the library. It is safest +to attach them to the start of each source file to most effectively convey the +exclusion of warranty; and each file should have at least the "copyright" line +and a pointer to where the full notice is found. + + one line to give the library's name and an idea of what it does. + + Copyright (C) year name of author + + This library is free software; you can redistribute it and/or + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + + License along with this library; if not, write to the Free Software + + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a +sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in + + the library `Frob' (a library for tweaking knobs) written + + by James Random Hacker. + + signature of Ty Coon, 1 April 1990 + + Ty Coon, President of Vice + +That's all there is to it! + + +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Mozilla Public License +Version 2.0 +====================== + + +1. Definitions +-------------- + + 1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the creation + of, or owns Covered Software. + + 1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + + 1.3. "Contribution" + + means Covered Software of a particular Contributor. + + 1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the notice + in Exhibit A, the Executable Form of such Source Code Form, and Modifications + of such Source Code Form, in each case including portions thereof. + + 1.5. "Incompatible With Secondary Licenses" + + means + + a. + + that the initial Contributor has attached the notice described in Exhibit B + to the Covered Software; or + + b. + + that the Covered Software was made available under the terms of version 1.1 + or earlier of the License, but not also under the terms of a Secondary + License. + + 1.6. "Executable Form" + + means any form of the work other than Source Code Form. + + 1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + + 1.8. "License" + + means this document. + + 1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed + by this License. + + 1.10. "Modifications" + + means any of the following: + + a. + + any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. + + any new file in Source Code Form that contains any Covered Software. + + 1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, process, and + apparatus claims, in any patent Licensable by such Contributor that would be + infringed, but for the grant of the License, by the making, using, selling, + offering for sale, having made, import, or transfer of either its Contributions + or its Contributor Version. + + 1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public License, + Version 3.0, or any later versions of those licenses. + + 1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + + 1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this License. For + legal entities, "You" includes any entity that controls, is controlled by, or + is under common control with You. For purposes of this definition, "control" + means (a) the power, direct or indirect, to cause the direction or management + of such entity, whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial ownership of such + entity. + + +2. License Grants and Conditions +-------------------------------- + + + 2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive + license: + + a. + + under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, modify, + display, perform, distribute, and otherwise exploit its Contributions, + either on an unmodified basis, with Modifications, or as part of a Larger + Work; and + + b. + + under Patent Claims of such Contributor to make, use, sell, offer for sale, + have made, import, and otherwise transfer either its Contributions or its + Contributor Version. + + + 2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + + + 2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding + Section 2.1(b) above, no patent license is granted by a Contributor: + + a. + + for any code that a Contributor has removed from Covered Software; or + + b. + + for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. + + under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the notice + requirements in Section 3.4). + + + 2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to distribute + the Covered Software under a subsequent version of this License (see + Section 10.2) or under the terms of a Secondary License (if permitted under the + terms of Section 3.3). + + + 2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions are + its original creation(s) or it has sufficient rights to grant the rights to its + Contributions conveyed by this License. + + + 2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + + + 2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities +------------------- + + + 3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form of + the Covered Software is governed by the terms of this License, and how they can + obtain a copy of this License. You may not attempt to alter or restrict the + recipients' rights in the Source Code Form. + + + 3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. + + such Covered Software must also be made available in Source Code Form, as + described in Section 3.1, and You must inform recipients of the Executable + Form how they can obtain a copy of such Source Code Form by reasonable + means in a timely manner, at a charge no more than the cost of distribution + to the recipient; and + + b. + + You may distribute such Executable Form under the terms of this License, or + sublicense it under different terms, provided that the license for the + Executable Form does not attempt to limit or alter the recipients' rights + in the Source Code Form under this License. + + + 3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software with + a work governed by one or more Secondary Licenses, and the Covered Software is + not Incompatible With Secondary Licenses, this License permits You to + additionally distribute such Covered Software under the terms of such Secondary + License(s), so that the recipient of the Larger Work may, at their option, + further distribute the Covered Software under the terms of either this License + or such Secondary License(s). + + + 3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations of + liability) contained within the Source Code Form of the Covered Software, + except that You may alter any license notices to the extent required to remedy + known factual inaccuracies. + + + 3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, indemnity + or liability obligations to one or more recipients of Covered Software. + However, You may do so only on Your own behalf, and not on behalf of any + Contributor. You must make it absolutely clear that any such warranty, support, + indemnity, or liability obligation is offered by You alone, and You hereby + agree to indemnify every Contributor for any liability incurred by such + Contributor as a result of warranty, support, indemnity or liability terms You + offer. You may include additional disclaimers of warranty and limitations of + liability specific to any jurisdiction. + + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this License with +respect to some or all of the Covered Software due to statute, judicial order, or +regulation then You must: (a) comply with the terms of this License to the +maximum extent possible; and (b) describe the limitations and the code they +affect. Such description must be placed in a text file included with all +distributions of the Covered Software under this License. Except to the extent +prohibited by statute or regulation, such description must be sufficiently +detailed for a recipient of ordinary skill to be able to understand it. + + +5. Termination +-------------- + + 5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, then + the rights granted under this License from a particular Contributor are + reinstated (a) provisionally, unless and until such Contributor explicitly and + finally terminates Your grants, and (b) on an ongoing basis, if such + Contributor fails to notify You of the non-compliance by some reasonable means + prior to 60 days after You have come back into compliance. Moreover, Your + grants from a particular Contributor are reinstated on an ongoing basis if such + Contributor notifies You of the non-compliance by some reasonable means, this + is the first time You have received notice of non-compliance with this License + from such Contributor, and You become compliant prior to 30 days after Your + receipt of the notice. + + 5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, and + cross-claims) alleging that a Contributor Version directly or indirectly + infringes any patent, then the rights granted to You by any and all + Contributors for the Covered Software under Section 2.1 of this License shall + terminate. + + 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + + +6. Disclaimer of Warranty +------------------------- + +Covered Software is provided under this License on an "as is" basis, without +warranty of any kind, either expressed, implied, or statutory, including, without +limitation, warranties that the Covered Software is free of defects, +merchantable, fit for a particular purpose or non-infringing. The entire risk as +to the quality and performance of the Covered Software is with You. Should any +Covered Software prove defective in any respect, You (not any Contributor) assume +the cost of any necessary servicing, repair, or correction. This disclaimer of +warranty constitutes an essential part of this License. No use of any Covered +Software is authorized under this License except under this disclaimer. + + +7. Limitation of Liability +-------------------------- + +Under no circumstances and under no legal theory, whether tort (including +negligence), contract, or otherwise, shall any Contributor, or anyone who +distributes Covered Software as permitted above, be liable to You for any direct, +indirect, special, incidental, or consequential damages of any character +including, without limitation, damages for lost profits, loss of goodwill, work +stoppage, computer failure or malfunction, or any and all other commercial +damages or losses, even if such party shall have been informed of the possibility +of such damages. This limitation of liability shall not apply to liability for +death or personal injury resulting from such party's negligence to the extent +applicable law prohibits such limitation. Some jurisdictions do not allow the +exclusion or limitation of incidental or consequential damages, so this exclusion +and limitation may not apply to You. + + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the courts of a +jurisdiction where the defendant maintains its principal place of business and +such litigation shall be governed by laws of that jurisdiction, without reference +to its conflict-of-law provisions. Nothing in this Section shall prevent a +party's ability to bring cross-claims or counter-claims. + + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject matter +hereof. If any provision of this License is held to be unenforceable, such +provision shall be reformed only to the extent necessary to make it enforceable. +Any law or regulation which provides that the language of a contract shall be +construed against the drafter shall not be used to construe this License against +a Contributor. + + +10. Versions of the License +--------------------------- + + + 10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section 10.3, + no one other than the license steward has the right to modify or publish new + versions of this License. Each version will be given a distinguishing version + number. + + + 10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of the + License under which You originally received the Covered Software, or under the + terms of any subsequent version published by the license steward. + + + 10.3. Modified Versions + + If you create software not governed by this License, and you want to create a + new license for such software, you may create and use a modified version of + this License if you rename the license and remove any references to the name of + the license steward (except to note that such modified license differs from + this License). + + + 10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses + + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the notice + described in Exhibit B of this License must be attached. + + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public License, + v. 2.0. If a copy of the MPL was not distributed with this file, You can + obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as defined + by the Mozilla Public License, v. 2.0. + +------------------------------------------------------------------------------- +| libzstd-dev 1.5.4 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Meta Platforms, Inc. and affiliates. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| libzstd-dev 1.5.5 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| roboticstoolbox-python 1.0.2 (used under MIT License) https://github.com/petercorke/robotics-toolbox-python +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License +=============== + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| zstd 1.5.5 (used under BSD 3-clause "New" or "Revised" License) http://www.zstd.net +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Martin Liska, SUSE, Meta Platforms, Inc. and affiliates. +Copyright (C) 2012-2016 Yann Collet. +Copyright (c) Yann Collet, Meta Platforms, Inc. and affiliates. +Copyright 2020 Jan Tojnar. +Copyright (c) 1995-2006, 2010-2011 Jean-loup Gailly. +Copyright (c) 2018-present lzutao +Copyright (C) 2004-2017 Mark Adler. +Copyright (c) 2003-2008 Yuta Mori. All Rights Reserved. +Copyright (c) Meta Platforms, Inc. and affiliates. You can contact the author at : and affiliates and affiliates. All Rights Reserved. +Copyright (C) 1989, 1991, 2000-2016 Free Software Foundation, Inc. +Copyright (c) 2016 Tino Reichardt. All Rights Reserved. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +Generated on Fri, 28 Jul 2023 15:38:21 +0200 using Black Duck 2023.4.2. \ No newline at end of file diff --git a/czishrink/libczicompressc/libczicompressc.nuspec b/czishrink/libczicompressc/libczicompressc.nuspec new file mode 100644 index 0000000..59332d2 --- /dev/null +++ b/czishrink/libczicompressc/libczicompressc.nuspec @@ -0,0 +1,16 @@ + + + + libczicompressc + 0.5.1-alpha.0 + Native runtimes for CZI ZStd compression + Carl Zeiss Microscopy + Carl Zeiss Microscopy + Native runtimes for CZI ZStd compression + false + MIT + https://github.com/zeissmicroscopy/czicompress/ + © Carl Zeiss Microscopy GmbH and others. All rights reserved. + + + \ No newline at end of file diff --git a/czishrink/libczicompressc/runtimes/linux-x64/native/libczicompressc.so b/czishrink/libczicompressc/runtimes/linux-x64/native/libczicompressc.so new file mode 100644 index 0000000..e69de29 diff --git a/czishrink/libczicompressc/runtimes/win-x64/native/libczicompressc.dll b/czishrink/libczicompressc/runtimes/win-x64/native/libczicompressc.dll new file mode 100644 index 0000000..e69de29 diff --git a/czishrink/netczicompress.Desktop/Program.cs b/czishrink/netczicompress.Desktop/Program.cs new file mode 100644 index 0000000..0af9f69 --- /dev/null +++ b/czishrink/netczicompress.Desktop/Program.cs @@ -0,0 +1,75 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Desktop; + +using System; +using System.Diagnostics; +using Avalonia; +using Avalonia.ReactiveUI; +using Projektanker.Icons.Avalonia; +using Projektanker.Icons.Avalonia.FontAwesome; + +internal class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) + { + // NOTE: when in use, a GUID will be prepended to the filename. + using TextWriterTraceListener listener = CreateTraceListener(); + Trace.Listeners.Add(listener); + Trace.AutoFlush = true; + + try + { + BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); + } + finally + { + Trace.Flush(); + Trace.Listeners.Remove(listener); + } + } + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + { + IconProvider.Current + .Register(); + + return AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(level: Avalonia.Logging.LogEventLevel.Error) + .UseReactiveUI(); + } + + private static TextWriterTraceListener CreateTraceListener() + { + var progName = typeof(Program).Assembly.GetName().Name ?? "CziShrink"; + var traceLogFolder = System.IO.Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), + progName); + if (!Directory.Exists(traceLogFolder)) + { + try + { + Directory.CreateDirectory(traceLogFolder); + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + } + } + + var traceLogFile = System.IO.Path.Combine( + traceLogFolder, + $"{progName}.log"); + var listener = new TextWriterTraceListener(traceLogFile, "logFileListener"); + return listener; + } +} diff --git a/czishrink/netczicompress.Desktop/app.manifest b/czishrink/netczicompress.Desktop/app.manifest new file mode 100644 index 0000000..515802e --- /dev/null +++ b/czishrink/netczicompress.Desktop/app.manifest @@ -0,0 +1,25 @@ + + + + + + + + true + + + + + + + + + + + + + diff --git a/czishrink/netczicompress.Desktop/netczicompress.Desktop.csproj b/czishrink/netczicompress.Desktop/netczicompress.Desktop.csproj new file mode 100644 index 0000000..c863f1e --- /dev/null +++ b/czishrink/netczicompress.Desktop/netczicompress.Desktop.csproj @@ -0,0 +1,27 @@ + + + WinExe + true + app.manifest + ..\netczicompress\Assets\netczicompress.ico + CziShrink + x64 + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + diff --git a/czishrink/netczicompress.sln b/czishrink/netczicompress.sln new file mode 100644 index 0000000..f915d18 --- /dev/null +++ b/czishrink/netczicompress.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33829.357 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "netczicompress", "netczicompress\netczicompress.csproj", "{886596AD-1451-4567-AC42-76182C9C187B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "netczicompress.Desktop", "netczicompress.Desktop\netczicompress.Desktop.csproj", "{433ABC81-4FAA-4328-9832-4416644391D5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "netczicompressTests", "netczicompressTests\netczicompressTests.csproj", "{8B1A7EB0-48FE-4DF3-B23A-46F520565052}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {886596AD-1451-4567-AC42-76182C9C187B}.Debug|x64.ActiveCfg = Debug|x64 + {886596AD-1451-4567-AC42-76182C9C187B}.Debug|x64.Build.0 = Debug|x64 + {886596AD-1451-4567-AC42-76182C9C187B}.Release|x64.ActiveCfg = Release|x64 + {886596AD-1451-4567-AC42-76182C9C187B}.Release|x64.Build.0 = Release|x64 + {433ABC81-4FAA-4328-9832-4416644391D5}.Debug|x64.ActiveCfg = Debug|x64 + {433ABC81-4FAA-4328-9832-4416644391D5}.Debug|x64.Build.0 = Debug|x64 + {433ABC81-4FAA-4328-9832-4416644391D5}.Release|x64.ActiveCfg = Release|x64 + {433ABC81-4FAA-4328-9832-4416644391D5}.Release|x64.Build.0 = Release|x64 + {8B1A7EB0-48FE-4DF3-B23A-46F520565052}.Debug|x64.ActiveCfg = Debug|x64 + {8B1A7EB0-48FE-4DF3-B23A-46F520565052}.Debug|x64.Build.0 = Debug|x64 + {8B1A7EB0-48FE-4DF3-B23A-46F520565052}.Release|x64.ActiveCfg = Release|x64 + {8B1A7EB0-48FE-4DF3-B23A-46F520565052}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {071D0ED6-64D2-4792-BF50-FA6C27898722} + EndGlobalSection +EndGlobal diff --git a/czishrink/netczicompress/App.axaml b/czishrink/netczicompress/App.axaml new file mode 100644 index 0000000..bbd6f42 --- /dev/null +++ b/czishrink/netczicompress/App.axaml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/App.axaml.cs b/czishrink/netczicompress/App.axaml.cs new file mode 100644 index 0000000..cb2d191 --- /dev/null +++ b/czishrink/netczicompress/App.axaml.cs @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress; + +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +/// +/// The application. +/// +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (this.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = AppComposer.ComposeMainWindow(); + } + else if (this.ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) + { + singleViewPlatform.MainView = AppComposer.ComposeMainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } +} diff --git a/czishrink/netczicompress/AppComposer.cs b/czishrink/netczicompress/AppComposer.cs new file mode 100644 index 0000000..b91ae05 --- /dev/null +++ b/czishrink/netczicompress/AppComposer.cs @@ -0,0 +1,99 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress; + +using System.IO.Abstractions; + +using Microsoft.Extensions.Logging; + +using netczicompress.Models; +using netczicompress.Models.Clipboard; +using netczicompress.ViewModels; +using netczicompress.Views; + +using ReactiveUI; + +/// +/// Composes the application with 'Pure DI'. +/// +public class AppComposer +{ + public static MainWindow ComposeMainWindow() + { + var info = new ProgramNameAndVersion(); + var mainViewModel = ComposeMainViewModel(info); + + return new MainWindow + { + DataContext = mainViewModel, + Title = info.Name, + }; + } + + public static MainViewModel ComposeMainViewModel(IProgramNameAndVersion info) + { + // Parameters that we might have to tweak + const int MaxNumberOfErrorsToShow = 1000; + const int ErrorBufferSize = 100; + var errorBufferInterval = TimeSpan.FromSeconds(1); + + var statisticsReportingInterval = TimeSpan.FromSeconds(1); + + // Actual composition code + var fs = new FileSystem(); + string libraryNameAndVersion = PInvokeFileProcessor.GetLibFullName(); + + ILoggerFactory loggerfactory = new TraceLoggerFactory(); + var logger = loggerfactory.CreateLogger(); + logger.LogInformation("Starting {CZI Shrink} using {libczicompressc}", info, libraryNameAndVersion); + + var noOp = new NoOpFileProcessor(); + IFileProcessor CreateFileProcessor(CompressionMode mode, ProcessingOptions options) => mode switch + { + CompressionMode.NoOp => noOp, + _ => PInvokeFileProcessor.Create(mode, options), + }; + IFolderCompressor compressor = new MultiThreadedFolderCompressor(CreateFileProcessor, new FileProcessingFailedHandler()); + + IFileLauncher fileLauncher = new FileLauncher(fs, Environment.GetEnvironmentVariable); + var gui = RxApp.MainThreadScheduler; + var errorList = new ErrorListViewModel( + maxNumberOfErrorsToShow: MaxNumberOfErrorsToShow, + bufferInterval: errorBufferInterval, + bufferCapacity: ErrorBufferSize, + scheduler: gui, + launcher: fileLauncher); + var currentTasks = new CurrentTasksViewModel(scheduler: gui); + var logViewModel = new LogFileViewModel(new CsvLoggingStrategy(fileLauncher), gui); + + var aggregateIndicationViewModel = new AggregateIndicationViewModel(); + var aggregateStatisticsViewModel = new AggregateStatisticsViewModel( + aggregateIndicationViewModel: aggregateIndicationViewModel, + ClipboardHelper.Instance, + logger: loggerfactory.CreateLogger()) + { + OpenLogFileCommand = logViewModel.OpenLogFileCommand, + }; + + var statisticsObserver = CompositeObserver.Create(aggregateStatisticsViewModel, aggregateIndicationViewModel); + var statisticsRunObserver = new StatisticsRunObserver(statisticsObserver, statisticsReportingInterval, gui); + + compressor = compressor.DecorateWithRunObserver(statisticsRunObserver); + compressor = compressor.DecorateWithRunObserver(logViewModel); + compressor = compressor.DecorateWithRunObserver(errorList); + compressor = compressor.DecorateWithObserver(currentTasks, gui); + + var mainViewModel = new MainViewModel( + compressor: compressor, + fileSystem: fs, + errorList: errorList, + currentTasksViewModel: currentTasks, + aggregateStatisticsViewModel: aggregateStatisticsViewModel, + aboutViewModel: new AboutViewModel(fileLauncher, info) { LibraryName = libraryNameAndVersion }, + logger: loggerfactory.CreateLogger()); + + return mainViewModel; + } +} diff --git a/czishrink/netczicompress/Assets/Logo.png b/czishrink/netczicompress/Assets/Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..cb975df3ae8ac794a7d9d8040ef4d6df5c32c5c9 GIT binary patch literal 15845 zcmZv@2RPP!_%{Bv$=)j~qEc2uR#vEptdvdJdu6+AGE0)Z$`&Fkn~<&Skxe$q9{sQT z={=6$?|;1Sa~vJ+=l1!2zMpZ8^E|IhnCe3X;tLEH5CkEgdv|4p_-_jd-4Nj6M-auZ6!jO{u?IAg z(+AHX}G4Y$R^8V&S!6rt&NS7k(1ixs-P`WasQ-kzCbn`^c%l`*2dN@hy1 za49)HiJek$8B3{`2tgQ*2Aa-A?!+uFEzB;NE?aN?`I>odwQYAvl5J=Dyfy+88zFnx zw>56CxHybu-;Pn@(qNURgN$n-=F>-dHzx?vpI+$qI0|Uv-DYv^CUHaPL_#QJ)#`2Y(BKz+fj#RfJb)}ADCOTLJUY@?JRp5W)_vsPVAf}5{buJ6T z%eHi<0cSx{J=EJws{w{`W(ib9X3oHaUoOsw_sb{~)Brz;X~dY3ZbZmk!!T_I&UPA; zMeSQ!(YH*Pw1r)%85>iLw(vPH!%>v$`1*ll&DQ=gF$&sB+OoNq*V)S{YVaQu1O)Oo zb6twfRVlyhL2=aTW-MA7qb*;^xyi=NmU>yAi-gi3R*{3`+v|mg7uYVx2;3vQXQeoy zc;mhLd&%!)7RgGSYcV$8elFmDLKU*czp9KOjZt}h@~vf|l1lVz=$sNkCWqSlHx&18 zJ-@Sv{UJ?2CLullQBPj#Abx(RXxh_zHtDXayy_u&l!7jamwS?EWV_zq$QtTTv@o+c zFy~!yt|6ETV7?pQAOGFz7v9S9O2D5NM8v_w0qu&$SLm(iJ?V4kD(QI>l(KPt#3yuU z@QnyCCYZe=eP^eseQp1m7xk-7ia60YtvH{!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gOun=*h*#w6( zx|vj#NFDtsG?TXWXa9Q?J!6K=zemwcq%sr#9_4{u2GZfql-W?$;K3NSYJs$Zk7xZb&sPs%c-oTuSdcICnJ8jTD)^dIxR zxk@0@tcuBsPasQxV&(X+DVgsLg8zSi`Ipr9^W@|E8k=zdcaVE`AIg1{G4#LW4{{OJ z$M_>G7d%Sj2FdfyUEsx6A%Or0e7sD^`Z8D*t3*`a4Eq`*P=6;H9$iJKQg|+UZvSP* z;rE>xYQmNxlubDC0wIzCSlHLLwwFFUt$av%Bj{MGFlkPk;AqU}p(YJt7stBohW*+q z2pJWPt2e`RNnjB2Xxr(KypGfVff(ScaXKSH%(Nay|g{8DIug zzJGms%tWGOLB+e4lyPz;li3=Z)dyxILybJ_(Nq9))CzegpZ;m*bkGE$qNB@wXq zM)K*du=YOH99Vk_(FUATY6gLN6usX#{E2~tY|6j!`Y@h+Rp`I*`^~Ud)k+L);+vSC zX*m&(Ku)5@=l2Iu^Gzr1 zcT=)QDg3VMbom=wG&D=)rahLIE_t2qXv~QW9^Zc3<@m&Q!^p}?7Q_~>*|IWI?}q{j z88SyNhZ&jb@`oF^o$WspKv{?XY`f((?YX4SsYnn*kK+@buFHbvhSF=pXHVCb&v(;S zTwaC>?7h5(2qdsUyX53kLIAp>R*e6KDt>tVcuBL}bBow}v4LBs*c_8J?!Ng_cc1>m zHc0hD$6M$vOqxB4FCinho$Pppi}TrI#mQ@x`Ys|uBIvUEMwBr%%{QEoaBZh~xm@C4 zxJW$3>ZX|fl=x4Y8<MGHFTR>V3 z$VZgs;zhYwPVZc29`cL_@x6jjt@ybIF;Bgy`U3SQP<3m(#nR?~Y$qpM2L+45W`++Y zL5lW(vgP)w!sB9n_i($qd-uYeR|i=%CK?>%I{TOm`RMin{$jO;ezZ Dc0wBS literal 0 HcmV?d00001 diff --git a/czishrink/netczicompress/Assets/netczicompress.ico b/czishrink/netczicompress/Assets/netczicompress.ico new file mode 100644 index 0000000000000000000000000000000000000000..b0c83d01247e53566a1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G^I(t8RnCd2eQWadY}oo)V%f)bZ;;ZuCO-tovEJ7C1S!g&hUFAo2)sN1vguBFlj{qhHg%;2q%6 zSnsfgz+Mqq9&$YD&v(ZDL-_@6K?BeU!*^0=?EhFdgG1t|Kp!x!6L^QL2%cG`PhX@j ztNu^=#D{NV9789~>p{|G+%evedoa$7`KbJ%JJgHuCT$x^AJlvEm2{z#*fp|-VlAIO zeR@3~^xU@AJ><(eP_7Qshd#4Dq`c5Q`XqK0l5m9_M9(NR7Z+0t`abB1|mh^wB< zBVBiuU#{>V-wMnWm>>XuGD%=c$aR)nX9zAQZr;3kdT?;?x1z_J9P;j4xlR{=zvKF? z0C9QWMEC)(2KX>h59vCiP(CcKO+E}BbhRxIJCN1F6R#Fo=4$B=>YFw4?MeX*o(2i@ z5wIDMU7$~}vuAakMC@&j44q~FCF2|2GV6Yx*^t$)wG|)Q08K=Of-Dc)9(XY5p$d#= zp^bWc(q@iD{t7)(bO)M&41@m3{7T@;dt@aNM~{y^8uD4}Gr8x=+8tXe=p{f~!22N= zhA)605qh~+=vQy}5;d;K0~*EL%lJlK0$pWocs@i20zU!G6kcYntlN9DW>#e;z6y*_ z + + \ No newline at end of file diff --git a/czishrink/netczicompress/Models/AggregateStatistics.cs b/czishrink/netczicompress/Models/AggregateStatistics.cs new file mode 100644 index 0000000..2816af5 --- /dev/null +++ b/czishrink/netczicompress/Models/AggregateStatistics.cs @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; + +/// +/// Cumulative statistics of a compression or decompression operation. +/// +public readonly record struct AggregateStatistics +{ + public static AggregateStatistics Empty { get; } = default; + + public int FilesWithErrors { get; init; } + + public int FilesWithNoErrors { get; init; } + + public TimeSpan Duration { get; init; } + + public long InputBytes { get; init; } + + public long OutputBytes { get; init; } + + public long DeltaBytes => this.OutputBytes - this.InputBytes; + + public float OutputToInputRatio => 1.0f * this.OutputBytes / this.InputBytes; +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/AsyncEnumerableToObservableActionAdapter.cs b/czishrink/netczicompress/Models/AsyncEnumerableToObservableActionAdapter.cs new file mode 100644 index 0000000..b9bd242 --- /dev/null +++ b/czishrink/netczicompress/Models/AsyncEnumerableToObservableActionAdapter.cs @@ -0,0 +1,70 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Collections.Generic; +using System.Reactive.Concurrency; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Threading; +using System.Threading.Tasks; + +/// +/// An adapter from an to an . +/// +/// The type of the produced items. +public class AsyncEnumerableToObservableActionAdapter : IObservableAction +{ + private readonly IAsyncEnumerable enumerable; + private readonly CancellationToken token; + private readonly Subject subject = new(); + private bool started; + + public AsyncEnumerableToObservableActionAdapter(IAsyncEnumerable enumerable, CancellationToken token) + { + this.enumerable = enumerable; + this.token = token; + this.Output = this.subject.AsObservable(); + } + + /// + /// + /// This observable may deliver items on another thread than the thread that calls . + /// + /// Use an appropriate to observe it. + /// + public IObservable Output { get; } + + /// + public void Start() + { + if (this.started) + { + throw new InvalidOperationException($"{nameof(this.Start)} can only be called once."); + } + + this.started = true; + + Core(); + + async void Core() + { + try + { + await foreach (var item in this.enumerable.WithCancellation(this.token).ConfigureAwait(false)) + { + this.subject.OnNext(item); + } + + this.subject.OnCompleted(); + } + catch (Exception ex) + { + this.subject.OnError(ex); + } + } + } +} diff --git a/czishrink/netczicompress/Models/Clipboard/ClipboardHelper.cs b/czishrink/netczicompress/Models/Clipboard/ClipboardHelper.cs new file mode 100644 index 0000000..698a0ed --- /dev/null +++ b/czishrink/netczicompress/Models/Clipboard/ClipboardHelper.cs @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models.Clipboard; + +using System.Runtime.InteropServices; + +internal static class ClipboardHelper +{ + private static readonly IClipboardHelper? InstanceValue; + + static ClipboardHelper() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + InstanceValue = new ClipboardHelperWin32(); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + InstanceValue = new ClipboardHelperLinux(); + } + } + + public static IClipboardHelper? Instance + { + get + { + return InstanceValue; + } + } +} diff --git a/czishrink/netczicompress/Models/Clipboard/ClipboardHelperLinux.cs b/czishrink/netczicompress/Models/Clipboard/ClipboardHelperLinux.cs new file mode 100644 index 0000000..039e265 --- /dev/null +++ b/czishrink/netczicompress/Models/Clipboard/ClipboardHelperLinux.cs @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models.Clipboard; + +using System.Diagnostics; +using Avalonia.Media.Imaging; + +/// +/// This is an implementation of the IClipboardHelper interface for the X-Windows system. We use the +/// utility "xclip" as an external program which we launch and pass to it the bitmap as a PNG. +/// +internal class ClipboardHelperLinux : IClipboardHelper +{ + public void PutBitmapIntoClipboard(Bitmap bitmap) + { + if (bitmap == null) + { + throw new ArgumentNullException(nameof(bitmap)); + } + + using (var memoryStream = new MemoryStream()) + { + bitmap.Save(memoryStream); + memoryStream.Position = 0; + ClipboardHelperLinux.SetImageToClipboard(memoryStream, "image/png"); + } + } + + private static void SetImageToClipboard(Stream imageData, string mimeType) + { + var startInfo = new ProcessStartInfo + { + FileName = "xclip", + ArgumentList = + { + "-selection", "clipboard", + "-t", mimeType, + "-i", + }, + RedirectStandardInput = true, + UseShellExecute = false, + CreateNoWindow = true, + }; + + using (var process = new Process { StartInfo = startInfo }) + { + process.Start(); + + // the png is now written to stdout + imageData.CopyTo(process.StandardInput.BaseStream); + + // then we close stdout, and xclip will start operation + process.StandardInput.Close(); + process.WaitForExit(); + } + } +} diff --git a/czishrink/netczicompress/Models/Clipboard/ClipboardHelperWin32.cs b/czishrink/netczicompress/Models/Clipboard/ClipboardHelperWin32.cs new file mode 100644 index 0000000..b2ad876 --- /dev/null +++ b/czishrink/netczicompress/Models/Clipboard/ClipboardHelperWin32.cs @@ -0,0 +1,331 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models.Clipboard; + +using System.Runtime.InteropServices; +using Avalonia; +using Avalonia.Media.Imaging; +using Avalonia.Platform; + +/// +/// An implementation of the IClipboardHelper interface based on Win32-API. +/// Obviously, this code is only operational if running on Win32 - which is not +/// checked here (i.e. it is assumed that platform specific dispatching is taking +/// place before using this code). +/// +internal partial class ClipboardHelperWin32 : IClipboardHelper +{ + public void PutBitmapIntoClipboard(Bitmap bitmap) + { + if (bitmap == null) + { + throw new ArgumentNullException(nameof(bitmap)); + } + + if (bitmap.Format != PixelFormat.Bgra8888) + { + throw new ArgumentException("Bitmap is expected to be in PixelFormat.Bgra8888, conversion is not implemented"); + } + + nint hBitmap = 0; + nint screenDC = 0; + nint sourceDC = 0; + nint destDC = 0; + nint compatibleBitmap = 0; + bool clipboardOpened = false; + + try + { + hBitmap = ClipboardHelperWin32.CreateHBitmapFromAvalonBitmap(bitmap); + + screenDC = Win32UnmanagedMethods.GetDC(IntPtr.Zero); + if (screenDC == 0) + { + throw new Exception("Error creating screenDC"); + } + + sourceDC = Win32UnmanagedMethods.CreateCompatibleDC(screenDC); + if (sourceDC == 0) + { + throw new Exception("Error creating sourceDC"); + } + + Win32UnmanagedMethods.SelectObject(sourceDC, hBitmap); + + destDC = Win32UnmanagedMethods.CreateCompatibleDC(screenDC); + if (destDC == 0) + { + throw new Exception("Error creating destDC"); + } + + compatibleBitmap = Win32UnmanagedMethods.CreateCompatibleBitmap(screenDC, bitmap.PixelSize.Width, bitmap.PixelSize.Height); + if (compatibleBitmap == 0) + { + throw new Exception("Error creating compatibleBitmap"); + } + + Win32UnmanagedMethods.SelectObject(destDC, compatibleBitmap); + Win32UnmanagedMethods.BitBlt( + destDC, + 0, + 0, + bitmap.PixelSize.Width, + bitmap.PixelSize.Height, + sourceDC, + 0, + 0, + 0x00CC0020); // SRCCOPY + + if (!Win32UnmanagedMethods.OpenClipboard(IntPtr.Zero)) + { + throw new Exception("Error opening the clipboard"); + } + + clipboardOpened = true; + + Win32UnmanagedMethods.EmptyClipboard(); + Win32UnmanagedMethods.SetClipboardData(Win32UnmanagedMethods.ClipboardFormat.CF_BITMAP, compatibleBitmap); + } + finally + { + if (clipboardOpened) + { + Win32UnmanagedMethods.CloseClipboard(); + } + + bool success = false; + if (hBitmap != 0) + { + success = Win32UnmanagedMethods.DeleteObject(hBitmap); + } + + if (compatibleBitmap != 0) + { + success = Win32UnmanagedMethods.DeleteObject(compatibleBitmap); + } + + if (sourceDC != 0) + { + success = Win32UnmanagedMethods.DeleteDC(sourceDC); + } + + if (screenDC != 0) + { + success = Win32UnmanagedMethods.ReleaseDC(IntPtr.Zero, screenDC); + } + + if (destDC != 0) + { + success = Win32UnmanagedMethods.DeleteDC(destDC); + } + + _ = success; + } + } + + private static unsafe nint CreateHBitmapFromAvalonBitmap(Bitmap bitmap) + { + if (bitmap.Format != PixelFormat.Bgra8888) + { + throw new ArgumentException("Bitmap is expected to be in PixelFormat.Bgra8888, conversion is not implemented"); + } + + byte[] buffer = new byte[bitmap.PixelSize.Width * bitmap.PixelSize.Height * 4]; + fixed (byte* p = &buffer[0]) + { + // copy the content of the Avalonia-bitmap into the buffer + bitmap.CopyPixels(new PixelRect(bitmap.PixelSize), new IntPtr(p), buffer.Length, bitmap.PixelSize.Width * 4); + + // now, we allocate an "HBITMAP"-object and copy the data into it + Win32UnmanagedMethods.BITMAPINFO bmi = default; + bmi.bmiHeader.Init(); + bmi.bmiHeader.biWidth = bitmap.PixelSize.Width; + bmi.bmiHeader.biHeight = -bitmap.PixelSize.Height; // top-down + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biBitCount = 32; + bmi.bmiHeader.biCompression = Win32UnmanagedMethods.BitmapCompressionMode.BI_RGB; + IntPtr ptr = IntPtr.Zero; + nint hBitmap = Win32UnmanagedMethods.CreateDIBSection( + IntPtr.Zero, + ref bmi, + 0, /*DIB_RGB_COLORS*/ + out ptr, + IntPtr.Zero, + 0); + if (hBitmap == 0) + { + throw new Exception("CreateDIBSection failed."); + } + + int r = Win32UnmanagedMethods.SetDIBits( + IntPtr.Zero, + hBitmap, + 0, + (uint)bitmap.PixelSize.Height, + new IntPtr(p), + ref bmi, + 0); /*DIB_RGB_COLORS*/ + + if (r == 0) + { + Win32UnmanagedMethods.DeleteObject(hBitmap); + throw new Exception("SetDIBits failed."); + } + + return hBitmap; + } + } +} + +/// +/// This part contains the PInvoke definitions we need in order to "put the bitmap into the clipboard" +/// with the Win32-API. +/// +internal partial class ClipboardHelperWin32 +{ + private class Win32UnmanagedMethods + { + public enum BitmapCompressionMode : uint + { + BI_RGB = 0, + BI_RLE8 = 1, + BI_RLE4 = 2, + BI_BITFIELDS = 3, + BI_JPEG = 4, + BI_PNG = 5, + } + + public enum ClipboardFormat + { + /// + /// Text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. Use this format for ANSI text. + /// + CF_TEXT = 1, + + /// + /// A handle to a bitmap. + /// + CF_BITMAP = 2, + + /// + /// A memory object containing a BITMAPINFO structure followed by the bitmap bits. + /// + CF_DIB = 3, + + /// + /// Unicode text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. + /// + CF_UNICODETEXT = 13, + + /// + /// A handle to type HDROP that identifies a list of files. + /// + CF_HDROP = 15, + } + + [DllImport("gdi32.dll")] + public static extern IntPtr CreateDIBSection(IntPtr hdc, [In] ref BITMAPINFO pbmi, uint pila, out IntPtr ppvBits, IntPtr hSection, uint dwOffset); + + [DllImport("gdi32.dll")] + public static extern int SetDIBits(IntPtr hdc, nint hbm, uint start, uint cLines, IntPtr lpBits, [In] ref BITMAPINFO pbmi, uint colorUse); + + [DllImport("user32.dll", ExactSpelling = true)] + public static extern IntPtr GetDC(IntPtr hWnd); + + [DllImport("gdi32.dll", EntryPoint = "DeleteDC")] + public static extern bool DeleteDC([In] IntPtr hdc); + + [DllImport("gdi32.dll", ExactSpelling = true)] + public static extern IntPtr CreateCompatibleDC(IntPtr hDC); + + [DllImport("gdi32.dll", SetLastError = true, ExactSpelling = true)] + public static extern IntPtr SelectObject(IntPtr hdc, IntPtr h); + + [DllImport("gdi32.dll", SetLastError = true, ExactSpelling = true)] + public static extern bool BitBlt( + IntPtr hdc, + int x, + int y, + int cx, + int cy, + IntPtr hdcSrc, + int x1, + int y1, + uint rop); + + [DllImport("gdi32.dll", ExactSpelling = true)] + public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int cx, int cy); + + [DllImport("user32.dll", SetLastError = true)] + public static extern bool OpenClipboard(IntPtr hWndOwner); + + [DllImport("user32.dll")] + public static extern bool EmptyClipboard(); + + [DllImport("user32.dll")] + public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); + + [DllImport("user32.dll")] + public static extern IntPtr SetClipboardData(ClipboardFormat uFormat, IntPtr hMem); + + [DllImport("user32.dll", SetLastError = true)] + public static extern bool CloseClipboard(); + + [DllImport("gdi32.dll", EntryPoint = "DeleteObject")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DeleteObject([In] IntPtr hObject); + + [StructLayout(LayoutKind.Sequential)] + public struct BITMAPINFOHEADER + { +#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter + public uint biSize; + public int biWidth; + public int biHeight; + public ushort biPlanes; + public ushort biBitCount; + public BitmapCompressionMode biCompression; + public uint biSizeImage; + public int biXPelsPerMeter; + public int biYPelsPerMeter; + public uint biClrUsed; + public uint biClrImportant; +#pragma warning restore SA1307 // Accessible fields should begin with upper-case letter + + public void Init() + { + this.biSize = (uint)Marshal.SizeOf(this); + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct RGBQUAD + { +#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter + public byte rgbBlue; + public byte rgbGreen; + public byte rgbRed; + public byte rgbReserved; +#pragma warning restore SA1307 // Accessible fields should begin with upper-case letter + } + + [StructLayoutAttribute(LayoutKind.Sequential)] + public struct BITMAPINFO + { +#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter + /// + /// A BITMAPINFOHEADER structure that contains information about the dimensions of color format. + /// + public BITMAPINFOHEADER bmiHeader; + + /// + /// An array of RGBQUAD. The elements of the array that make up the color table. + /// + [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 1, ArraySubType = UnmanagedType.Struct)] + public RGBQUAD[] bmiColors; +#pragma warning restore SA1307 // Accessible fields should begin with upper-case letter + } + } +} diff --git a/czishrink/netczicompress/Models/Clipboard/IClipboardHelper.cs b/czishrink/netczicompress/Models/Clipboard/IClipboardHelper.cs new file mode 100644 index 0000000..3377885 --- /dev/null +++ b/czishrink/netczicompress/Models/Clipboard/IClipboardHelper.cs @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models.Clipboard; + +using Avalonia.Media.Imaging; + +/// +/// Interface for utilities for interacting with the clipboard. +/// Unfortunately, the platform agnostic support in Avalonia is quite limited at this time, +/// so the idea here is to provide just enough functionality with platform specific implementations. +/// +public interface IClipboardHelper +{ + /// + /// Puts the specified bitmap into the system clipboard. It is a simplistic implementation, + /// the data is copied right away, meaning that the bitmap should not be large in size, a couple of + /// kilobytes is fine. Also, the pixel format of the bitmap must be PixelFormat.Bgra8888, there is + /// no conversion in place currently. + /// + /// The bitmap to put on the clipboard. + void PutBitmapIntoClipboard(Bitmap bitmap); +} diff --git a/czishrink/netczicompress/Models/CompositeObserver.cs b/czishrink/netczicompress/Models/CompositeObserver.cs new file mode 100644 index 0000000..1078ab5 --- /dev/null +++ b/czishrink/netczicompress/Models/CompositeObserver.cs @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; + +/// +/// Static class to create composite observers. +/// +public static class CompositeObserver +{ + public static IObserver Create(params IObserver[] observers) + { + return new CompositeObserverImpl(observers); + } + + /// + /// A composite . + /// + /// The observed type. + public sealed class CompositeObserverImpl : IObserver + { + private readonly IObserver[] observers; + + public CompositeObserverImpl(params IObserver[] observers) + { + this.observers = observers; + } + + public void OnCompleted() + { + this.ForEachObserver(o => o.OnCompleted()); + } + + public void OnError(Exception error) + { + this.ForEachObserver(o => o.OnError(error)); + } + + public void OnNext(T value) + { + this.ForEachObserver(o => o.OnNext(value)); + } + + private void ForEachObserver(Action> action) + { + foreach (var item in this.observers) + { + action(item); + } + } + } +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/CompressionLevel.cs b/czishrink/netczicompress/Models/CompressionLevel.cs new file mode 100644 index 0000000..4bf99cb --- /dev/null +++ b/czishrink/netczicompress/Models/CompressionLevel.cs @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System.ComponentModel.DataAnnotations; + +/// +/// Defines Zstd compression levels. +/// +public record CompressionLevel +{ + private readonly int internalValue = DefaultValue; + + public static readonly CompressionLevel Default; + + static CompressionLevel() + { + Default = new CompressionLevel() { Value = DefaultValue }; + } + + /// + /// Gets the minimum allowed compression level. + /// + /// In this application the value is 0, though Zstd would allow values down to -131072. + public static int Minimum { get; } = 0; + + /// + /// Gets maximum allowed compression level. + /// + /// The value of this property is 22. + public static int Maximum { get; } = 22; + + /// + /// Gets default compression level if not specified. + /// + /// The value of this property is 1. + public static int DefaultValue { get; } = 1; + + [Range(0, 22)] + public int Value + { + get => this.internalValue; + init => + this.internalValue = value > Maximum || value < Minimum + ? throw new ArgumentOutOfRangeException( + paramName: nameof(value), + message: $"{nameof(value)} must be between {Minimum} and {Maximum}, not {value}") + : value; + } +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/CompressionMode.cs b/czishrink/netczicompress/Models/CompressionMode.cs new file mode 100644 index 0000000..83fb124 --- /dev/null +++ b/czishrink/netczicompress/Models/CompressionMode.cs @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +/// +/// The compression modes supported by the application. +/// +public enum CompressionMode +{ + CompressUncompressed, + CompressAll, + CompressUncompressedAndZstd, + Decompress, + NoOp, +} diff --git a/czishrink/netczicompress/Models/CompressorMessage.cs b/czishrink/netczicompress/Models/CompressorMessage.cs new file mode 100644 index 0000000..ebb9a5b --- /dev/null +++ b/czishrink/netczicompress/Models/CompressorMessage.cs @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.IO.Abstractions; + +/// +/// A message containing information about the compression of a file. +/// This is a Union Type. +/// +public record CompressorMessage +{ + private CompressorMessage() + { + } + + /// Message emitted when we have finished processing a file. + /// The file currently being processed. + /// The input size of the file. + /// The output size of the file. + /// The time elapsed processing the file. + /// An optional error message. + public record FileFinished(IFileInfo InputFile, long SizeInput, long SizeOutput, TimeSpan? TimeElapsed, + string? ErrorMessage) + : CompressorMessage + { + public decimal SizeRatio { get; } = SizeInput != 0 ? (decimal)SizeOutput / SizeInput : 0; + + public long SizeDelta { get; } = SizeOutput - SizeInput; + } + + /// + /// Message emitted when we start processing a file. + /// + /// The input file. + /// An observable that reports the progress in percent. + public record FileStarting(IFileInfo InputFile, IObservable ProgressPercent) + : CompressorMessage; +} diff --git a/czishrink/netczicompress/Models/CreateProcessor.cs b/czishrink/netczicompress/Models/CreateProcessor.cs new file mode 100644 index 0000000..b07f1dc --- /dev/null +++ b/czishrink/netczicompress/Models/CreateProcessor.cs @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +public delegate IFileProcessor CreateProcessor(CompressionMode mode, ProcessingOptions options); \ No newline at end of file diff --git a/czishrink/netczicompress/Models/CsvLogFileWriter.cs b/czishrink/netczicompress/Models/CsvLogFileWriter.cs new file mode 100644 index 0000000..8ce02e0 --- /dev/null +++ b/czishrink/netczicompress/Models/CsvLogFileWriter.cs @@ -0,0 +1,88 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Diagnostics; +using System.IO; + +/// +/// Writes a sequence of messages to a CSV file. +/// +public class CsvLogFileWriter : IObserver +{ + private bool isCompleted; + + public CsvLogFileWriter(TextWriter writer) + { + this.Writer = writer; + this.WriteHeader(); + } + + public TextWriter Writer { get; } + + public void OnCompleted() + { + lock (this.Writer) + { + this.isCompleted = true; + this.Writer.Flush(); + this.Writer.Close(); + } + } + + public void OnError(Exception error) + { + this.OnCompleted(); + } + + public void OnNext(CompressorMessage.FileFinished value) + { + this.Write(ToLine(value)); + } + + private static string ToLine(CompressorMessage.FileFinished value) + { + return string.Join( + ',', + Quote(value.InputFile.FullName), + value.SizeInput, + value.SizeOutput, + value.ErrorMessage == null ? value.SizeRatio : string.Empty, + value.ErrorMessage == null ? value.SizeDelta : string.Empty, + value.TimeElapsed?.ToString("c") ?? string.Empty, + value.ErrorMessage == null ? "SUCCESS" : "ERROR", + Quote(value.ErrorMessage)) + "\r\n"; + } + + private static string Quote(string? value) + { + if (value == null) + { + return string.Empty; + } + + return '"' + value.Replace("\"", "\"\"") + '"'; + } + + private void WriteHeader() + { + this.Write("InputFile,SizeInput,SizeOutput,SizeRatio,SizeDelta,TimeToProcess,Status,ErrorMessage\r\n"); + } + + private void Write(string line) + { + lock (this.Writer) + { + if (this.isCompleted) + { + Debug.WriteLine($"{nameof(CsvLogFileWriter)}: received a message after completion..."); + return; + } + + this.Writer.Write(line); + } + } +} diff --git a/czishrink/netczicompress/Models/CsvLoggingStrategy.cs b/czishrink/netczicompress/Models/CsvLoggingStrategy.cs new file mode 100644 index 0000000..feae883 --- /dev/null +++ b/czishrink/netczicompress/Models/CsvLoggingStrategy.cs @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.IO; +using System.IO.Abstractions; +using System.Reactive.Concurrency; + +/// +/// A logging strategy that writes data to a CSV log file. +/// +public class CsvLoggingStrategy : ILoggingStrategy +{ + private readonly IFileLauncher fileLauncher; + + public CsvLoggingStrategy(IFileLauncher fileLauncher) + { + this.fileLauncher = fileLauncher; + } + + /// + /// Gets the scheduler to use for logging. + /// + public IScheduler LoggerScheduler { get; init; } = DefaultScheduler.Instance; + + public IFileInfo CreateLogFile(FolderCompressorParameters run) + { + var outDir = run.OutputDir; + var fs = outDir.FileSystem; + IFileInfo result; + do + { + var outFileName = fs.Path.Combine( + outDir.FullName, + $"CziShrink_{this.LoggerScheduler.Now.ToLocalTime():yyyyMMdd'T'HHmmss}_{run.Mode}.csv"); + + result = fs.FileInfo.New(outFileName); + } + while (result.Exists); + + return result; + } + + public IObserver CreateLogger(TextWriter writer) + { + return new CsvLogFileWriter(writer); + } + + public Task OpenLogFile(IFileInfo logFile) + { + return this.fileLauncher.Launch(logFile.FullName); + } +} diff --git a/czishrink/netczicompress/Models/ExecutionOptions.cs b/czishrink/netczicompress/Models/ExecutionOptions.cs new file mode 100644 index 0000000..4c7033c --- /dev/null +++ b/czishrink/netczicompress/Models/ExecutionOptions.cs @@ -0,0 +1,11 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +/// +/// Execution options to apply to operations. +/// +/// The maximum number of threads to use. +public record ExecutionOptions(ThreadCount ThreadCount); \ No newline at end of file diff --git a/czishrink/netczicompress/Models/FileLauncher.cs b/czishrink/netczicompress/Models/FileLauncher.cs new file mode 100644 index 0000000..b9e497c --- /dev/null +++ b/czishrink/netczicompress/Models/FileLauncher.cs @@ -0,0 +1,144 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System.Diagnostics; +using System.IO.Abstractions; + +/// +/// Launches a file with its associated app, +/// or displays a file in its folder with the operating system's file manager. +/// +public class FileLauncher : IFileLauncher +{ + // Cf. https://github.com/dotnet/runtime/blob/52806bc157decf345005249c9ea7969c8b9e7e1b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs#L14C9-L41C6 + private const string Windows = "WINDOWS"; + private const string Osx = "OSX"; + private const string Linux = "LINUX"; + private const string FreeBsd = "FREEBSD"; + private const string NetBsd = "NETBSD"; + private const string Solaris = "SOLARIS"; + + private const string Unsupported = "UNSUPPORTED"; + private static readonly string[] SupportedPlatforms = + { + Windows, + Osx, + Linux, + FreeBsd, + NetBsd, + Solaris, + }; + + private readonly IFileSystem fs; + private readonly Func getEnvironmentVariable; + + public FileLauncher(IFileSystem fs, Func getEnvironmentVariable) + { + this.fs = fs; + this.getEnvironmentVariable = getEnvironmentVariable; + } + + protected string CurrentPlatform { get; init; } = GetPlatform(); + + public Task Launch(string path) + { + return this.RunAsync(GetLaunchStartInfo(path)); + } + + // Adapted from https://stackoverflow.com/a/73409251 + public async Task Reveal(string path) + { + var startInfo = this.GetRevealStartInfo(path); + var exitCode = await this.RunAsync(startInfo); + + if (exitCode != 0 && startInfo.FileName == "dbus-send") + { + // dbus-send was unsuccessful + await this.RunAsync(this.GetOpenParentFolderStartInfo(path)); + } + } + + protected virtual async Task RunAsync(ProcessStartInfo processStartInfo) + { + using var process = new Process { StartInfo = processStartInfo }; + process.Start(); + await process.WaitForExitAsync(); + return process.ExitCode; + } + + protected virtual string PathToFileUri(string path) + { + return new Uri(path).AbsoluteUri; + } + + private static string GetPlatform() + { + return SupportedPlatforms.FirstOrDefault(x => OperatingSystem.IsOSPlatform(x)) ?? Unsupported; + } + + private static ProcessStartInfo GetRevealStartInfoOsx(string path) + { + return new ProcessStartInfo + { + FileName = "explorer", + Arguments = $"-R \"{path}\"", + }; + } + + private static ProcessStartInfo GetLaunchStartInfo(string? path) + { + return new ProcessStartInfo + { + FileName = path, + UseShellExecute = true, + }; + } + + private ProcessStartInfo GetRevealStartInfoWindows(string path) + { + var fileName = "explorer"; + var sysRoot = this.getEnvironmentVariable("SYSTEMROOT"); + if (sysRoot != null) + { + fileName = this.fs.Path.Combine(sysRoot, fileName); + } + + return new ProcessStartInfo + { + FileName = fileName, + Arguments = $"/select,\"{path}\"", + }; + } + + private ProcessStartInfo GetRevealStartInfoDBus(string path) + { + string fileUri = this.PathToFileUri(path); + return new ProcessStartInfo() + { + FileName = "dbus-send", + Arguments = $"--print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:\"{fileUri}\" string:\"\"", + UseShellExecute = true, + }; + } + + private ProcessStartInfo GetOpenParentFolderStartInfo(string path) + { + return GetLaunchStartInfo(this.fs.Path.GetDirectoryName(path)); + } + + private ProcessStartInfo GetRevealStartInfo(string path) + { + Func core = this.CurrentPlatform switch + { + Windows => this.GetRevealStartInfoWindows, + Osx => GetRevealStartInfoOsx, + Unsupported => this.GetOpenParentFolderStartInfo, + _ => this.GetRevealStartInfoDBus, + }; + + return core(path); + } +} diff --git a/czishrink/netczicompress/Models/FileProcessingFailedHandler.cs b/czishrink/netczicompress/Models/FileProcessingFailedHandler.cs new file mode 100644 index 0000000..737caea --- /dev/null +++ b/czishrink/netczicompress/Models/FileProcessingFailedHandler.cs @@ -0,0 +1,113 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System.IO.Abstractions; + +/// +/// A handler which deals with the case when a file processing fails. +/// +public class FileProcessingFailedHandler +{ + public const string SuccessfulCopyMessage = "The file was copied as-is to the output folder."; + public const string FailedCopyMessage = "The file could not be copied to the output folder."; + + /// + /// Handles the case when a file processing has failed. + /// + /// The input file. + /// The output file. + /// The temporary output file. + /// The delegate to report progress. + /// The inner exception, that has occurred. + /// A value indicating whether the failed file should by copied. + /// The cancellation token. + /// A message which described how the failed file processing was handled. + /// Thrown when any argument is null. + public string FileProcessingFailed( + IFileInfo inFile, + IFileInfo outFile, + IFileInfo tempOutFile, + ReportProgress reportProgress, + string innerException, + bool copyFailedFile, + CancellationToken cancellationToken) + { + if (copyFailedFile) + { + return CopyFile(inFile, outFile, tempOutFile, reportProgress, cancellationToken) + ? $"{innerException} {SuccessfulCopyMessage}" + : $"{innerException} {FailedCopyMessage}"; + } + + return innerException; + } + + private static bool TryDelete(IFileInfo fileInfo) + { + try + { + fileInfo.Delete(); + } + catch (Exception) + { + return false; + } + + return true; + } + + private static bool CopyFile( + IFileInfo inFile, + IFileInfo outFile, + IFileInfo tempOutFile, + ReportProgress reportProgress, + CancellationToken cancellationToken) + { + try + { + CopyWithProgress(inFile.FullName, tempOutFile.FullName, reportProgress, cancellationToken); + tempOutFile.Refresh(); + tempOutFile.MoveTo(outFile.FullName); + return true; + } + catch (Exception) + { + // Remove partially written file + _ = TryDelete(outFile); + _ = TryDelete(tempOutFile); + return false; + } + } + + private static void CopyWithProgress( + string inPath, + string outPath, + ReportProgress reportProgress, + CancellationToken cancellationToken) + { + long totalBytesWritten = 0; + int bufferLength = 1024 * 1024; + byte[] buffer = new byte[bufferLength]; + using var inStream = new FileStream(inPath, FileMode.Open); + using var tempOutStream = new FileStream(outPath, FileMode.CreateNew); + + int bytesRead = inStream.Read(buffer, 0, bufferLength); + + do + { + cancellationToken.ThrowIfCancellationRequested(); + + tempOutStream.Write(buffer, 0, bytesRead); + totalBytesWritten += bytesRead; + + int progress = inStream.Length != 0 ? (int)(((totalBytesWritten * 1.0) / inStream.Length) * 100) : 100; + reportProgress.Invoke(progress); + + bytesRead = inStream.Read(buffer, 0, bufferLength); + } + while (bytesRead > 0); + } +} diff --git a/czishrink/netczicompress/Models/FolderCompressorDecorator.cs b/czishrink/netczicompress/Models/FolderCompressorDecorator.cs new file mode 100644 index 0000000..0d2f026 --- /dev/null +++ b/czishrink/netczicompress/Models/FolderCompressorDecorator.cs @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Threading; + +/// +/// Decorates an with configurable output observation. +/// +public class FolderCompressorDecorator : IFolderCompressor +{ + /// + /// Gets the core instance to wrap. + /// + public required IFolderCompressor Core { get; init; } + + /// + /// Gets the action that is used to start observing the output of the folder compressor. + /// + /// The observable that is passed to will terminate if the + /// returned is started. + /// In that case, their is no need to explicitly dispose subscriptions. + /// + public required Action> ObserveRun { get; init; } + + public IFolderCompressorRun PrepareNewRun(FolderCompressorParameters parameters, CancellationToken token) + { + var result = this.Core.PrepareNewRun(parameters, token); + this.ObserveRun(parameters, result.Output); + return result; + } +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/FolderCompressorExtensions.cs b/czishrink/netczicompress/Models/FolderCompressorExtensions.cs new file mode 100644 index 0000000..33c9010 --- /dev/null +++ b/czishrink/netczicompress/Models/FolderCompressorExtensions.cs @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Reactive.Concurrency; +using System.Reactive.Linq; + +/// +/// Extensions for . +/// +public static class FolderCompressorExtensions +{ + public static IFolderCompressor Decorate(this IFolderCompressor self, Action> observeRun) + where TMessage : CompressorMessage + { + return new FolderCompressorDecorator + { + Core = self, + ObserveRun = (parameters, output) => observeRun(parameters, output.OfType()), + }; + } + + public static IFolderCompressor DecorateWithRunObserver(this IFolderCompressor self, IFolderCompressorRunObserver runObserver) + where TMessage : CompressorMessage + { + return self.Decorate(runObserver.ObserveRun); + } + + public static IFolderCompressor DecorateWithObserver(this IFolderCompressor self, IObserver observer, IScheduler scheduler) + where TMessage : CompressorMessage + { + return self.Decorate((parameters, output) => output.ObserveOn(scheduler).Subscribe(observer)); + } +} diff --git a/czishrink/netczicompress/Models/FolderCompressorParameters.cs b/czishrink/netczicompress/Models/FolderCompressorParameters.cs new file mode 100644 index 0000000..008fe52 --- /dev/null +++ b/czishrink/netczicompress/Models/FolderCompressorParameters.cs @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System.IO.Abstractions; + +/// +/// A parameter-object that contains the parameters for . +/// +/// The input directory. +/// The output directory. +/// True if the input directory should be scanned recursively, else false. +/// The compression mode. +/// Execution options to apply to operations. +/// Additional processing options. +public record FolderCompressorParameters( + IDirectoryInfo InputDir, + IDirectoryInfo OutputDir, + bool Recursive, + CompressionMode Mode, + ExecutionOptions ExecutionOptions, + ProcessingOptions ProcessingOptions); \ No newline at end of file diff --git a/czishrink/netczicompress/Models/IFileLauncher.cs b/czishrink/netczicompress/Models/IFileLauncher.cs new file mode 100644 index 0000000..adc5703 --- /dev/null +++ b/czishrink/netczicompress/Models/IFileLauncher.cs @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +/// +/// A service that launches a file with its associated app. +/// +public interface IFileLauncher +{ + /// + /// Launches the specified file or folder with its associated app. + /// + /// The file or folder to launch. + /// A task that represents the operation. + Task Launch(string path); + + /// + /// Shows the specified file or folder in the operating system's file manager. + /// + /// The file or folder to show. + /// A task that represents the operation. + Task Reveal(string path); +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/IFileProcessor.cs b/czishrink/netczicompress/Models/IFileProcessor.cs new file mode 100644 index 0000000..1b74ebc --- /dev/null +++ b/czishrink/netczicompress/Models/IFileProcessor.cs @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Threading; + +/// +/// An object that can process a single file. +/// +public interface IFileProcessor : IDisposable +{ + /// + /// Gets a value indicating whether the file processor needs the output directory to exist when + /// is called. + /// + bool NeedsExistingOutputDirectory { get; } + + /// + /// Processes a single input file to a single output file. + /// + /// The absolute path of the input file. + /// The absolute path of the output file. + /// The progress delegate. + /// The cancellation token. + void ProcessFile(string inputPath, string outputPath, ReportProgress progressReport, CancellationToken token); +} diff --git a/czishrink/netczicompress/Models/IFolderCompressor.cs b/czishrink/netczicompress/Models/IFolderCompressor.cs new file mode 100644 index 0000000..e14de5e --- /dev/null +++ b/czishrink/netczicompress/Models/IFolderCompressor.cs @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System.Threading; + +/// +/// An object that can compress files in an input folder to an output folder. +/// +public interface IFolderCompressor +{ + /// + /// Prepare a new compressor run with the specified parameters. + /// + /// Parameters of the compression operation that is to be performed. + /// The cancellation token. + /// A new compressor run. + /// + /// The actual compression is started when the method is called on the returned object. + /// + IFolderCompressorRun PrepareNewRun(FolderCompressorParameters parameters, CancellationToken token); +} diff --git a/czishrink/netczicompress/Models/IFolderCompressorRunObserver.cs b/czishrink/netczicompress/Models/IFolderCompressorRunObserver.cs new file mode 100644 index 0000000..77cee98 --- /dev/null +++ b/czishrink/netczicompress/Models/IFolderCompressorRunObserver.cs @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; + +/// +/// An object that can observe folder compressor runs. +/// +/// The type of messages to observe. +public interface IFolderCompressorRunObserver + where TMessage : CompressorMessage +{ + void ObserveRun(FolderCompressorParameters runParameters, IObservable runMessages); +} diff --git a/czishrink/netczicompress/Models/ILoggingStrategy.cs b/czishrink/netczicompress/Models/ILoggingStrategy.cs new file mode 100644 index 0000000..24a0dc0 --- /dev/null +++ b/czishrink/netczicompress/Models/ILoggingStrategy.cs @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.IO; +using System.IO.Abstractions; +using System.Reactive.Concurrency; + +/// +/// A text-file-based logging strategy. +/// +public interface ILoggingStrategy +{ + public IScheduler LoggerScheduler { get; } + + public IFileInfo CreateLogFile(FolderCompressorParameters run); + + public IObserver CreateLogger(TextWriter writer); + + public Task OpenLogFile(IFileInfo file); +} diff --git a/czishrink/netczicompress/Models/IObservableAction.cs b/czishrink/netczicompress/Models/IObservableAction.cs new file mode 100644 index 0000000..18be592 --- /dev/null +++ b/czishrink/netczicompress/Models/IObservableAction.cs @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; + +/// +/// An action that produces a sequence of values. +/// +/// The type of the produced items. +public interface IObservableAction +{ + /// + /// Gets the output sequence. + /// + /// + /// This observable will terminate when the action completes. + /// + IObservable Output { get; } + + /// + /// Starts the action. The must complete when the action has finished. + /// + /// + /// This method can only be called once. + /// + /// Thrown when this method is called more than once. + void Start(); +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/IProgramNameAndVersion.cs b/czishrink/netczicompress/Models/IProgramNameAndVersion.cs new file mode 100644 index 0000000..be93afe --- /dev/null +++ b/czishrink/netczicompress/Models/IProgramNameAndVersion.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +/// +/// An object that provides program name and version info. +/// +public interface IProgramNameAndVersion +{ + string Name { get; } + + string Version { get; } +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/MultiThreadedFolderCompressor.cs b/czishrink/netczicompress/Models/MultiThreadedFolderCompressor.cs new file mode 100644 index 0000000..37ede24 --- /dev/null +++ b/czishrink/netczicompress/Models/MultiThreadedFolderCompressor.cs @@ -0,0 +1,267 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.IO.Abstractions; +using System.Reactive.Linq; +using System.Reactive.Subjects; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +/// +/// A multi-threaded that uses s to do the actual work. +/// +public class MultiThreadedFolderCompressor : IFolderCompressor +{ + private readonly CreateProcessor createProcessor; + private readonly FileProcessingFailedHandler fileProcessingFailedHandler; + private readonly int maxTriesToCreateTemporaryFile; + + public MultiThreadedFolderCompressor( + CreateProcessor createProcessor, + FileProcessingFailedHandler fileProcessingFailedHandler, + int maxTriesToCreateTemporaryFiles = 100) + { + this.createProcessor = createProcessor; + this.fileProcessingFailedHandler = fileProcessingFailedHandler ?? throw new ArgumentNullException(nameof(fileProcessingFailedHandler)); + this.maxTriesToCreateTemporaryFile = maxTriesToCreateTemporaryFiles; + } + + // Public only for testing. MockFileSystem does not support CaseInsensitive + public MatchCasing MatchExtensionCasing { get; init; } = MatchCasing.CaseInsensitive; + + // Public only for testing. MockFileSystem does not support AttributesToSkip + public FileAttributes AttributesToSkip { get; init; } = FileAttributes.Hidden; + + /// + public IFolderCompressorRun PrepareNewRun(FolderCompressorParameters parameters, CancellationToken token) + { + return new AsyncEnumerableToObservableActionAdapter(CoreAsync(token), token); + + async IAsyncEnumerable CoreAsync([EnumeratorCancellation] CancellationToken t = default) + { + var startTime = DateTime.UtcNow; + + var (inputDir, outputDir, recursive, mode, executionOptions, processingOptions) = parameters; + + var maxNumberOfThreads = executionOptions.ThreadCount.Value; + + var processors = new List(maxNumberOfThreads); + try + { + var activeTasks = new List>(maxNumberOfThreads); + await foreach (var file in this.EnumerateCzisAsync(inputDir, recursive, t).WithCancellation(t).ConfigureAwait(false)) + { + if (file.CreationTimeUtc >= startTime) + { + // skip files that we may have created ourselves + continue; + } + + if (t.IsCancellationRequested) + { + // Don't ThrowIfCancellationRequested here, + // we first need to wait for activeTasks to complete. + break; + } + + var thisFile = file; + var progressObservable = new BehaviorSubject(0); + + yield return new CompressorMessage.FileStarting( + thisFile, + progressObservable.DistinctUntilChanged().AsObservable()); + + IFileInfo outFile = GetOutputFileInfo(inputDir, outputDir, file); + + if (activeTasks.Count < maxNumberOfThreads) + { + var processor = this.createProcessor(mode, processingOptions); + processors.Add(processor); + activeTasks.Add(Run(processor)); + } + else + { + int index = await WaitForTaskToComplete(activeTasks).ConfigureAwait(false); + yield return await activeTasks[index].ConfigureAwait(false); + activeTasks[index].Dispose(); + activeTasks[index] = Run(processors[index]); + } + + Task Run(IFileProcessor p) => Task.Run(() => + { + try + { + return this.ProcessFile( + p, + thisFile, + outFile, + processingOptions.CopyFailedFiles, + progressObservable.OnNext, + t); + } + finally + { + // Make sure that we deliver 100 percent progress. + // This is used by observers to detect completion. + progressObservable.OnNext(100); + } + }); + } + + // No more new tasks will be started. + // Now wait for the active tasks to complete. + while (activeTasks.Count != 0) + { + int index = await WaitForTaskToComplete(activeTasks).ConfigureAwait(false); + yield return await activeTasks[index].ConfigureAwait(false); + activeTasks[index].Dispose(); + activeTasks.RemoveAt(index); + } + + t.ThrowIfCancellationRequested(); + } + finally + { + foreach (var processor in processors) + { + processor.Dispose(); + } + } + } + } + + protected virtual IAsyncEnumerable EnumerateCzisAsync( + IDirectoryInfo folder, + bool recursive, + CancellationToken token) + { + var opts = new EnumerationOptions + { + IgnoreInaccessible = true, + MatchCasing = this.MatchExtensionCasing, + RecurseSubdirectories = recursive, + BufferSize = 1 << 16, + AttributesToSkip = this.AttributesToSkip, + }; + + return folder.EnumerateFilesAsync("*.czi", opts, token); + } + + private static void EnsureParentDirectoryExists(IFileInfo outFile) + { + var outputDir = outFile.Directory; + if (outputDir?.Exists == false) + { + outputDir.Create(); + } + } + + private static async Task WaitForTaskToComplete(IReadOnlyList tasks) + { + while (true) + { + for (int i = 0; i < tasks.Count; i++) + { + if (tasks[i].IsCompleted) + { + return i; + } + } + + await Task.WhenAny(tasks).ConfigureAwait(false); + } + } + + private static IFileInfo GetOutputFileInfo(IDirectoryInfo inputDir, IDirectoryInfo outputDir, IFileInfo file) + { + var inputFileSystem = inputDir.FileSystem; + var outputFileSystem = outputDir.FileSystem; + var relativePath = inputFileSystem.Path.GetRelativePath(inputDir.FullName, file.FullName); + var outputPath = outputFileSystem.Path.Combine(outputDir.FullName, relativePath); + var outFile = outputFileSystem.FileInfo.New(outputPath); + return outFile; + } + + private CompressorMessage.FileFinished ProcessFile( + IFileProcessor processor, + IFileInfo inFile, + IFileInfo outFile, + bool copyFailedFile, + ReportProgress reportProgress, + CancellationToken token) + { + TemporaryFile? temporaryFile = null; + bool processedByProcessor = false; + try + { + if (token.IsCancellationRequested) + { + return MakeTheReturnValue(new OperationCanceledException().Message); + } + + if (outFile.Exists) + { + return MakeTheReturnValue( + errorMessage: $"Output file {outFile} already exists."); + } + + if (processor.NeedsExistingOutputDirectory) + { + EnsureParentDirectoryExists(outFile); + } + + temporaryFile = new TemporaryFile(outFile, this.maxTriesToCreateTemporaryFile); + if (temporaryFile.TemporaryFileCreationFailed) + { + var tempOutFile = temporaryFile.Info; + return MakeTheReturnValue( + errorMessage: $"Could not delete existing temporary file {tempOutFile}."); + } + + var temporaryOutFile = temporaryFile.Info; + var startTimestamp = Stopwatch.GetTimestamp(); + processor.ProcessFile(inFile.FullName, temporaryOutFile.FullName, reportProgress, token); + processedByProcessor = true; + var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp); + temporaryFile.MoveToOutFileIfExists(); + return MakeTheReturnValue(timeElapsed: elapsedTime, errorMessage: null); + } + catch (Exception ex) when (ex is IOException or OperationCanceledException) + { + // Remove partially written file + temporaryFile?.DeleteAllOutFiles(); + + if (temporaryFile == null || processedByProcessor || ex is OperationCanceledException) + { + return MakeTheReturnValue(errorMessage: ex.Message); + } + + // We only cover those exceptions, that have been reported when processing the file, i.e. processedByProcessor is false. + var tempOutFile = temporaryFile.Info; + return MakeTheReturnValue( + this.fileProcessingFailedHandler.FileProcessingFailed( + inFile, + outFile, + tempOutFile, + reportProgress, + ex.Message, + copyFailedFile, + token)); + } + + CompressorMessage.FileFinished MakeTheReturnValue(string? errorMessage, TimeSpan? timeElapsed = null) + { + long inSize = inFile.Exists ? inFile.Length : 0; + long outSize = outFile.Exists ? outFile.Length : 0; + return new CompressorMessage.FileFinished(inFile, inSize, outSize, timeElapsed, errorMessage); + } + } +} diff --git a/czishrink/netczicompress/Models/NoOpFileProcessor.cs b/czishrink/netczicompress/Models/NoOpFileProcessor.cs new file mode 100644 index 0000000..3dac416 --- /dev/null +++ b/czishrink/netczicompress/Models/NoOpFileProcessor.cs @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System.Threading; + +/// +/// An that does not do anything. +/// +public sealed class NoOpFileProcessor : IFileProcessor +{ + public bool NeedsExistingOutputDirectory => false; + + public void ProcessFile(string inputPath, string outputPath, ReportProgress progressReport, CancellationToken token) + { + progressReport(100); + } + + public void Dispose() + { + } +} diff --git a/czishrink/netczicompress/Models/ObservableMixin.CompleteOnError.cs b/czishrink/netczicompress/Models/ObservableMixin.CompleteOnError.cs new file mode 100644 index 0000000..f37a52a --- /dev/null +++ b/czishrink/netczicompress/Models/ObservableMixin.CompleteOnError.cs @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +/// +/// Extensions for observable sequences. +/// +public static partial class ObservableMixin +{ + /// + /// Creates an observable that will call + /// when the current sequence is terminated with an error. + /// + /// + /// This should be equivalent to obs.Catch(Observable.Empty<T>), + /// but I had problems (NullReferenceExceptions) with that code in my tests and so chose to + /// write this extension. + /// + /// The type of the items in the sequence. + /// The source sequence. + /// The wrapped source sequence. + public static IObservable CompleteOnError(this IObservable obs) + { + return new CompleteOnErrorDecorator(obs); + } + + public class CompleteOnErrorDecorator : IObservable + { + private readonly IObservable core; + + public CompleteOnErrorDecorator(IObservable core) + { + this.core = core; + } + + public IDisposable Subscribe(IObserver observer) + { + return this.core.Subscribe( + onNext: observer.OnNext, + onCompleted: observer.OnCompleted, + onError: ex => observer.OnCompleted()); + } + } +} diff --git a/czishrink/netczicompress/Models/PInvokeFileProcessor.cs b/czishrink/netczicompress/Models/PInvokeFileProcessor.cs new file mode 100644 index 0000000..8a71f1c --- /dev/null +++ b/czishrink/netczicompress/Models/PInvokeFileProcessor.cs @@ -0,0 +1,222 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Buffers; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +/// +/// An that uses the native libczicompressc C API to do the actual work. +/// +public sealed partial class PInvokeFileProcessor : IFileProcessor +{ + private IntPtr nativeFileProcessor; + + /// + /// Initializes a new instance of the class. + /// + /// The compression mode to use, not all modes may be supported. + /// The processing mode to use. + /// Thrown when is . + /// Thrown when the native file processor cannot be created. + public PInvokeFileProcessor(CompressionMode mode, ProcessingOptions options) + { + if (mode == CompressionMode.NoOp) + { + throw new ArgumentOutOfRangeException(nameof(mode)); + } + + NativeMethods.Command cmd = mode switch + { + CompressionMode.Decompress => NativeMethods.Command.Decompress, + _ => NativeMethods.Command.Compress, + }; + + NativeMethods.CompressionStrategy strategy = mode switch + { + CompressionMode.CompressAll => NativeMethods.CompressionStrategy.All, + CompressionMode.CompressUncompressedAndZstd => + NativeMethods.CompressionStrategy.UncompressedAndZStdCompressed, + _ => NativeMethods.CompressionStrategy.OnlyUncompressed, + }; + + this.nativeFileProcessor = NativeMethods.CreateFileProcessor(cmd, strategy, options.CompressionLevel.Value); + + if (this.nativeFileProcessor == IntPtr.Zero) + { + throw new ApplicationException("Failed to create native file processor."); + } + } + + public bool NeedsExistingOutputDirectory => true; + + private bool IsDisposed + { + get => this.nativeFileProcessor == IntPtr.Zero; + } + + public static IFileProcessor Create(CompressionMode mode, ProcessingOptions options) + { + return new PInvokeFileProcessor(mode, options); + } + + public static string GetLibFullName() => NativeMethods.GetLibFullName(); + + public void ProcessFile(string inputPath, string outputPath, ReportProgress progressReport, CancellationToken token) + { + this.CheckDisposed(); + + var errorMessageBuffer = ArrayPool.Shared.Rent(1024); + var errorMessageLength = errorMessageBuffer.Length; + + bool ReportProgressCheckCancelImpl(int progress) + { + progressReport(progress); + + return !token.IsCancellationRequested; + } + + var result = NativeMethods.ProcessFile( + this.nativeFileProcessor, + inputPath, + outputPath, + errorMessageBuffer, + ref errorMessageLength, + ReportProgressCheckCancelImpl); + + GC.KeepAlive(this.nativeFileProcessor); + GC.KeepAlive(errorMessageBuffer); + GC.KeepAlive(errorMessageLength); + GC.KeepAlive(progressReport); + + if (result != 0) + { + var message = Encoding.UTF8.GetString(errorMessageBuffer, 0, errorMessageLength); + throw new IOException(message); + } + + // Make sure that we don't report cancellation as success, even if the native lib returns 0 when canceled. + token.ThrowIfCancellationRequested(); + } + + public void Dispose() + { + if (!this.IsDisposed) + { + NativeMethods.DestroyFileProcessor(this.nativeFileProcessor); + } + + this.nativeFileProcessor = IntPtr.Zero; + } + + private void CheckDisposed() + { + if (this.IsDisposed) + { + throw new ObjectDisposedException(this.ToString()); + } + } + + internal static partial class NativeMethods + { + private const string LibName = "libczicompressc"; + private const StringMarshalling LibStringEncoding = StringMarshalling.Utf8; + + static NativeMethods() + { + GetLibVersion(out int major, out int minor, out int patch); + + var actual = (major, minor); + (int Major, int Minor) expected = (0, 5); + + bool isCompatible = major == 0 + ? actual == expected + : major == expected.Major && minor >= expected.Minor; + + if (!isCompatible) + { + throw new InvalidOperationException($"Expecting {LibName} {nameof(GetLibVersion)} to be compatible with {expected} but found {actual}."); + } + +#if !DEBUG + var fullName = GetLibFullName(); + if (fullName.Contains("DEBUG")) + { + throw new InvalidOperationException($"You must not use {fullName} in a Release build of {nameof(netczicompress)}. Use a Release build of the library."); + } +#endif + } + + /// + /// Delegate that is invoked by processing function to provide updates. + /// + /// The progress in percent. + /// True if operation should continue; false if canceled. + public delegate bool ReportProgressCheckCancel(int progressPercent); + + public enum Command + { + Compress = 1, + Decompress = 2, + } + + public enum CompressionStrategy + { + All = 1, + OnlyUncompressed = 2, + UncompressedAndZStdCompressed = 3, + } + + public static string GetLibFullName(int suggestedBufferLength = 64) + { + checked + { + var buffer = ArrayPool.Shared.Rent(suggestedBufferLength); + ulong bufferLength = (ulong)buffer.Length; + if (NativeMethods.GetLibVersionString(buffer, ref bufferLength)) + { + var version = Encoding.UTF8.GetString(buffer, 0, buffer.Count(b => b != 0)); + return $"{LibName} {version}"; + } + else if (bufferLength > (ulong)suggestedBufferLength) + { + // This means that the buffer was too small + return GetLibFullName((int)bufferLength); + } + else + { + throw new Exception($"Failed to determine version of {LibName}"); + } + } + } + + [LibraryImport(LibName, StringMarshalling = LibStringEncoding)] + [return: MarshalAs(UnmanagedType.U1)] + public static partial bool GetLibVersionString(byte[] buffer, ref ulong bufferLength); + + [LibraryImport(LibName, StringMarshalling = LibStringEncoding)] + public static partial void GetLibVersion(out int major, out int minor, out int patch); + + [LibraryImport(LibName, StringMarshalling = LibStringEncoding)] + public static partial IntPtr CreateFileProcessor(Command command, CompressionStrategy strategy, int compressionLevel); + + [LibraryImport(LibName, StringMarshalling = LibStringEncoding)] + public static partial void DestroyFileProcessor(IntPtr file_processor); + + [LibraryImport(LibName, StringMarshalling = LibStringEncoding)] + public static partial int ProcessFile( + IntPtr file_processor, + string input_path, + string output_path, + byte[] error_message, + ref int error_message_length, + ReportProgressCheckCancel reportProgress); + } +} diff --git a/czishrink/netczicompress/Models/ProcessingOptions.cs b/czishrink/netczicompress/Models/ProcessingOptions.cs new file mode 100644 index 0000000..3601073 --- /dev/null +++ b/czishrink/netczicompress/Models/ProcessingOptions.cs @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +/// +/// Processing options to apply to an operation. +/// +/// Level of compression to use, if applicable. +/// A value indicating whether failed files should be copied to the destination folder. +public record ProcessingOptions(CompressionLevel CompressionLevel, bool CopyFailedFiles = false); diff --git a/czishrink/netczicompress/Models/ProgramNameAndVersion.cs b/czishrink/netczicompress/Models/ProgramNameAndVersion.cs new file mode 100644 index 0000000..3ec8f8e --- /dev/null +++ b/czishrink/netczicompress/Models/ProgramNameAndVersion.cs @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Linq; +using System.Reflection; + +using netczicompress.ViewModels; + +/// +/// Program name and version info. +/// +public record class ProgramNameAndVersion : IProgramNameAndVersion +{ + public ProgramNameAndVersion() + { + var assembly = typeof(AboutViewModel).Assembly; + this.Version = assembly.GetCustomAttributes().Select(att => att.InformationalVersion).FirstOrDefault() ?? + assembly.GetName().Version?.ToString() ?? + throw new ApplicationException("Failed to determine assembly version"); + this.Name = "CZI Shrink"; + } + + public string Name { get; } + + public string Version { get; } + + public override string ToString() + { + return $"{this.Name} {this.Version}"; + } +} diff --git a/czishrink/netczicompress/Models/ReportProgress.cs b/czishrink/netczicompress/Models/ReportProgress.cs new file mode 100644 index 0000000..dcff645 --- /dev/null +++ b/czishrink/netczicompress/Models/ReportProgress.cs @@ -0,0 +1,11 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +/// +/// Delegate that is invoked by processing function to provide updates. +/// +/// The percentage of completion in the range 0 .. 100. +public delegate void ReportProgress(int percentComplete); diff --git a/czishrink/netczicompress/Models/StatisticsRunObserver.cs b/czishrink/netczicompress/Models/StatisticsRunObserver.cs new file mode 100644 index 0000000..76441ce --- /dev/null +++ b/czishrink/netczicompress/Models/StatisticsRunObserver.cs @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Reactive.Concurrency; +using System.Reactive.Linq; + +/// +/// An that forwards to an observer of these. +/// +public class StatisticsRunObserver : IFolderCompressorRunObserver +{ + private readonly IObserver statisticsObserver; + private readonly TimeSpan samplingInterval; + private readonly IScheduler scheduler; + + public StatisticsRunObserver( + IObserver statisticsObserver, + TimeSpan samplingInterval, + IScheduler scheduler) + { + this.statisticsObserver = statisticsObserver; + this.samplingInterval = samplingInterval; + this.scheduler = scheduler; + } + + public void ObserveRun(FolderCompressorParameters runParameters, IObservable runMessages) + { + var start = this.scheduler.Now; + + var emptyStats = AggregateStatistics.Empty; + this.statisticsObserver.OnNext(emptyStats); + var cumulativeStatistics = runMessages + .CompleteOnError() + .Scan( + emptyStats, + (stats, msg) => stats.AddData(msg, this.scheduler.Now - start)); + + // Subscriptions will expire upon completion, no need for explicit disposal. + _ = cumulativeStatistics + .Sample(this.samplingInterval) + .ObserveOn(this.scheduler) + .Subscribe(this.statisticsObserver); + } +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/TemporaryFile.cs b/czishrink/netczicompress/Models/TemporaryFile.cs new file mode 100644 index 0000000..d4b8eea --- /dev/null +++ b/czishrink/netczicompress/Models/TemporaryFile.cs @@ -0,0 +1,148 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System.IO.Abstractions; + +/// +/// Creates and handles temporary files according to the following logic: +/// +/// The target filename "outfile_name" is given. +/// The basic temporary filename is "outfile_name" + "~". +/// If the basic temporary filename can be used (file does not yet exist or can be deleted) +/// then it will be used. +/// If it cannot be used, we (now recursively) try with another file name "outfile_name" + "~" + i, +/// with i being an index starting at 1. +/// There is a maximum number of tries, so the index is bounded by "maximum number of tries - 1". +/// +/// +public class TemporaryFile +{ + /// + /// Initializes a new instance of the class. + /// + /// The is set and (not the file on the hard disk) + /// immediately created, if possible. + /// By this is set accordingly. + /// + /// The basic output file name. + /// The maximum number or tries. + public TemporaryFile( + IFileInfo outfile, + int maxNumberOfTriesToCreate = 100) + { + this.OutFile = outfile; + this.MaxNumberOfTriesToCreate = maxNumberOfTriesToCreate; + this.Info = this.TryCreate(); + } + + /// + /// Gets a value indicating whether the temporary file creation failed. + /// + public bool TemporaryFileCreationFailed { get; private set; } + + /// + /// Gets the created temporary file. + /// + public IFileInfo Info { get; } + + /// + /// Gets the created final output file. + /// + protected IFileInfo OutFile { get; } + + /// + /// Gets the maximum number of tries for the temporary file creation. + /// + private int MaxNumberOfTriesToCreate { get; } + + /// + /// If the temporary file exists, moves the temporary file to the final output file. + /// Mind that the attribute of the temporary file will + /// be adapted not the flag. + /// + public void MoveToOutFileIfExists() + { + this.Info.Refresh(); // mind that the file might have not existed when the variable was created. + if (!this.Info.Exists) + { + return; + } + + this.Info.MoveTo(this.OutFile.FullName); + this.Info.Refresh(); // mind that the move changes the full name, not the `Exits` flag. + this.OutFile.Refresh(); + } + + /// + /// Deletes the basic output file and the temporary file. + /// + public void DeleteAllOutFiles() + { + _ = this.TryDelete(this.OutFile); + _ = this.TryDelete(this.Info); + } + + /// + /// Tries to create the temporary file. + /// + /// Create the temporary filename. + /// If it can be used, return it. + /// If not, append an increasing index until the file can be deleted or used. + /// If the maximum number of tries is reached, set "failed" and return the latest try. + /// + /// + /// The temporary file info. + private IFileInfo TryCreate() + { + var outFileName = this.OutFile.FullName; + var tempOutFileName = this.GetBasicTempFileName(outFileName); + IFileInfo temporaryFile = this.OutFile.FileSystem.FileInfo.New(tempOutFileName); + var postfixIndex = 1; + while (temporaryFile.Exists && !this.TryDelete(temporaryFile)) + { + if (postfixIndex + 1 > this.MaxNumberOfTriesToCreate) + { + this.TemporaryFileCreationFailed = true; + return temporaryFile; + } + + temporaryFile = this.CreateWithIndex(this.OutFile, tempOutFileName, postfixIndex); + ++postfixIndex; + } + + this.TemporaryFileCreationFailed = false; + return temporaryFile; + } + + private bool TryDelete(IFileInfo file) + { + try + { + file.Refresh(); + if (file.Exists) + { + file.Delete(); + file.Refresh(); + } + } + catch (Exception) + { + return false; + } + + return true; + } + + private string GetBasicTempFileName(string outFileName) + { + return outFileName + "~"; + } + + private IFileInfo CreateWithIndex(IFileInfo outFile, string tempOutFileName, int index) + { + return outFile.FileSystem.FileInfo.New($"{tempOutFileName}{index}"); + } +} diff --git a/czishrink/netczicompress/Models/ThreadCount.cs b/czishrink/netczicompress/Models/ThreadCount.cs new file mode 100644 index 0000000..1ac5d98 --- /dev/null +++ b/czishrink/netczicompress/Models/ThreadCount.cs @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +public partial record ThreadCount +{ + private readonly int internalValue = Maximum; + + public static readonly ThreadCount Default; + + static ThreadCount() + { + DefaultValue = Maximum; + Default = new ThreadCount { Value = DefaultValue }; + } + + public static int Maximum { get; } = GetMaxProcessorCount(); + + public static int Minimum { get; } = 1; + + /// + /// Gets default thread count if not specified. + /// + public static int DefaultValue { get; } = Maximum; + + public int Value + { + get => this.internalValue; + init => + this.internalValue = value > Maximum || value < Minimum + ? throw new ArgumentOutOfRangeException( + paramName: nameof(value), + $"{nameof(value)} must be between {Minimum} and {Maximum}, not {value}") + : value; + } + + // Note we leave one processor free for the UI thread. + private static int GetMaxProcessorCount() + { + return Environment.ProcessorCount > 4 + ? Environment.ProcessorCount - 1 + : Environment.ProcessorCount; + } +} \ No newline at end of file diff --git a/czishrink/netczicompress/Models/TraceLoggerFactory.cs b/czishrink/netczicompress/Models/TraceLoggerFactory.cs new file mode 100644 index 0000000..9f44d5a --- /dev/null +++ b/czishrink/netczicompress/Models/TraceLoggerFactory.cs @@ -0,0 +1,118 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Diagnostics; + +using Microsoft.Extensions.Logging; + +/// +/// A logger provider and factory that uses to write log messages. +/// +/// +/// Logs levels Information, Warning, Error, and Critical. +/// +/// is not supported. +/// +public sealed class TraceLoggerFactory : ILoggerFactory, ILoggerProvider +{ + private readonly bool useLogLevelsAsTraceLevels; + + public TraceLoggerFactory(bool useLogLevelsAsTraceLevels = false) + { + this.useLogLevelsAsTraceLevels = useLogLevelsAsTraceLevels; + } + + public ILogger CreateLogger(string categoryName) + { + return new TraceLogger(categoryName, this.useLogLevelsAsTraceLevels); + } + + void ILoggerFactory.AddProvider(ILoggerProvider provider) + { + throw new NotSupportedException(); + } + + void IDisposable.Dispose() + { + Trace.Flush(); + } + + private sealed class TraceLogger : ILogger + { + private readonly string categoryName; + private readonly bool useLogLevelsAsTraceLevels; + + public TraceLogger(string categoryName, bool useLogLevelsAsTraceLevels) + { + this.categoryName = categoryName; + this.useLogLevelsAsTraceLevels = useLogLevelsAsTraceLevels; + } + + public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) + { + if (this.IsEnabled(logLevel)) + { + var msg = $"{DateTimeOffset.Now:O}|{this.categoryName}|{ToString(logLevel)}|{eventId}|{formatter(state, exception)}"; + if (this.useLogLevelsAsTraceLevels) + { + switch (logLevel) + { + case LogLevel.Error: + case LogLevel.Critical: + Trace.TraceError(msg); + break; + case LogLevel.Information: + Trace.TraceInformation(msg); + break; + case LogLevel.Warning: + Trace.TraceWarning(msg); + break; + default: + break; + } + } + else + { + Trace.WriteLine(msg); + } + } + } + + public bool IsEnabled(LogLevel logLevel) + { + return logLevel switch + { + LogLevel.Trace => false, + LogLevel.Debug => false, + LogLevel.Information => true, + LogLevel.Warning => true, + LogLevel.Error => true, + LogLevel.Critical => true, + LogLevel.None => false, + _ => false, + }; + } + + public IDisposable? BeginScope(TState state) + where TState : notnull + { + return null; + } + + private static string ToString(LogLevel logLevel) + { + return logLevel switch + { + LogLevel.Information => "INFO", + LogLevel.Warning => "WARN", + LogLevel.Error => "ERROR", + LogLevel.Critical => "FATAL", + _ => string.Empty, + }; + } + } +} diff --git a/czishrink/netczicompress/Models/VariousExtensions.cs b/czishrink/netczicompress/Models/VariousExtensions.cs new file mode 100644 index 0000000..31a38ed --- /dev/null +++ b/czishrink/netczicompress/Models/VariousExtensions.cs @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Models; + +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Abstractions; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +public static class VariousExtensions +{ + public static async IAsyncEnumerable EnumerateFilesAsync( + this IDirectoryInfo folder, + string searchPattern, + EnumerationOptions opts, + [EnumeratorCancellation] CancellationToken token = default) + { + var files = await Task.Run(() => folder.EnumerateFiles(searchPattern, opts)).ConfigureAwait(false); + using var e = files.GetEnumerator(); + while (await Task.Run(() => e.MoveNext()).ConfigureAwait(false)) + { + if (token.IsCancellationRequested) + { + yield break; + } + + yield return e.Current; + } + } + + public static AggregateStatistics AddData(this AggregateStatistics aggregateStatistics, CompressorMessage.FileFinished msg, TimeSpan elapsed) + { + if (msg.ErrorMessage == null) + { + return aggregateStatistics with + { + FilesWithNoErrors = aggregateStatistics.FilesWithNoErrors + 1, + InputBytes = aggregateStatistics.InputBytes + msg.SizeInput, + OutputBytes = aggregateStatistics.OutputBytes + msg.SizeOutput, + Duration = elapsed, + }; + } + else + { + return aggregateStatistics with + { + FilesWithErrors = aggregateStatistics.FilesWithErrors + 1, + Duration = elapsed, + }; + } + } +} diff --git a/czishrink/netczicompress/Styles/Border.axaml b/czishrink/netczicompress/Styles/Border.axaml new file mode 100644 index 0000000..20ebe7d --- /dev/null +++ b/czishrink/netczicompress/Styles/Border.axaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Styles/Button_Unused.axaml b/czishrink/netczicompress/Styles/Button_Unused.axaml new file mode 100644 index 0000000..0e07304 --- /dev/null +++ b/czishrink/netczicompress/Styles/Button_Unused.axaml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Styles/ComboBox.axaml b/czishrink/netczicompress/Styles/ComboBox.axaml new file mode 100644 index 0000000..8d64252 --- /dev/null +++ b/czishrink/netczicompress/Styles/ComboBox.axaml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Styles/DataGrid.axaml b/czishrink/netczicompress/Styles/DataGrid.axaml new file mode 100644 index 0000000..ef3dc0f --- /dev/null +++ b/czishrink/netczicompress/Styles/DataGrid.axaml @@ -0,0 +1,50 @@ + + + + + + + + + 18 + 12 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Styles/GridSplitter.axaml b/czishrink/netczicompress/Styles/GridSplitter.axaml new file mode 100644 index 0000000..629ed83 --- /dev/null +++ b/czishrink/netczicompress/Styles/GridSplitter.axaml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/czishrink/netczicompress/Styles/ProgressBar.axaml b/czishrink/netczicompress/Styles/ProgressBar.axaml new file mode 100644 index 0000000..3cb514b --- /dev/null +++ b/czishrink/netczicompress/Styles/ProgressBar.axaml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/czishrink/netczicompress/Styles/TextBox.axaml b/czishrink/netczicompress/Styles/TextBox.axaml new file mode 100644 index 0000000..d3647ea --- /dev/null +++ b/czishrink/netczicompress/Styles/TextBox.axaml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Styles/Themes/ControlThemeButton.axaml b/czishrink/netczicompress/Styles/Themes/ControlThemeButton.axaml new file mode 100644 index 0000000..71f18dd --- /dev/null +++ b/czishrink/netczicompress/Styles/Themes/ControlThemeButton.axaml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + + + + + + diff --git a/czishrink/netczicompress/Views/AboutView.axaml.cs b/czishrink/netczicompress/Views/AboutView.axaml.cs new file mode 100644 index 0000000..5bcd1e2 --- /dev/null +++ b/czishrink/netczicompress/Views/AboutView.axaml.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +/// +/// An about box and commands to show and close it. +/// +public partial class AboutView : UserControl +{ + public AboutView() => this.InitializeComponent(); +} diff --git a/czishrink/netczicompress/Views/AdvancedOptionsView.axaml b/czishrink/netczicompress/Views/AdvancedOptionsView.axaml new file mode 100644 index 0000000..ce39dba --- /dev/null +++ b/czishrink/netczicompress/Views/AdvancedOptionsView.axaml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/czishrink/netczicompress/Views/AdvancedOptionsView.axaml.cs b/czishrink/netczicompress/Views/AdvancedOptionsView.axaml.cs new file mode 100644 index 0000000..b72e589 --- /dev/null +++ b/czishrink/netczicompress/Views/AdvancedOptionsView.axaml.cs @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +public partial class AdvancedOptionsView : UserControl +{ + public AdvancedOptionsView() => this.InitializeComponent(); +} \ No newline at end of file diff --git a/czishrink/netczicompress/Views/AggregateIndicationView.axaml b/czishrink/netczicompress/Views/AggregateIndicationView.axaml new file mode 100644 index 0000000..1bf3abd --- /dev/null +++ b/czishrink/netczicompress/Views/AggregateIndicationView.axaml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/AggregateIndicationView.axaml.cs b/czishrink/netczicompress/Views/AggregateIndicationView.axaml.cs new file mode 100644 index 0000000..87ba22e --- /dev/null +++ b/czishrink/netczicompress/Views/AggregateIndicationView.axaml.cs @@ -0,0 +1,11 @@ +namespace netczicompress.Views; + +using Avalonia.Controls; + +/// +/// A control that visualizes with an icon and a label. +/// +public partial class AggregateIndicationView : UserControl +{ + public AggregateIndicationView() => this.InitializeComponent(); +} diff --git a/czishrink/netczicompress/Views/AggregateStatisticsView.axaml b/czishrink/netczicompress/Views/AggregateStatisticsView.axaml new file mode 100644 index 0000000..f94323c --- /dev/null +++ b/czishrink/netczicompress/Views/AggregateStatisticsView.axaml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/AggregateStatisticsView.axaml.cs b/czishrink/netczicompress/Views/AggregateStatisticsView.axaml.cs new file mode 100644 index 0000000..342f6f6 --- /dev/null +++ b/czishrink/netczicompress/Views/AggregateStatisticsView.axaml.cs @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; +using Avalonia.Controls.Notifications; + +using netczicompress.ViewModels; + +/// +/// A control that visualizes . +/// +public partial class AggregateStatisticsView : UserControl +{ + public AggregateStatisticsView() => this.InitializeComponent(); + + protected override void OnDataContextChanged(EventArgs e) + { + base.OnDataContextChanged(e); + + // Subscribe to the new ViewModels event + if (this.DataContext is IAggregateStatisticsViewModel newViewModel) + { + newViewModel.BadgeCopiedToClipboardRaised += this.OnNotificationBadgeCopiedToClipboardRaised; + } + } + + private void OnNotificationBadgeCopiedToClipboardRaised() + { + var notification = + new Notification( + title: "Badge copied to clipboard", + message: null, + type: NotificationType.Success, + expiration: TimeSpan.FromSeconds(1.5)); + this.RaiseEvent( + new NotificationEventArgs(notification) + { + RoutedEvent = MainWindow.NotificationRequestedEvent, + Source = this, + }); + } +} diff --git a/czishrink/netczicompress/Views/CompressionResultBadge.axaml b/czishrink/netczicompress/Views/CompressionResultBadge.axaml new file mode 100644 index 0000000..95b0b0e --- /dev/null +++ b/czishrink/netczicompress/Views/CompressionResultBadge.axaml @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/czishrink/netczicompress/Views/CompressionResultBadge.axaml.cs b/czishrink/netczicompress/Views/CompressionResultBadge.axaml.cs new file mode 100644 index 0000000..b04fe78 --- /dev/null +++ b/czishrink/netczicompress/Views/CompressionResultBadge.axaml.cs @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +public partial class CompressionResultBadge : Panel +{ + public CompressionResultBadge() => this.InitializeComponent(); +} diff --git a/czishrink/netczicompress/Views/CurrentTasksView.axaml b/czishrink/netczicompress/Views/CurrentTasksView.axaml new file mode 100644 index 0000000..858f058 --- /dev/null +++ b/czishrink/netczicompress/Views/CurrentTasksView.axaml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/CurrentTasksView.axaml.cs b/czishrink/netczicompress/Views/CurrentTasksView.axaml.cs new file mode 100644 index 0000000..1d4c6c1 --- /dev/null +++ b/czishrink/netczicompress/Views/CurrentTasksView.axaml.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +/// +/// A control that visualizes currently running tasks. +/// +public partial class CurrentTasksView : UserControl +{ + public CurrentTasksView() => this.InitializeComponent(); +} diff --git a/czishrink/netczicompress/Views/ErrorListView.axaml b/czishrink/netczicompress/Views/ErrorListView.axaml new file mode 100644 index 0000000..007659a --- /dev/null +++ b/czishrink/netczicompress/Views/ErrorListView.axaml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/ErrorListView.axaml.cs b/czishrink/netczicompress/Views/ErrorListView.axaml.cs new file mode 100644 index 0000000..56b936c --- /dev/null +++ b/czishrink/netczicompress/Views/ErrorListView.axaml.cs @@ -0,0 +1,66 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; +using Avalonia.Controls.Notifications; +using Avalonia.Input.Platform; +using Avalonia.Interactivity; + +using netczicompress.ViewModels; + +/// +/// A control that visualizes a list of errors. +/// +public partial class ErrorListView : UserControl +{ + public ErrorListView() => this.InitializeComponent(); + + private void ErrorListDataGrid_OnSelectionChanged(object? sender, SelectionChangedEventArgs e) + { + if (sender is DataGrid dataGrid && e.AddedItems.Count > 0) + { + dataGrid.ScrollIntoView(e.AddedItems[0], null); + } + + // SelectedItems is not bindable. So for simplicity's sake, we set IsEnabled in this event handler. + bool isExactlyOneFileSelected = this.dataGrid.SelectedItems.Count == 1; + this.showSelectedFileMenuItem.IsEnabled = isExactlyOneFileSelected; + this.openSelectedFileMenuItem.IsEnabled = isExactlyOneFileSelected; + } + + private async void CopySelectedFilePaths(object? sender, RoutedEventArgs e) + { + var clipboard = TopLevel.GetTopLevel(this)?.Clipboard; + if (clipboard != null) + { + await this.CopySelectedFilePaths(clipboard); + this.NotifySelectedFilePathsCopied(); + } + } + + private async Task CopySelectedFilePaths(IClipboard clipboard) + { + var paths = this.dataGrid.SelectedItems.OfType().Select(x => x.File); + var text = string.Join(Environment.NewLine, paths); + await clipboard.SetTextAsync(text); + } + + private void NotifySelectedFilePathsCopied() + { + var notification = + new Notification( + title: "Path copied to clipboard", + message: null, + type: NotificationType.Success, + expiration: TimeSpan.FromSeconds(1.5)); + this.RaiseEvent( + new NotificationEventArgs(notification) + { + RoutedEvent = MainWindow.NotificationRequestedEvent, + Source = this, + }); + } +} diff --git a/czishrink/netczicompress/Views/FolderInputOutputView.axaml b/czishrink/netczicompress/Views/FolderInputOutputView.axaml new file mode 100644 index 0000000..0a05d7b --- /dev/null +++ b/czishrink/netczicompress/Views/FolderInputOutputView.axaml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + diff --git a/czishrink/netczicompress/Views/FolderInputOutputView.axaml.cs b/czishrink/netczicompress/Views/FolderInputOutputView.axaml.cs new file mode 100644 index 0000000..a160655 --- /dev/null +++ b/czishrink/netczicompress/Views/FolderInputOutputView.axaml.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +/// +/// Folder input/output view. +/// +public partial class FolderInputOutputView : UserControl +{ + public FolderInputOutputView() => this.InitializeComponent(); +} \ No newline at end of file diff --git a/czishrink/netczicompress/Views/FolderPicker.axaml b/czishrink/netczicompress/Views/FolderPicker.axaml new file mode 100644 index 0000000..e7e4a3b --- /dev/null +++ b/czishrink/netczicompress/Views/FolderPicker.axaml @@ -0,0 +1,27 @@ + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/FolderPicker.axaml.cs b/czishrink/netczicompress/Views/FolderPicker.axaml.cs new file mode 100644 index 0000000..0c21d6f --- /dev/null +++ b/czishrink/netczicompress/Views/FolderPicker.axaml.cs @@ -0,0 +1,85 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using System.Diagnostics; + +using Avalonia; +using Avalonia.Controls; +using Avalonia.Data; +using Avalonia.Interactivity; +using Avalonia.Platform.Storage; + +/// +/// A control that allows the user to pick a folder. +/// +public partial class FolderPicker : UserControl +{ + public static readonly StyledProperty FolderProperty = + AvaloniaProperty.Register(nameof(Folder), defaultBindingMode: BindingMode.TwoWay); + + public static readonly StyledProperty TitleProperty = + AvaloniaProperty.Register(nameof(Title)); + + public FolderPicker() => this.InitializeComponent(); + + public string Folder + { + get => this.GetValue(FolderProperty); + set => this.SetValue(FolderProperty, value); + } + + public string Title + { + get => this.GetValue(TitleProperty); + set => this.SetValue(TitleProperty, value); + } + + private async void OnButtonClicked(object source, RoutedEventArgs args) + { + try + { + await this.OpenFolderPicker(); + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + } + } + + private async Task OpenFolderPicker() + { + // Get top level from the current control. Alternatively, you can use Window reference instead. + var topLevel = TopLevel.GetTopLevel(this); + + if (topLevel == null) + { + return; + } + + IStorageFolder? startLocation; + try + { + startLocation = await topLevel.StorageProvider.TryGetFolderFromPathAsync(this.Folder); + } + catch + { + startLocation = null; + } + + // Start async operation to open the dialog. + var folders = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions + { + Title = this.Title, + AllowMultiple = false, + SuggestedStartLocation = startLocation, + }); + + if (folders.Count >= 1) + { + this.Folder = folders[0].TryGetLocalPath() ?? folders[0].Path.ToString(); + } + } +} diff --git a/czishrink/netczicompress/Views/MainView.axaml b/czishrink/netczicompress/Views/MainView.axaml new file mode 100644 index 0000000..5c6e3b0 --- /dev/null +++ b/czishrink/netczicompress/Views/MainView.axaml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/MainView.axaml.cs b/czishrink/netczicompress/Views/MainView.axaml.cs new file mode 100644 index 0000000..2738c9d --- /dev/null +++ b/czishrink/netczicompress/Views/MainView.axaml.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +/// +/// The main view of the application. +/// +public partial class MainView : UserControl +{ + public MainView() => this.InitializeComponent(); +} diff --git a/czishrink/netczicompress/Views/MainWindow.axaml b/czishrink/netczicompress/Views/MainWindow.axaml new file mode 100644 index 0000000..28f5de8 --- /dev/null +++ b/czishrink/netczicompress/Views/MainWindow.axaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/MainWindow.axaml.cs b/czishrink/netczicompress/Views/MainWindow.axaml.cs new file mode 100644 index 0000000..6c6e74c --- /dev/null +++ b/czishrink/netczicompress/Views/MainWindow.axaml.cs @@ -0,0 +1,147 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using System.Reactive; +using System.Reactive.Linq; +using System.Windows.Input; + +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.Notifications; +using Avalonia.Interactivity; + +using MsBox.Avalonia; +using MsBox.Avalonia.Dto; +using MsBox.Avalonia.Models; + +using AsyncCommand = ReactiveUI.ReactiveCommand; + +/// +/// The main window of the application. +/// +public partial class MainWindow : Window +{ + public static readonly StyledProperty StopRunningTasksCommandProperty = + AvaloniaProperty.Register(nameof(StopRunningTasksCommand)); + + /// + /// A routed event that requests a notification to be shown. + /// + public static readonly RoutedEvent NotificationRequestedEvent = + RoutedEvent.Register( + nameof(NotificationRequested), + RoutingStrategies.Bubble, + typeof(MainWindow)); + + private INotificationManager? manager; + + public MainWindow() + { + this.InitializeComponent(); + + this.Closing += this.OnClosing; + this.NotificationRequested += this.OnNotificationRequested; + } + + /// + /// Occurs when a notification is requested on this control or one of its children. + /// + public event EventHandler NotificationRequested + { + add => this.AddHandler(NotificationRequestedEvent, value); + remove => this.RemoveHandler(NotificationRequestedEvent, value); + } + + public AsyncCommand? StopRunningTasksCommand + { + get => this.GetValue(StopRunningTasksCommandProperty); + set => this.SetValue(StopRunningTasksCommandProperty, value); + } + + private INotificationManager NotificationManager + { + get + { + if (this.manager == null) + { + var newInstance = new WindowNotificationManager(this) + { + Position = NotificationPosition.BottomRight, + }; + + // If we do not call ApplyTemplate + // the first notification will not be shown. + newInstance.ApplyTemplate(); + + this.manager = newInstance; + } + + return this.manager; + } + } + + private async void OnClosing(object? sender, WindowClosingEventArgs args) + { + if (!this.HasRunningTasks()) + { + // OK to close immediately + return; + } + + // We cannot close right now => cancel this call to Close() + args.Cancel = true; + + if (await this.UserConfirmsStopRunningTasksAndClose()) + { + this.IsEnabled = false; + await this.StopRunningTasksAsync(); + this.Close(); + } + } + + private async Task StopRunningTasksAsync() + { + if (this.HasRunningTasks()) + { + await this.StopRunningTasksCommand!.Execute(Unit.Default); + } + } + + private bool HasRunningTasks() + { + ICommand? synchronousCommand = this.StopRunningTasksCommand; + return synchronousCommand?.CanExecute(null) ?? false; + } + + private async Task UserConfirmsStopRunningTasksAndClose() + { + var contentMessage = $"Do you want to stop the running task and close {this.Title}?"; + + var box = MessageBoxManager.GetMessageBoxCustom( + new MessageBoxCustomParams + { + Icon = MsBox.Avalonia.Enums.Icon.Stop, + ContentTitle = "Folder Operation in Progress", + ContentHeader = "Stop the current operation?", + ContentMessage = contentMessage, + WindowStartupLocation = WindowStartupLocation.CenterOwner, + ButtonDefinitions = new[] + { + new ButtonDefinition { Name = "Yes", IsDefault = false }, + new ButtonDefinition { Name = "No", IsDefault = true, IsCancel = true }, + }, + WindowIcon = this.Icon, + }); + + var result = await box.ShowWindowDialogAsync(this); + return result == "Yes"; + } + + private void OnNotificationRequested(object? sender, NotificationEventArgs e) + { + this.NotificationManager.Show(e.Notification); + } +} diff --git a/czishrink/netczicompress/Views/NotificationEventArgs.cs b/czishrink/netczicompress/Views/NotificationEventArgs.cs new file mode 100644 index 0000000..61d19d0 --- /dev/null +++ b/czishrink/netczicompress/Views/NotificationEventArgs.cs @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls.Notifications; +using Avalonia.Interactivity; + +/// +/// Routed event arguments with an payload. +/// +/// +/// +public class NotificationEventArgs : RoutedEventArgs +{ + public NotificationEventArgs(INotification notification) + { + this.Notification = notification; + } + + public INotification Notification { get; } +} \ No newline at end of file diff --git a/czishrink/netczicompress/Views/SettingsView.axaml b/czishrink/netczicompress/Views/SettingsView.axaml new file mode 100644 index 0000000..a556e9a --- /dev/null +++ b/czishrink/netczicompress/Views/SettingsView.axaml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/SettingsView.axaml.cs b/czishrink/netczicompress/Views/SettingsView.axaml.cs new file mode 100644 index 0000000..7ba5ea2 --- /dev/null +++ b/czishrink/netczicompress/Views/SettingsView.axaml.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +/// +/// View for operation settings. +/// +public partial class SettingsView : UserControl +{ + public SettingsView() => this.InitializeComponent(); +} \ No newline at end of file diff --git a/czishrink/netczicompress/Views/StartStopBarView.axaml b/czishrink/netczicompress/Views/StartStopBarView.axaml new file mode 100644 index 0000000..3ca926f --- /dev/null +++ b/czishrink/netczicompress/Views/StartStopBarView.axaml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/czishrink/netczicompress/Views/StartStopBarView.axaml.cs b/czishrink/netczicompress/Views/StartStopBarView.axaml.cs new file mode 100644 index 0000000..202bb0a --- /dev/null +++ b/czishrink/netczicompress/Views/StartStopBarView.axaml.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompress.Views; + +using Avalonia.Controls; + +/// +/// Execution Buttons View. +/// +public partial class StartStopBarView : UserControl +{ + public StartStopBarView() => this.InitializeComponent(); +} \ No newline at end of file diff --git a/czishrink/netczicompress/netczicompress.csproj b/czishrink/netczicompress/netczicompress.csproj new file mode 100644 index 0000000..930dde8 --- /dev/null +++ b/czishrink/netczicompress/netczicompress.csproj @@ -0,0 +1,32 @@ + + + true + True + true + copyused + true + true + true + true + x64 + + + + + + + + + + + + + + + + + + + + + diff --git a/czishrink/netczicompressTests/AppComposerTests.cs b/czishrink/netczicompressTests/AppComposerTests.cs new file mode 100644 index 0000000..0b57ec4 --- /dev/null +++ b/czishrink/netczicompressTests/AppComposerTests.cs @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests; + +using System.Diagnostics; +using System.Reactive.Disposables; +using System.Text.RegularExpressions; + +using netczicompress; +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +public partial class AppComposerTests +{ + [Fact] + public void ComposeMainViewModel_WhenCalledDoesNotThrow_AndLogsMessage() + { + var listenerMock = new Mock(); + var listener = listenerMock.Object; + using var cleanup = Disposable.Create(() => Trace.Listeners.Remove(listener)); + Trace.Listeners.Add(listener); + + // ACT + var actual = AppComposer.ComposeMainViewModel(new ProgramNameAndVersion()); + + // ASSERT + actual.Should().NotBeNull(); + var re = ExpectedLogMessagePattern(); + listenerMock.Verify(x => x.WriteLine(It.Is(msg => re.IsMatch(msg))), Times.Once); + + // check composition + actual.About.Should().BeOfType(); + actual.ErrorList.Should().BeOfType(); + actual.CurrentTasks.Should().BeOfType(); + + // check initial state + actual.InputDirectory.Should().BeNull(); + actual.OutputDirectory.Should().BeNull(); + actual.Recursive.Should().BeTrue(); + actual.SelectedMode.Value.Should().Be(CompressionMode.CompressUncompressed); + actual.OverallStatus.Should().BeEmpty(); + } + + [GeneratedRegex(@"^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+?[+-]\d\d:\d\d\|netczicompress.App\|INFO\|0\|Starting CZI Shrink 1\.0\.0-alpha\.[1-9]\d* using libczicompressc \d*?\.\d+?\.\d+?.*")] + private static partial Regex ExpectedLogMessagePattern(); +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Customizations/CompressionLevelSpecimenBuilder.cs b/czishrink/netczicompressTests/Customizations/CompressionLevelSpecimenBuilder.cs new file mode 100644 index 0000000..440c3b7 --- /dev/null +++ b/czishrink/netczicompressTests/Customizations/CompressionLevelSpecimenBuilder.cs @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Customizations; + +using AutoFixture.Kernel; + +/// +/// CompressionLevel specimen builder that will create only valid CompressionLevels. +/// +/// +/// This builder depends on Min/Max values of CompressionLevel being public to avoid magic values. +/// +public class CompressionLevelSpecimenBuilder : ISpecimenBuilder +{ + public object Create(object request, ISpecimenContext context) + { + if (request is Type type && type == typeof(CompressionLevel)) + { + var value = new Random().Next(CompressionLevel.Minimum, CompressionLevel.Maximum + 1); + return new CompressionLevel { Value = value }; + } + + return new NoSpecimen(); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Customizations/CorrectValueObjectAutoDataAttribute.cs b/czishrink/netczicompressTests/Customizations/CorrectValueObjectAutoDataAttribute.cs new file mode 100644 index 0000000..8a943c6 --- /dev/null +++ b/czishrink/netczicompressTests/Customizations/CorrectValueObjectAutoDataAttribute.cs @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Customizations; + +public class CorrectValueObjectAutoDataAttribute : AutoDataAttribute +{ + public CorrectValueObjectAutoDataAttribute() + : base(() => + { + var fixture = new Fixture(); + fixture.Customizations.Add(new CompressionLevelSpecimenBuilder()); + fixture.Customizations.Add(new ThreadCountSpecimenBuilder()); + return fixture; + }) + { + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Customizations/ThreadCountSpecimenBuilder.cs b/czishrink/netczicompressTests/Customizations/ThreadCountSpecimenBuilder.cs new file mode 100644 index 0000000..334958c --- /dev/null +++ b/czishrink/netczicompressTests/Customizations/ThreadCountSpecimenBuilder.cs @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Customizations; + +using AutoFixture.Kernel; + +/// +/// specimen builder that will create only valid s. +/// +/// +/// This builder depends on Min/Max values of being public to avoid magic values. +/// +public class ThreadCountSpecimenBuilder : ISpecimenBuilder +{ + public object Create(object request, ISpecimenContext context) + { + if (request is Type type && type == typeof(ThreadCount)) + { + var value = new Random().Next(ThreadCount.Minimum, ThreadCount.Maximum + 1); + return new ThreadCount { Value = value }; + } + + return new NoSpecimen(); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Customizations/ValidInlineAutoData.cs b/czishrink/netczicompressTests/Customizations/ValidInlineAutoData.cs new file mode 100644 index 0000000..8e9ae2d --- /dev/null +++ b/czishrink/netczicompressTests/Customizations/ValidInlineAutoData.cs @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Customizations; + +using Xunit.Sdk; + +public class ValidInlineAutoData : CompositeDataAttribute +{ + public ValidInlineAutoData(params object[] values) + : base(new DataAttribute[] + { + new InlineDataAttribute(values), + new CorrectValueObjectAutoDataAttribute(), + }) + { + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/ExcludePropertiesByAttributeSelectionRule.cs b/czishrink/netczicompressTests/ExcludePropertiesByAttributeSelectionRule.cs new file mode 100644 index 0000000..7733fd0 --- /dev/null +++ b/czishrink/netczicompressTests/ExcludePropertiesByAttributeSelectionRule.cs @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests; + +using System.Collections.Generic; +using System.Reflection; +using global::FluentAssertions.Equivalency; + +/// +/// A selection rule that excludes all properties with a particular attribute. +/// +public class ExcludePropertiesByAttributeSelectionRule : IMemberSelectionRule +{ + private readonly Type attributeType; + + public ExcludePropertiesByAttributeSelectionRule(Type attributeType) + { + this.attributeType = attributeType; + } + + public bool IncludesMembers => false; + + public IEnumerable SelectMembers( + INode currentNode, + IEnumerable selectedMembers, + MemberSelectionContext context) + { + return from m in selectedMembers + where !this.IsPropertyWithExcludedAttribute(m) + select m; + } + + private bool IsPropertyWithExcludedAttribute(IMember member) + { + var prop = member.ReflectedType.GetProperty(member.Name); + var result = prop?.GetCustomAttributes(this.attributeType).Any() == true; + return result; + } +} diff --git a/czishrink/netczicompressTests/FluentAssertionsConfig.cs b/czishrink/netczicompressTests/FluentAssertionsConfig.cs new file mode 100644 index 0000000..6df4203 --- /dev/null +++ b/czishrink/netczicompressTests/FluentAssertionsConfig.cs @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests; + +using System.Runtime.CompilerServices; +using System.Runtime.Versioning; + +internal static class FluentAssertionsConfig +{ + [ModuleInitializer] + public static void SetDefaults() + { + AssertionOptions.AssertEquivalencyUsing( + options => options + .WithStrictOrdering() + .Using( + new ExcludePropertiesByAttributeSelectionRule( + typeof(OSPlatformAttribute)))); + } +} diff --git a/czishrink/netczicompressTests/Models/AggregateStatisticsTests.cs b/czishrink/netczicompressTests/Models/AggregateStatisticsTests.cs new file mode 100644 index 0000000..e451048 --- /dev/null +++ b/czishrink/netczicompressTests/Models/AggregateStatisticsTests.cs @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +/// +/// Tests for . +/// +public class AggregateStatisticsTests +{ + [Fact] + public void Empty_EqualsDefault() + { + AggregateStatistics.Empty.Should().Be(default(AggregateStatistics)); + } + + [Fact] + public void Empty_HasExpectedPropertyValues() + { + AggregateStatistics sut = AggregateStatistics.Empty; + sut.Should().BeEquivalentTo( + new AggregateStatistics + { + FilesWithErrors = 0, + FilesWithNoErrors = 0, + Duration = TimeSpan.Zero, + InputBytes = 0, + OutputBytes = 0, + }, + cfg => cfg.ComparingByMembers()); + + sut.DeltaBytes.Should().Be(0); + float.IsNaN(sut.OutputToInputRatio).Should().BeTrue(); + } + + [Theory] + [AutoData] + public void NonEmpty_HasExpectedCalculatedPropertyValues(AggregateStatistics sut) + { + sut.DeltaBytes.Should().Be(sut.OutputBytes - sut.InputBytes); + sut.OutputToInputRatio.Should().Be(1.0f * sut.OutputBytes / sut.InputBytes); + } + + [Fact] + public void ConcreteExample_HasExpectedCalculatedPropertyValues() + { + var sut = new AggregateStatistics + { + OutputBytes = 1500, + InputBytes = 2000, + }; + sut.DeltaBytes.Should().Be(-500); + sut.OutputToInputRatio.Should().Be(0.75f); + } +} diff --git a/czishrink/netczicompressTests/Models/AsyncEnumerableToObservableActionAdapterTests.cs b/czishrink/netczicompressTests/Models/AsyncEnumerableToObservableActionAdapterTests.cs new file mode 100644 index 0000000..4a03d6e --- /dev/null +++ b/czishrink/netczicompressTests/Models/AsyncEnumerableToObservableActionAdapterTests.cs @@ -0,0 +1,131 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Reactive.Threading.Tasks; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +using netczicompressTests.Models.Mocks; + +/// +/// Tests for . +/// +public class AsyncEnumerableToObservableActionAdapterTests +{ + [Theory] + [AutoData] + public async Task Start_WhenCalled_ReturnsItemsInSequenceAndCompletes(int[] data) + { + // ARRANGE + var sut = CreateSut(data); + + var recorder = new Recorder(); + sut.Output.Subscribe(recorder); + + // ACT + var task = sut.Output.ToTask(); + sut.Start(); + await task; + + // ASSERT + recorder.Data.Should().BeEquivalentTo(data); + } + + [Theory] + [AutoData] + public async Task Start_WhenCalledTwice_ThrowsInvalidOperationException(int[] data) + { + // ARRANGE + var sut = CreateSut(data); + var task = sut.Output.ToTask(); + sut.Start(); + + // ACT + Action act = () => sut.Start(); + + // ASSERT + act.Should().Throw().WithMessage("Start can only be called once."); + + // CLEANUP + await task; + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task Start_WhenCanceled_StopsAndReportsErrorInOutput(bool enumerableThrowsWhenCanceled) + { + // ARRANGE + using var cts = new CancellationTokenSource(); + var sut = CreateSut(Enumerable.Range(1, 10), enumerableThrowsWhenCanceled, cts.Token); + + Recorder recorder = new(); + sut.Output.Subscribe(recorder); + sut.Output.Subscribe( + onNext: x => + { + if (x == 5) + { + cts.Cancel(); + } + }, + onError: ex => { }); + + // ACT + var task = sut.Output.ToTask(); + sut.Start(); + + // ASSERT + if (enumerableThrowsWhenCanceled) + { + Func checkError = () => task; + await checkError.Should().ThrowAsync(); + recorder.Error.Should().BeOfType(); + } + else + { + await task; + recorder.Error.Should().BeNull(); + } + + recorder.Data.Should().BeEquivalentTo( + Enumerable.Range(1, 5)); + } + + private static AsyncEnumerableToObservableActionAdapter CreateSut( + IEnumerable data, + bool throwWhenCanceled = false, + CancellationToken? cancellationToken = null) + { + var token = cancellationToken ?? CancellationToken.None; + var sut = new AsyncEnumerableToObservableActionAdapter( + AsAsync(data, throwWhenCanceled, token), + token); + return sut; + } + + private static async IAsyncEnumerable AsAsync( + IEnumerable data, + bool throwWhenCanceled, + [EnumeratorCancellation] CancellationToken token) + { + await Task.Yield(); + foreach (var item in data) + { + if (throwWhenCanceled) + { + token.ThrowIfCancellationRequested(); + } + else if (token.IsCancellationRequested) + { + yield break; + } + + yield return item; + await Task.Yield(); + } + } +} diff --git a/czishrink/netczicompressTests/Models/CompositeObserverTests.cs b/czishrink/netczicompressTests/Models/CompositeObserverTests.cs new file mode 100644 index 0000000..e3e7ab7 --- /dev/null +++ b/czishrink/netczicompressTests/Models/CompositeObserverTests.cs @@ -0,0 +1,70 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +/// +/// Tests for . +/// +public class CompositeObserverTests +{ + [Fact] + public void OnCompleted_IsForwardedToAllObservers() + { + var observerMocks = CreateObserverMocks(); + + var sut = CompositeObserver.Create( + observerMocks.Select(x => x.Object).ToArray()); + + sut.OnCompleted(); + + foreach (var mock in observerMocks) + { + mock.Verify(x => x.OnCompleted(), Times.Once); + mock.VerifyNoOtherCalls(); + } + } + + [Fact] + public void OnNext_IsForwardedToAllObservers() + { + var observerMocks = CreateObserverMocks(); + + var sut = CompositeObserver.Create( + observerMocks.Select(x => x.Object).ToArray()); + + sut.OnNext(17); + sut.OnNext(17); + + foreach (var mock in observerMocks) + { + mock.Verify(x => x.OnNext(17), Times.Exactly(2)); + mock.VerifyNoOtherCalls(); + } + } + + [Fact] + public void OnError_IsForwardedToAllObservers() + { + var observerMocks = CreateObserverMocks(); + + var sut = CompositeObserver.Create( + observerMocks.Select(x => x.Object).ToArray()); + + var ex = new Exception("bla"); + sut.OnError(ex); + + foreach (var mock in observerMocks) + { + mock.Verify(x => x.OnError(ex), Times.Once); + mock.VerifyNoOtherCalls(); + } + } + + private static Mock>[] CreateObserverMocks() + { + var observerMocks = Enumerable.Range(1, 5).Select(i => new Mock>()).ToArray(); + return observerMocks; + } +} diff --git a/czishrink/netczicompressTests/Models/CompressionLevelTests.cs b/czishrink/netczicompressTests/Models/CompressionLevelTests.cs new file mode 100644 index 0000000..4ff193e --- /dev/null +++ b/czishrink/netczicompressTests/Models/CompressionLevelTests.cs @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +/// +/// Tests for . +/// +public class CompressionLevelTests +{ + [Fact] + public void DefaultConstructor_HasDefaultValue() + { + var sut = new CompressionLevel(); + sut.Value.Should().Be(CompressionLevel.DefaultValue); + } + + [Theory] + [InlineData(-1)] + [InlineData(23)] + [InlineData(-100)] + [InlineData(230)] + public void OutOfRange_ShouldThrowOutOfRangeException(int value) + { + var act = () => + { + var sut = new CompressionLevel() { Value = value }; + }; + + act.Should().Throw(); + } + + [Theory] + [InlineData(22)] + [InlineData(9)] + [InlineData(0)] + public void InRangeValue_ShouldBeEqual(int value) + { + var sut = new CompressionLevel() { Value = value }; + sut.Value.Should().Be(value); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Models/CompressorMessageTests.cs b/czishrink/netczicompressTests/Models/CompressorMessageTests.cs new file mode 100644 index 0000000..6d4204a --- /dev/null +++ b/czishrink/netczicompressTests/Models/CompressorMessageTests.cs @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.IO.Abstractions; + +/// +/// Tests for and its subclasses. +/// +public class CompressorMessageTests +{ + [Theory] + [InlineAutoData(0)] + public void SetZeroSizeInput_HasZeroSizeRatioAndDelta(long input, long output) + { + var fixture = new Fixture().Customize(new AutoMoqCustomization()); + var sut = new CompressorMessage.FileFinished( + fixture.Create(), + input, + output, + fixture.Create(), + null); + + sut.SizeDelta.Should().Be(output); + sut.SizeRatio.Should().Be(0); + } + + [Theory] + [AutoData] + public void CreateCompressionLevel_CalculatedPropertiesAreValid(long input, long output) + { + var fixture = new Fixture().Customize(new AutoMoqCustomization()); + var sut = new CompressorMessage.FileFinished( + fixture.Create(), + input, + output, + fixture.Create(), + null); + + sut.SizeInput.Should().Be(input); + sut.SizeOutput.Should().Be(output); + sut.SizeDelta.Should().Be(output - input); + sut.SizeRatio.Should().Be(input == 0 ? 0 : (decimal)output / input); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Models/CsvLogFileWriterTests.cs b/czishrink/netczicompressTests/Models/CsvLogFileWriterTests.cs new file mode 100644 index 0000000..f125fb4 --- /dev/null +++ b/czishrink/netczicompressTests/Models/CsvLogFileWriterTests.cs @@ -0,0 +1,103 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.IO.Abstractions; + +/// +/// Tests for . +/// +public class CsvLogFileWriterTests +{ + [Theory] + [InlineData(true)] + [InlineData(false)] + public void FullRun_ProducesExpectedText(bool error) + { + // ARRANGE + var data = new (string Path, long SizeIn, long SizeOut, TimeSpan? TimeElapsed, string? Error)[] + { + ("foo/bla/bla.czi", 100, 16, TimeSpan.Zero, null), + ("foo/bla/blub.czi", 1000, 1600, TimeSpan.Zero, null), + ("bar/bla/baz,; .CZI", 1000, 1600, null, "oops\nHere's another line."), + }; + + using var writer = new StringWriter(); + + var sut = new CsvLogFileWriter(writer); + + var messages = from item in data + select new CompressorMessage.FileFinished( + Mock.Of(x => x.FullName == item.Path), + item.SizeIn, + item.SizeOut, + item.TimeElapsed, + item.Error); + + // ACT + foreach (var item in messages) + { + sut.OnNext(item); + } + + if (error) + { + sut.OnError(new Exception()); + } + else + { + sut.OnCompleted(); + } + + // ASSERT + var csvFileContents = writer.ToString(); + var csvFileRows = csvFileContents.Split("\r\n"); + + csvFileRows.Should().BeEquivalentTo( + new[] + { + "InputFile,SizeInput,SizeOutput,SizeRatio,SizeDelta,TimeToProcess,Status,ErrorMessage", + "\"foo/bla/bla.czi\",100,16,0.16,-84,00:00:00,SUCCESS,", + "\"foo/bla/blub.czi\",1000,1600,1.6,600,00:00:00,SUCCESS,", + "\"bar/bla/baz,; .CZI\",1000,1600,,,,ERROR,\"oops\nHere's another line.\"", + string.Empty, + }); + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public void OnNext_WhenCalledAfterCompletion_ProducesNoResult(bool error) + { + // ARRANGE + using var writer = new StringWriter(); + + var sut = new CsvLogFileWriter(writer); + + if (error) + { + sut.OnError(new Exception()); + } + else + { + sut.OnCompleted(); + } + + // ACT + var message = new Fixture().Customize(new AutoMoqCustomization { ConfigureMembers = true }).Create(); + sut.OnNext(message); + + // ASSERT + var csvFileContents = writer.ToString(); + var csvFileRows = csvFileContents.Split("\r\n"); + + csvFileRows.Should().BeEquivalentTo( + new[] + { + "InputFile,SizeInput,SizeOutput,SizeRatio,SizeDelta,TimeToProcess,Status,ErrorMessage", + string.Empty, + }); + } +} diff --git a/czishrink/netczicompressTests/Models/CsvLoggingStrategyTests.cs b/czishrink/netczicompressTests/Models/CsvLoggingStrategyTests.cs new file mode 100644 index 0000000..94fea65 --- /dev/null +++ b/czishrink/netczicompressTests/Models/CsvLoggingStrategyTests.cs @@ -0,0 +1,152 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Diagnostics; +using System.IO.Abstractions; +using System.IO.Abstractions.TestingHelpers; + +/// +/// Tests for . +/// +public class CsvLoggingStrategyTests +{ + [Fact] + public void LoggerScheduler_WhenNotSet_ReturnsDefaultScheduler() + { + var sut = new CsvLoggingStrategy(Mock.Of()); + + sut.LoggerScheduler.Should().BeSameAs(DefaultScheduler.Instance); + } + + [Theory] + [AutoData] + public void CreateLogFile_WhenCalled_ProducesExpectedFileName(bool recursive, CompressionMode mode) + { + // ARRANGE + var schedulerMock = new Mock(MockBehavior.Strict); + + var sut = new CsvLoggingStrategy(Mock.Of()) + { + LoggerScheduler = schedulerMock.Object, + }; + + var fs = new MockFileSystem(new MockFileSystemOptions { CreateDefaultTempDir = true }); + + var outputDir = fs.Path.Combine(fs.Path.GetTempPath(), "foo"); + var runParameters = new FolderCompressorParameters( + new Mock(MockBehavior.Strict).Object, + fs.DirectoryInfo.New(outputDir), + recursive, + mode, + new ExecutionOptions(ThreadCount.Default), + new ProcessingOptions(CompressionLevel.Default)); + + schedulerMock.SetupGet(x => x.Now).Returns( + DateTimeOffset.Parse($"3067-11-14T23:59:59.1234")); + + // ACT + var actual = sut.CreateLogFile(runParameters); + + // ASSERT + var expected = fs.Path.Combine(outputDir, $"CziShrink_30671114T235959_{mode}.csv"); + actual.FullName.Should().Be(expected); + actual.Exists.Should().BeFalse(); + } + + [Theory] + [AutoData] + public async Task CreateLogFile_WhenCalled_ProducesUniqueFileName(bool recursive, CompressionMode mode) + { + // ARRANGE + DateTimeOffset now = DateTimeOffset.Parse($"3067-11-14T23:59:59.1234"); + var schedulerMock = new Mock(MockBehavior.Strict); + schedulerMock.SetupGet(x => x.Now).Returns(() => + { + lock (schedulerMock) + { + return now; + } + }); + + var sut = new CsvLoggingStrategy(Mock.Of()) + { + LoggerScheduler = schedulerMock.Object, + }; + + var fs = new MockFileSystem(new MockFileSystemOptions { CreateDefaultTempDir = true }); + + var outputDir = fs.Path.Combine(fs.Path.GetTempPath(), "foo"); + var runParameters = new FolderCompressorParameters( + new Mock(MockBehavior.Strict).Object, + fs.DirectoryInfo.New(outputDir), + recursive, + mode, + new ExecutionOptions(ThreadCount.Default), + new ProcessingOptions(CompressionLevel.Default)); + CreateFile(sut.CreateLogFile(runParameters)); + + // ACT + Task actTask = Task.Run(() => sut.CreateLogFile(runParameters)); + SpinWait.SpinUntil(() => actTask.Status == TaskStatus.Running); + await Task.Delay(10); + actTask.Status.Should().Be(TaskStatus.Running); + + lock (schedulerMock) + { + now += TimeSpan.FromSeconds(1.5); + } + + // ASSERT + var expected = fs.Path.Combine(outputDir, $"CziShrink_30671115T000000_{mode}.csv"); + var actual = await actTask; + actual.FullName.Should().Be(expected); + actual.Exists.Should().BeFalse(); + } + + [Fact] + public void CreateLogger_WhenCalled_CreatesCsvLogWriter() + { + // ARRANGE + var sut = new CsvLoggingStrategy(Mock.Of()); + + using var writer = Mock.Of(); + + // ACT + var actual = sut.CreateLogger(writer); + + // ASSERT + var result = actual.Should().BeOfType().Subject; + result.Writer.Should().BeSameAs(writer); + } + + [Fact] + public void OpenLogFile_WhenCalled_UsesFileLauncher() + { + // ARRANGE + var fileLauncherMock = new Mock(); + var sut = new CsvLoggingStrategy(fileLauncherMock.Object); + var fileInfo = Mock.Of(f => f.FullName == "/foo/bar/baz.CSV"); + + // ACT + sut.OpenLogFile(fileInfo); + + // ASSERT + fileLauncherMock.Verify(l => l.Launch("/foo/bar/baz.CSV"), Times.Once); + fileLauncherMock.VerifyNoOtherCalls(); + } + + private static void CreateFile(IFileInfo firstFile) + { + firstFile.Directory!.Create(); + using (var firstFileHandle = firstFile.AppendText()) + { + firstFileHandle.WriteLine("foo"); + } + + firstFile.Refresh(); + Debug.Assert(firstFile.Exists, "Error in ARRANGE"); + } +} diff --git a/czishrink/netczicompressTests/Models/FileLauncherTests.cs b/czishrink/netczicompressTests/Models/FileLauncherTests.cs new file mode 100644 index 0000000..76126d9 --- /dev/null +++ b/czishrink/netczicompressTests/Models/FileLauncherTests.cs @@ -0,0 +1,279 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Diagnostics; +using System.IO.Abstractions; +using System.Linq.Expressions; +using System.Runtime.InteropServices; + +/// +/// Tests for . +/// +public class FileLauncherTests +{ + [Fact] + public async Task Launch_WhenCalled_RunsExpectedProcess() + { + // ARRANGE + var sut = new TestableFileLauncher(); + var path = "/foo/bar/baz"; + + // ACT + await sut.Launch(path); + + // ASSERT + var runAsyncInvocationArgs = sut.GetRunAsyncInvocationsArgs(); + runAsyncInvocationArgs.Should().BeEquivalentTo( + new[] + { + new ProcessStartInfo + { + FileName = "/foo/bar/baz", + UseShellExecute = true, + }, + }); + } + + [Theory] + [InlineData(null, "explorer")] + [InlineData(@"C:\Fenster", @"C:\Fenster\explorer")] + public async Task Reveal_WhenWindows_RunsExpectedProcess( + string? systemRootEnvironmentVariableValue, + string expectedFileName) + { + // ARRANGE + string? overridePlatform = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + ? null + : "WINDOWS"; + + var getEnv = Mock.Of>( + x => x("SYSTEMROOT") == systemRootEnvironmentVariableValue); + + var sut = new TestableFileLauncher( + overridePlatform: overridePlatform, + fs: Mock.Of(x => x.Path == MockPathCombineWindows()), + getEnvironmentVariable: getEnv); + + var path = @"C:\foo bar\baz"; + + // ACT + await sut.Reveal(path); + + // ASSERT + var runAsyncInvocationArgs = sut.GetRunAsyncInvocationsArgs(); + runAsyncInvocationArgs.Should().BeEquivalentTo( + new[] + { + new ProcessStartInfo + { + FileName = expectedFileName, + Arguments = @"/select,""C:\foo bar\baz""", + }, + }); + } + + [Fact] + public async Task Reveal_WhenOsx_RunsExpectedProcess() + { + // ARRANGE + string? overridePlatform = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) + ? null + : "OSX"; + + var sut = new TestableFileLauncher( + overridePlatform: overridePlatform); + + var path = @"/foo bar/baz"; + + // ACT + await sut.Reveal(path); + + // ASSERT + var runAsyncInvocationArgs = sut.GetRunAsyncInvocationsArgs(); + runAsyncInvocationArgs.Should().BeEquivalentTo( + new[] + { + new ProcessStartInfo + { + FileName = "explorer", + Arguments = @"-R ""/foo bar/baz""", + }, + }); + } + + [Theory] + [InlineData("LINUX")] + [InlineData("SOLARIS")] + [InlineData("FREEBSD")] + [InlineData("NETBSD")] + public async Task Reveal_WhenLinux_RunsExpectedProcess(string platform) + { + // ARRANGE + string? overridePlatform = OperatingSystem.IsOSPlatform(platform) + ? null + : platform; + + var path = @"/foo/bar baz/xyz.czi"; + Func? overridePathToFileUri = OperatingSystem.IsOSPlatform(platform) + ? null + : Mock.Of>(f => f(path) == "file:///foo/bar%20baz/xyz.czi"); + + var sut = new TestableFileLauncher( + overridePathToFileUri: overridePathToFileUri, + overridePlatform: overridePlatform); + + // ACT + await sut.Reveal(path); + + // ASSERT + var runAsyncInvocationArgs = sut.GetRunAsyncInvocationsArgs(); + runAsyncInvocationArgs.Should().BeEquivalentTo( + new[] + { + new ProcessStartInfo + { + FileName = "dbus-send", + Arguments = @"--print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:""file:///foo/bar%20baz/xyz.czi"" string:""""", + UseShellExecute = true, + }, + }); + } + + [Theory] + [InlineData("LINUX")] + [InlineData("SOLARIS")] + [InlineData("FREEBSD")] + [InlineData("NETBSD")] + public async Task Reveal_WhenDbusSendReturnsNonZero_RunsExpectedProcess(string platform) + { + // ARRANGE + string? overridePlatform = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && platform == "LINUX" + ? null + : platform; + + var path = "/foo/bar baz/xyz.czi"; + Func? pathToFileUri = OperatingSystem.IsOSPlatform(platform) + ? null + : Mock.Of>(f => f(path) == "file:///foo/bar%20baz/xyz.czi"); + + var sut = new TestableFileLauncher( + fs: Mock.Of(x => x.Path.GetDirectoryName(path) == "/path/of/parent/dir"), + overridePathToFileUri: pathToFileUri, + overridePlatform: overridePlatform); + + var nonZeroExitCode = new Fixture().CreateMany().First(x => x != 0); + sut.SetupExitCode(p => p.FileName == "dbus-send", nonZeroExitCode); + + // ACT + await sut.Reveal(path); + + // ASSERT + var runAsyncInvocationArgs = sut.GetRunAsyncInvocationsArgs(); + runAsyncInvocationArgs.Should().BeEquivalentTo( + new[] + { + new ProcessStartInfo + { + FileName = "dbus-send", + Arguments = @"--print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:""file:///foo/bar%20baz/xyz.czi"" string:""""", + UseShellExecute = true, + }, + new ProcessStartInfo + { + FileName = "/path/of/parent/dir", + UseShellExecute = true, + }, + }); + } + + [Fact] + public async Task Reveal_WhenOtherOs_LaunchesParentFolder() + { + // ARRANGE + var path = "/foo/bar baz/xyz.czi"; + + var sut = new TestableFileLauncher( + fs: Mock.Of(x => x.Path.GetDirectoryName(path) == "/path/of/parent/dir"), + overridePlatform: "UNSUPPORTED"); + + // ACT + await sut.Reveal(path); + + // ASSERT + var runAsyncInvocationArgs = sut.GetRunAsyncInvocationsArgs(); + runAsyncInvocationArgs.Should().BeEquivalentTo( + new[] + { + new ProcessStartInfo + { + FileName = "/path/of/parent/dir", + UseShellExecute = true, + }, + }); + } + + private static IPath MockPathCombineWindows() + { + var pathMock = new Mock(); + pathMock + .Setup( + x => x.Combine(It.IsAny(), It.IsAny())) + .Returns( + (string a, string b) => $"{a}\\{b}"); + var pathMockObject = pathMock.Object; + return pathMockObject; + } + + private class TestableFileLauncher : FileLauncher + { + private readonly Func? pathToFileUri; + + public TestableFileLauncher( + IFileSystem? fs = null, + string? overridePlatform = null, + Func? overridePathToFileUri = null, + Func? getEnvironmentVariable = null) + : base( + fs ?? Mock.Of(), + getEnvironmentVariable ?? Mock.Of>()) + { + this.pathToFileUri = overridePathToFileUri; + this.CurrentPlatform = overridePlatform ?? this.CurrentPlatform; + this.RunAsyncMock = new Mock>>(); + this.RunAsyncMock + .Setup(x => x.Invoke(It.IsAny())) + .Returns(Task.FromResult(0)); + } + + public Mock>> RunAsyncMock { get; } + + public ProcessStartInfo[] GetRunAsyncInvocationsArgs() + { + var result = from invocation in this.RunAsyncMock.Invocations + select invocation.Arguments.Cast().Single(); + return result.ToArray(); + } + + public void SetupExitCode(Expression> processStartInfoSelector, int exitCode) + { + this.RunAsyncMock + .Setup( + x => x.Invoke(It.Is(processStartInfoSelector))) + .Returns(Task.FromResult(exitCode)); + } + + protected override Task RunAsync(ProcessStartInfo processStartInfo) + { + return this.RunAsyncMock.Object.Invoke(processStartInfo); + } + + protected override string PathToFileUri(string path) + { + return this.pathToFileUri?.Invoke(path) + ?? base.PathToFileUri(path); + } + } +} diff --git a/czishrink/netczicompressTests/Models/FileProcessingFailedHandlerTests.cs b/czishrink/netczicompressTests/Models/FileProcessingFailedHandlerTests.cs new file mode 100644 index 0000000..5a4ebb1 --- /dev/null +++ b/czishrink/netczicompressTests/Models/FileProcessingFailedHandlerTests.cs @@ -0,0 +1,88 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.IO.Abstractions; +using System.Reactive.Disposables; + +/// +/// Unit tests for the class. +/// +public class FileProcessingFailedHandlerTests +{ + [Theory] + [InlineData(true)] + [InlineData(false)] + public void OnFileProcessingFailed_WithDifferentOptions_ReturnsCorrectValue(bool copyFailedFiles) + { + // Arrange + string fileName = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); + var inputFileName = $"{fileName}.czi"; + using var deleteInput = DeleteLater(inputFileName); + var inputFile = CreateFileInfo(inputFileName); + var inputFileInfo = new FileInfo(inputFileName); + using var inputStream = inputFileInfo.Create(); + inputStream.WriteByte(5); + inputStream.Close(); + + var outputFileName = $"{fileName}_out.czi"; + using var deleteOutput = DeleteLater(outputFileName); + + var tempOutputFileName = $"{fileName}_temp.czi"; + using var deleteTempOutput = DeleteLater(tempOutputFileName); + + var target = new FileProcessingFailedHandler(); + string innerException = "Something bad happened."; + int reportedProgress = -1; + + // Act + var result = target.FileProcessingFailed( + inputFile, + CreateFileInfo(outputFileName), + CreateFileInfo(tempOutputFileName), + progress => reportedProgress = progress, + innerException, + copyFailedFiles, + CancellationToken.None); + + // Assert + result.Should().Be(copyFailedFiles ? $"{innerException} {FileProcessingFailedHandler.SuccessfulCopyMessage}" : innerException); + reportedProgress.Should().Be(copyFailedFiles ? 100 : -1); + } + + [Fact] + public void OnFileProcessingFailed_WithCopyOptionAndFailedCopyOperation_ReturnsCorrectValue() + { + // Arrange + var target = new FileProcessingFailedHandler(); + var inFile = new Mock(); + inFile.Setup(x => x.CopyTo(It.IsAny(), It.IsAny())).Throws(); + var outFile = new Mock(); + var tempOutFile = new Mock(); + string innerException = "Something bad happened."; + + // Act + var result = target.FileProcessingFailed( + inFile.Object, + outFile.Object, + tempOutFile.Object, + _ => { }, + innerException, + true, + CancellationToken.None); + + // Assert + result.Should().Be($"{innerException} {FileProcessingFailedHandler.FailedCopyMessage}"); + } + + private static IFileInfo CreateFileInfo(string fileName) + { + var fileInfo = new Mock(); + fileInfo.Setup(x => x.FullName).Returns(fileName); + return fileInfo.Object; + } + + private static IDisposable DeleteLater(string path) => Disposable.Create(() => File.Delete(path)); +} diff --git a/czishrink/netczicompressTests/Models/FolderCompressorDecoratorTests.cs b/czishrink/netczicompressTests/Models/FolderCompressorDecoratorTests.cs new file mode 100644 index 0000000..98a6c3e --- /dev/null +++ b/czishrink/netczicompressTests/Models/FolderCompressorDecoratorTests.cs @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using netczicompressTests.Customizations; + +using IFolderCompressorRun = netczicompress.Models.IObservableAction; + +/// +/// Tests for . +/// +public class FolderCompressorDecoratorTests +{ + [Fact] + public void PrepareNewRun_WhenCalled_CallsObserveRunWithExpectedArgs() + { + // ARRANGE + var strictMocks = new MockRepository(MockBehavior.Strict); + var coreMock = strictMocks.Create(); + var observeRun = new Mock>>(); + var coreOutput = strictMocks.OneOf>(); + var observableAction = strictMocks.OneOf( + x => x.Output == coreOutput); + + var fixture = new Fixture().Customize(new AutoMoqCustomization()); + fixture.Customizations.Add(new CompressionLevelSpecimenBuilder()); + fixture.Customizations.Add(new ThreadCountSpecimenBuilder()); + var p = fixture.Create(); + var t = fixture.Create(); + coreMock + .Setup(x => x.PrepareNewRun(p, t)) + .Returns(observableAction) + .Verifiable(Times.Once); + + var sut = new FolderCompressorDecorator + { + Core = coreMock.Object, + ObserveRun = observeRun.Object, + }; + + // ACT + var actual = sut.PrepareNewRun(p, t); + + // ASSERT + actual.Should().BeSameAs(observableAction); + coreMock.Verify(); + observeRun.Verify(d => d.Invoke(p, coreOutput), Times.Once); + observeRun.VerifyNoOtherCalls(); + } +} diff --git a/czishrink/netczicompressTests/Models/FolderCompressorExtensionsTests.cs b/czishrink/netczicompressTests/Models/FolderCompressorExtensionsTests.cs new file mode 100644 index 0000000..b3eacf3 --- /dev/null +++ b/czishrink/netczicompressTests/Models/FolderCompressorExtensionsTests.cs @@ -0,0 +1,98 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using netczicompressTests.Customizations; +using netczicompressTests.Models.Mocks; +using static netczicompress.Models.CompressorMessage; +using IFolderCompressorRun = netczicompress.Models.IObservableAction; + +/// +/// Tests for . +/// +public class FolderCompressorExtensionsTests +{ + [Fact] + public void DecorateWithRunObserver_WhenCalled_ReportsMessagesFromRunToObserver() + { + // ARRANGE + var fixture = new Fixture().Customize(new AutoMoqCustomization()); + fixture.Customizations.Add(new ThreadCountSpecimenBuilder()); + var p = fixture.Create(); + var t = fixture.Create(); + + IEnumerable runData = CreateMixedMessages(fixture); + + var runMock = new Mock().WithData(runData); + + var coreMock = new Mock(); + coreMock + .Setup(x => x.PrepareNewRun(p, t)) + .Returns(runMock.Object) + .Verifiable(Times.Once); + + var recorder = new Recorder(); + var runObserverMock = new Mock>(); + runObserverMock + .Setup( + x => x.ObserveRun(p, It.IsAny>())) + .Callback>( + (pp, obs) => obs.Subscribe(recorder)) + .Verifiable(Times.Once); + + var sut = coreMock.Object.DecorateWithRunObserver(runObserverMock.Object); + + // ACT + sut.PrepareNewRun(p, t).Start(); + + // ASSERT + coreMock.Verify(); + runObserverMock.Verify(); + recorder.Data.Should().BeEquivalentTo( + runData.OfType(), + cfg => cfg.WithoutStrictOrdering()); + } + + [Fact] + public void DecorateWithObserver_WhenCalled_ReportsMessagesFromRunToObserver() + { + // ARRANGE + var fixture = new Fixture().Customize(new AutoMoqCustomization()); + fixture.Customizations.Add(new ThreadCountSpecimenBuilder()); + var p = fixture.Create(); + var t = fixture.Create(); + + var runData = CreateMixedMessages(fixture); + + var runMock = new Mock().WithData(runData); + + var coreMock = new Mock(); + coreMock + .Setup(x => x.PrepareNewRun(p, t)) + .Returns(runMock.Object) + .Verifiable(Times.Once); + + var recorder = new Recorder(); + + var sut = coreMock.Object.DecorateWithObserver(recorder, Scheduler.Immediate); + + // ACT + sut.PrepareNewRun(p, t).Start(); + + // ASSERT + coreMock.Verify(); + recorder.Data.Should().BeEquivalentTo( + runData.OfType(), + cfg => cfg.WithoutStrictOrdering()); + } + + private static IEnumerable CreateMixedMessages(IFixture fixture) + { + return fixture.CreateMany(5).Cast() + .Concat(fixture.CreateMany(3)) + .Concat(fixture.CreateMany(5)) + .Concat(fixture.CreateMany(8)).ToArray(); + } +} diff --git a/czishrink/netczicompressTests/Models/Mocks/FileProcessorMockExtensions.cs b/czishrink/netczicompressTests/Models/Mocks/FileProcessorMockExtensions.cs new file mode 100644 index 0000000..0edb8fa --- /dev/null +++ b/czishrink/netczicompressTests/Models/Mocks/FileProcessorMockExtensions.cs @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models.Mocks; + +/// +/// Extension method for mocks of and collections thereof. +/// +internal static class FileProcessorMockExtensions +{ + public static Mock WithProcessFile( + this Mock mock, + Action processFile) + { + mock + .Setup(x => x.ProcessFile(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Callback(processFile); + return mock; + } + + public static T CheckCount(this T listOfCreatedProcessors, int maxCount) + where T : IReadOnlyCollection> + { + listOfCreatedProcessors.Count.Should().BeLessThanOrEqualTo(maxCount); + return listOfCreatedProcessors; + } + + public static IEnumerable<(string InputFile, string OutputFile)> GetProcessedFileArgs(this Mock p) + { + var allArgses = from invocation in p.Invocations + where invocation.Method.Name == nameof(IFileProcessor.ProcessFile) + select invocation.Arguments; + + var filenameArgses = from args in allArgses + select ((string)args[0], (string)args[1]); + + return filenameArgses; + } + + public static T CheckDisposed(this T processors) + where T : IEnumerable> + { + // check all disposables have been disposed + foreach (var d in processors) + { + d.Verify(x => x.Dispose(), Times.Once); + } + + return processors; + } +} diff --git a/czishrink/netczicompressTests/Models/Mocks/FolderCompressorMockExtensions.cs b/czishrink/netczicompressTests/Models/Mocks/FolderCompressorMockExtensions.cs new file mode 100644 index 0000000..d393efe --- /dev/null +++ b/czishrink/netczicompressTests/Models/Mocks/FolderCompressorMockExtensions.cs @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models.Mocks; + +using AutoFixture; + +using IFolderCompressorRun = netczicompress.Models.IObservableAction; + +public static class FolderCompressorMockExtensions +{ + public static Mock WithRun(this Mock self, IFolderCompressorRun run) + { + self + .Setup(x => x.PrepareNewRun(It.IsAny(), It.IsAny())) + .Returns(run); + return self; + } + + public static Mock WithData(this Mock self, IEnumerable messages) + { + var runMock = new Mock().WithData(messages); + return self.WithRun(runMock.Object); + } + + public static Mock WithAutoData(this Mock self, IFixture fixture) + { + IEnumerable messages = + fixture.CreateMany(); + messages = messages.Concat( + fixture.CreateMany()); + + var runMock = new Mock().WithData(messages); + return self.WithRun(runMock.Object); + } + + public static Mock WithException(this Mock self, Exception ex) + { + var runMock = new Mock().WithException(ex); + return self.WithRun(runMock.Object); + } + + public static Mock WithWaitForCancellation(this Mock self) + { + self + .Setup( + x => x.PrepareNewRun(It.IsAny(), It.IsAny())) + .Returns( + (_, token) => new Mock().WithWaitForCancellation(token).Object); + return self; + } +} diff --git a/czishrink/netczicompressTests/Models/Mocks/FolderCompressorRunMockExtensions.cs b/czishrink/netczicompressTests/Models/Mocks/FolderCompressorRunMockExtensions.cs new file mode 100644 index 0000000..0c73082 --- /dev/null +++ b/czishrink/netczicompressTests/Models/Mocks/FolderCompressorRunMockExtensions.cs @@ -0,0 +1,62 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models.Mocks; + +using System.Reactive.Subjects; + +using IFolderCompressorRun = netczicompress.Models.IObservableAction; + +public static class FolderCompressorRunMockExtensions +{ + public static Mock> WithData(this Mock> runMock, IEnumerable messages) + { + var subject = new Subject(); + runMock.SetupGet(x => x.Output).Returns(subject.AsObservable()); + runMock + .Setup(x => x.Start()) + .Callback(() => subject.OnNextAllAndComplete(messages)); + return runMock; + } + + public static Mock WithException(this Mock runMock, Exception ex) + { + var subject = new Subject(); + runMock.SetupGet(x => x.Output).Returns(subject.AsObservable()); + runMock + .Setup(x => x.Start()) + .Callback(() => subject.OnError(ex)); + return runMock; + } + + public static Mock WithWaitForCancellation( + this Mock runMock, + CancellationToken token) + { + var subject = new Subject(); + runMock.SetupGet(x => x.Output).Returns(subject.AsObservable()); + runMock + .Setup(x => x.Start()) + .Callback(() => + { + token.Register(() => + { + try + { + token.ThrowIfCancellationRequested(); + } + catch (OperationCanceledException ex) + { + subject.OnError(ex); + } + }); + }); + return runMock; + } + + public static IObservableAction ToObservableAction(this IEnumerable messages) + { + return new Mock>().WithData(messages).Object; + } +} diff --git a/czishrink/netczicompressTests/Models/Mocks/ObservableExtensions.cs b/czishrink/netczicompressTests/Models/Mocks/ObservableExtensions.cs new file mode 100644 index 0000000..67bc023 --- /dev/null +++ b/czishrink/netczicompressTests/Models/Mocks/ObservableExtensions.cs @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models.Mocks; + +public static class ObservableExtensions +{ + public static Recorder StartRecording(this IObservable source) + { + var result = new Recorder(); + _ = source.Subscribe(result); + return result; + } + + public static void OnNextAll(this IObserver observer, IEnumerable values) + { + foreach (var item in values) + { + observer.OnNext(item); + } + } + + public static void OnNextAllAndComplete(this IObserver observer, IEnumerable values) + { + observer.OnNextAll(values); + observer.OnCompleted(); + } +} diff --git a/czishrink/netczicompressTests/Models/Mocks/ProgressRecorder.cs b/czishrink/netczicompressTests/Models/Mocks/ProgressRecorder.cs new file mode 100644 index 0000000..0bccf58 --- /dev/null +++ b/czishrink/netczicompressTests/Models/Mocks/ProgressRecorder.cs @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models.Mocks; + +using System.Collections.Concurrent; + +/// +/// Records all progress messages from an run. +/// +internal class ProgressRecorder : IObserver +{ + public ConcurrentDictionary> ProgressValuesByFile { get; } = new(); + + public void OnCompleted() + { + } + + public void OnError(Exception error) + { + } + + public void OnNext(CompressorMessage.FileStarting value) + { + this.RecordProgress(value); + } + + private void RecordProgressValue(string file, int p) + { + var progressValuesForFile = this.ProgressValuesByFile.GetOrAdd(file, new List()); + progressValuesForFile.Add(p); + } + + private void RecordProgress(CompressorMessage.FileStarting fileStarting) + { + fileStarting.ProgressPercent.Subscribe( + p => this.RecordProgressValue(fileStarting.InputFile.FullName, p)); + } +} diff --git a/czishrink/netczicompressTests/Models/Mocks/Recorder{T}.cs b/czishrink/netczicompressTests/Models/Mocks/Recorder{T}.cs new file mode 100644 index 0000000..d6f5dbb --- /dev/null +++ b/czishrink/netczicompressTests/Models/Mocks/Recorder{T}.cs @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models.Mocks; + +public class Recorder : IObserver +{ + public List Data { get; } = new(); + + public bool Completed { get; private set; } + + public Exception? Error { get; private set; } + + public void OnCompleted() + { + this.Completed = true; + } + + public void OnError(Exception error) + { + this.Error = error; + } + + public void OnNext(T value) + { + if (this.Completed || this.Error != null) + { + throw new InvalidOperationException(); + } + + this.Data.Add(value); + } +} diff --git a/czishrink/netczicompressTests/Models/Mocks/SchedulerMock.cs b/czishrink/netczicompressTests/Models/Mocks/SchedulerMock.cs new file mode 100644 index 0000000..18fef00 --- /dev/null +++ b/czishrink/netczicompressTests/Models/Mocks/SchedulerMock.cs @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models.Mocks; + +using System.Reactive.Concurrency; +using System.Reactive.Disposables; + +/// +/// A scheduler whose queue must be run explicitly. +/// +public class SchedulerMock : IScheduler +{ + public DateTimeOffset Now => DateTimeOffset.Now; + + private Queue Queue { get; } = new(); + + public void RunQueuedActions() + { + while (this.Queue.TryDequeue(out var action)) + { + action(); + } + } + + public IDisposable Schedule(TState state, Func action) + { + this.Queue.Enqueue(() => _ = action(this, state)); + return Disposable.Empty; + } + + public IDisposable Schedule(TState state, TimeSpan dueTime, Func action) + { + throw new NotImplementedException(); + } + + public IDisposable Schedule(TState state, DateTimeOffset dueTime, Func action) + { + throw new NotImplementedException(); + } +} diff --git a/czishrink/netczicompressTests/Models/MultiThreadedFolderCompressorTests.cs b/czishrink/netczicompressTests/Models/MultiThreadedFolderCompressorTests.cs new file mode 100644 index 0000000..aaca2b1 --- /dev/null +++ b/czishrink/netczicompressTests/Models/MultiThreadedFolderCompressorTests.cs @@ -0,0 +1,622 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO.Abstractions; +using System.IO.Abstractions.TestingHelpers; +using System.Reactive.Threading.Tasks; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text.RegularExpressions; + +using netczicompressTests.Customizations; + +using netczicompressTests.Models.Mocks; + +/// +/// Tests for . +/// +public class MultiThreadedFolderCompressorTests +{ + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task WhenProcessorNeedsOutputDirs_RunCreatesOutputDirs(bool needsOutputDir) + { + // ARRANGE + var processor = Mock.Of(x => x.NeedsExistingOutputDirectory == needsOutputDir); + var ff = new FoldersAndFiles( + @"C:\inputDir", + @"X:\outputDir", + @"C:\inputDir\subDir\image-1.czi", + @"C:\inputDir\subDir\image-2.czi", + @"X:\outputDir\blabla.text"); + + var sut = CreateSut((_, _) => processor); + + var run = sut.PrepareNewRun( + ff.GetFolderCompressorParameters(), + CancellationToken.None); + + // ACT + Task t = run.Output.ToTask(); + run.Start(); + await t; + + // ASSERT + var fs = ff.FileSystem; + var outputSubDir = fs.DirectoryInfo.New( + fs.Path.Combine(ff.OutputDir.FullName, "subDir")); + outputSubDir.Exists.Should().Be(needsOutputDir); + } + + [Theory] + [CorrectValueObjectAutoData] + public async Task WhenRunCompletes_ThenProcessFileHasBeenCalledWithCorrectFileArgs(CompressionMode mode, ExecutionOptions executionOptions, ProcessingOptions processingOptions) + { + var ff = new FoldersAndFiles( + @"C:\inputDir", + @"D:\outputDir", + @"C:\inputDir\subDir\image-1.czi", + @"C:\inputDir\subDir\image-2.czi", + @"C:\inputDir\subDir\image-3.czi", + @"C:\inputDir\subDir2\image-4.czi", + @"C:\inputDir\subDir3\image-5.czi", + @"C:\inputDir\subDir4\ € 123,;!.czi", + @"C:\inputDir\subDir4\image-6.tiff", + @"C:\inputDir\subDir\image-7.czi", + @"D:\outputDir\blabla.czi"); + + await WhenRunCompletes_ThenProcessFileHasBeenCalledWithCorrectFileArgsImpl(mode, executionOptions, processingOptions, ff); + } + + [Theory] + [CorrectValueObjectAutoData] + public async Task WhenRunCompletes_ThenProgressHasBeenReportedForAllFiles( + CompressionMode mode, + ExecutionOptions executionOptions, + ProcessingOptions processingOptions) + { + // ARRANGE + int ProgressForFile(string inputPath) => 1 + (Math.Abs(inputPath.GetHashCode()) % 99); + + var progressRecorder = new ProgressRecorder(); + var processorFactory = CreateProcessorFactory( + mode, + processingOptions, + onMockCreated: m => m.WithProcessFile((inputPath, _, reportProgress, _) => + reportProgress(ProgressForFile(inputPath)))); + + var ff = new FoldersAndFiles( + @"C:\inputDir", + @"C:\outputDir", + @"C:\inputDir\subDir\image.czi", + @"C:\inputDir\subDir\image-2.czi", + @"C:\inputDir\subDir\image-3.czi", + @"C:\inputDir\subDir2\image.czi", + @"C:\inputDir\subDir3\image-5.czi", + @"C:\inputDir\subDir4\image-6.czi", + @"C:\inputDir\subDir\image-7.czi", + @"C:\outputDir\blabla.text"); + var czis = ff.InitialFiles.Where(f => f.EndsWith(".czi")).ToArray(); + + var sut = CreateSut(processorFactory); + + var run = sut.PrepareNewRun( + ff.GetFolderCompressorParameters(mode, executionOptions, processingOptions), + CancellationToken.None); + + run + .Output + .OfType() + .Subscribe(progressRecorder); + + // ACT + Task t = run.Output.ToTask(); + run.Start(); + await t; + + // ASSERT + progressRecorder.ProgressValuesByFile.Count.Should().Be(czis.Length); + foreach (var file in czis) + { + progressRecorder.ProgressValuesByFile[file] + .Should() + .BeEquivalentTo( + new[] { 0, ProgressForFile(file), 100 }); + } + } + + [Theory] + [CorrectValueObjectAutoData] + public async Task WhenRunCompletes_ThenHasNotProcessedAnyFilesCreatedDuringTheRun( + CompressionMode mode, ExecutionOptions executionOptions, ProcessingOptions processingOptions) + { + // Now outputDir is a subdirectory of inputDir. Files created there must not be processed. + var ff = new FoldersAndFiles( + @"C:\inputDir", + @"C:\inputDir\subDir4\outputDir", + @"C:\inputDir\subDir\image-1.czi", + @"C:\inputDir\subDir\image-2.czi", + @"C:\inputDir\subDir\image-3.czi", + @"C:\inputDir\subDir2\image-4.czi", + @"C:\inputDir\subDir3\image-5.czi", + @"C:\inputDir\subDir4\image-6.czi", + @"C:\inputDir\subDir\image-7.czi", + @"D:\outputDir\blabla.text"); + + void ConfigureProcessor(Mock mock) + { + mock.WithProcessFile((inp, outp, _, _) => ff.FileSystem.File.Copy(inp, outp)); + mock.SetupGet(p => p.NeedsExistingOutputDirectory).Returns(true); + } + + await WhenRunCompletes_ThenProcessFileHasBeenCalledWithCorrectFileArgsImpl(mode, executionOptions, processingOptions, ff, ConfigureProcessor, true); + } + + [Theory] + [ValidInlineAutoData(true)] + [ValidInlineAutoData(false)] + public async Task WhenCanceled_ThenDisposesAllProcessorsAndThrows( + bool processFileThrows, + CompressionMode mode, + ExecutionOptions executionOptions, + ProcessingOptions processingOptions) + { + var ff = new FoldersAndFiles( + @"C:\inputDir", + @"C:\outputDir", + @"C:\inputDir\subDir\image.czi", + @"C:\inputDir\subDir\image-2.czi", + @"C:\inputDir\subDir\image-3.czi", + @"C:\inputDir\subDir2\image.czi", + @"C:\inputDir\subDir3\image-5.czi", + @"C:\inputDir\subDir4\image-6.czi", + @"C:\inputDir\subDir\image-7.czi", + @"C:\outputDir\blabla.text"); + + // Auto-data does not work here without adaption. + // In the gitlab runners the maximum thread number is 2, on local machines there might be 28 threads or more + // available. + // We need to bound the number of threads by the number of czi-files, mind that one of the initial files is no czi. + var numOfCziFiles = ff.InitialFiles.Length - 1; + executionOptions = new ExecutionOptions(new ThreadCount() + { Value = Math.Min(executionOptions.ThreadCount.Value, numOfCziFiles) }); + + // ARRANGE + using var cts = new CancellationTokenSource(); + ConcurrentBag> processors = new(); + bool disposedDuringProcessing = false; + var processorFactory = CreateProcessorFactory(mode, processingOptions, onMockCreated: p => + { + processors.Add(p); + p.WithProcessFile((_, _, _, cancellationToken) => + { + cancellationToken.WaitHandle.WaitOne(); + Thread.Sleep(20); + if (p.Invocations.Any(inv => inv.Method.Name == nameof(IDisposable.Dispose))) + { + disposedDuringProcessing = true; + } + + if (processFileThrows) + { + cancellationToken.ThrowIfCancellationRequested(); + } + }); + + if (processors.Count == executionOptions.ThreadCount.Value) + { + cts.Cancel(); + } + }); + + var sut = CreateSut(processorFactory); + + var run = sut.PrepareNewRun( + ff.GetFolderCompressorParameters(mode, executionOptions, processingOptions), + cts.Token); + + // ACT + Task t = run.Output.ToTask(); + run.Start(); + Func act = () => t; + await act.Should().ThrowAsync(); + + // ASSERT + disposedDuringProcessing.Should().BeFalse(); + processors + .CheckCount(maxCount: executionOptions.ThreadCount.Value) + .CheckDisposed(); + } + + [Theory] + [CorrectValueObjectAutoData] + public async Task WhenNoTemporaryOutputFileCouldBeCreated_ThenProducesExpectedMessages( + CompressionMode mode, + ProcessingOptions processingOptions) + { + // ARRANGE + // this does not work on my local machine with other tested values than 1. + ExecutionOptions executionOptions = new ExecutionOptions(new ThreadCount() { Value = 1 }); + var ff = new FoldersAndFiles( + @"C:\inputDir", + @"C:\outputDir", + true, + @"C:\inputDir\image.czi", + @"C:\outputDir\image.czi~", + @"C:\outputDir\image.czi~1", + @"C:\outputDir\image.czi~2", + @"C:\outputDir\image.czi~3", + @"C:\outputDir\subDir\image.czi~4"); + + var processorFactory = CreateProcessorFactory( + mode, + processingOptions, + onMockCreated: m => { }); + + var sut = CreateSut(processorFactory); + + var run = sut.PrepareNewRun( + ff.GetFolderCompressorParameters(mode, executionOptions, processingOptions), + CancellationToken.None); + + var task = run.Output.ToTask(); + var recorder = new Recorder(); + using var subscription = run.Output + .OfType() + .Subscribe(recorder); + + // ACT + run.Start(); + await task; + + // ASSERT + CompressorMessage.FileFinished GetExpectation(IFileInfo inputInfo) + { + var filename = FoldersAndFiles.ToPlatformPath(@"C:\outputDir\image.czi~3"); + var error = $@"Could not delete existing temporary file {filename}."; + long expectedOutputSize = 0; + + return new CompressorMessage.FileFinished( + inputInfo, + inputInfo.Length, + expectedOutputSize, + null, + error); + } + + var inputFileName = FoldersAndFiles.ToPlatformPath(@"C:\inputDir\image.czi"); + var inputFile = ff!.FileSystem.FileInfo.New(inputFileName); + + var expectation = GetExpectation(inputFile); + + var actualAsStrings = from item in recorder.Data select item.ToString(); + var actualAsStringsWithoutTimeElapsed = actualAsStrings.Select(x => RemoveTimeStamp(x)); + Collection expectationAsStrings = new(); + expectationAsStrings.Add(expectation.ToString()); + + // TODO: debug this, this seems to fail sometimes as the order of files/outputs seems not to be fixed. + actualAsStringsWithoutTimeElapsed.Should().BeEquivalentTo( + expectationAsStrings, + compare => compare.WithoutStrictOrdering()); + } + + [Theory] + [CorrectValueObjectAutoData] + public async Task WhenOneOutputFileExists_ThenProducesExpectedMessages( + CompressionMode mode, + ProcessingOptions processingOptions) + { + // ARRANGE + // this does not work on my local machine with other tested values than 1. + ExecutionOptions executionOptions = new ExecutionOptions(new ThreadCount() { Value = 1 }); + var ff = new FoldersAndFiles( + @"C:\inputDir", + @"C:\outputDir", + @"C:\inputDir\subDir\image.czi", + @"C:\inputDir\subDir\image-3.czi", + @"C:\inputDir\subDir2\image.czi", + @"C:\inputDir\subDir3\image-6.czi", + @"C:\inputDir\subDir4\image-6.czi", + @"C:\outputDir\subDir\image-3.czi"); + + static IOException? GetErrorForFile(string path) => + path.EndsWith("6.czi") ? new IOException("FooBar " + path) : null; + + var processorFactory = CreateProcessorFactory( + mode, + processingOptions, + onMockCreated: m => + { + m.WithProcessFile( + (inputPath, outputPath, _, _) => + { + var ex = GetErrorForFile(inputPath); + if (ex != null) + { + throw ex; + } + + lock (ff.FileSystem) + { + ff.FileSystem.File.AppendAllText( + outputPath, + inputPath + inputPath); + } + }); + m.SetupGet(x => x.NeedsExistingOutputDirectory).Returns(true); + }); + + var sut = CreateSut(processorFactory); + + var run = sut.PrepareNewRun( + ff.GetFolderCompressorParameters(mode, executionOptions, processingOptions), + CancellationToken.None); + + var task = run.Output.ToTask(); + var recorder = new Recorder(); + using var subscription = run.Output + .OfType() + .Subscribe(recorder); + + // ACT + run.Start(); + await task; + + // ASSERT + CompressorMessage.FileFinished GetExpectation(string inputFile) + { + var fileInfo = ff!.FileSystem.FileInfo.New(inputFile); + var error = GetErrorForFile(inputFile)?.Message; + long expectedOutputSize = error == null ? fileInfo.Length * 2 : 0; + + if (inputFile.EndsWith("image-3.czi")) + { + // output file exists + var outputFile = inputFile.Replace(ff.InputDir.FullName, ff.OutputDir.FullName); + error = $"Output file {outputFile} already exists."; + expectedOutputSize = fileInfo.Length + 1; // unchanged from initial file + } + + return new CompressorMessage.FileFinished( + fileInfo, + fileInfo.Length, + expectedOutputSize, + null, + error); + } + + var expectation = from path in ff.InitialFiles + where path.EndsWith(".czi") && path.StartsWith(ff.InputDir.FullName) + select GetExpectation(path); + + var actualAsStrings = from item in recorder.Data select item.ToString(); + var actualAsStringsWithoutTimeElapsed = actualAsStrings.Select(x => RemoveTimeStamp(x)); + var expectationAsStrings = from item in expectation select item.ToString(); + + // TODO: debug this, this seems to fail sometimes as the order of files/outputs seems not to be fixed. + actualAsStringsWithoutTimeElapsed.Should().BeEquivalentTo( + expectationAsStrings, + compare => compare.WithoutStrictOrdering()); + } + + private static string RemoveTimeStamp(string target) + { + const string timeElapsedPattern = $"\\b{nameof(CompressorMessage.FileFinished.TimeElapsed)}[^\\r\\n,]*,"; + const string timeElapsedReplacement = $"{nameof(CompressorMessage.FileFinished.TimeElapsed)} = ,"; + return Regex.Replace(target, timeElapsedPattern, timeElapsedReplacement); + } + + private static async Task WhenRunCompletes_ThenProcessFileHasBeenCalledWithCorrectFileArgsImpl( + CompressionMode mode, + ExecutionOptions executionOptions, + ProcessingOptions processingOptions, + FoldersAndFiles ff, + Action>? configureProcessor = null, + bool forceLazyFileSystemEnumeration = false) + { + // ARRANGE + ConcurrentBag> processors = new(); + var processorFactory = CreateProcessorFactory( + mode, + processingOptions, + onMockCreated: p => + { + processors.Add(p); + configureProcessor?.Invoke(p); + }); + string GetExpectedOutputPath(string f) => f.Replace(ff.InputDir.FullName, ff.OutputDir.FullName); + + MultiThreadedFolderCompressor sut; + if (forceLazyFileSystemEnumeration) + { + sut = new LazyEnumerateCziSut(processorFactory) + { + MatchExtensionCasing = MatchCasing.PlatformDefault, // CaseInsensitive is currently not supported by MockFileSystem + AttributesToSkip = FileAttributes.Hidden | FileAttributes.System, // AttributesToSkip is currently not supported by MockFileSystem + }; + } + else + { + sut = CreateSut(processorFactory); + } + + var run = sut.PrepareNewRun( + ff.GetFolderCompressorParameters(mode, executionOptions, processingOptions), + CancellationToken.None); + + // ACT + Task t = run.Output.ToTask(); + run.Start(); + await t; + + // ASSERT + processors + .CheckCount(maxCount: executionOptions.ThreadCount.Value) + .CheckDisposed(); + + var actualFileNamePairs = + from p in processors + from argsPair in p.GetProcessedFileArgs() + select argsPair; + + var expectedFileNamePairs = + from f in ff.InitialFiles + where f.EndsWith(".czi") && f.StartsWith(ff.InputDir.FullName) + select (f, GetExpectedOutputPath(f) + "~"); + + actualFileNamePairs.Should().BeEquivalentTo( + expectedFileNamePairs, + compare => compare.WithoutStrictOrdering()); + } + + private static MultiThreadedFolderCompressor CreateSut( + CreateProcessor processorFactory, + int maxTriesToCreateTemporaryFiles = 4) + { + var sut = new MultiThreadedFolderCompressor( + processorFactory, + new FileProcessingFailedHandler(), + maxTriesToCreateTemporaryFiles) + { + MatchExtensionCasing = + MatchCasing.PlatformDefault, // CaseInsensitive is currently not supported by MockFileSystem + AttributesToSkip = FileAttributes.System | FileAttributes.Hidden, // AttributesToSkip is not supported by MockFileSystem + }; + return sut; + } + + private static CreateProcessor CreateProcessorFactory( + CompressionMode expectedMode, + ProcessingOptions expectedProcessingOptions, + Action>? onMockCreated = null) + { + // Strict mock behavior checks that we are receiving the correct mode argument. + var createProcessor = new Mock(MockBehavior.Strict); + createProcessor.Setup(x => x.Invoke(expectedMode, expectedProcessingOptions)).Returns( + (_, _) => + { + var p = new Mock().WithProcessFile((_, _, _, c) => c.ThrowIfCancellationRequested()); + + onMockCreated?.Invoke(p); + + return p.Object; + }); + + return createProcessor.Object; + } + + private class FoldersAndFiles + { + public FoldersAndFiles(string inputDir, string outputDir, params string[] files) + : this(inputDir, outputDir, false, files) + { + } + + public FoldersAndFiles(string inputDir, string outputDir, bool allFilesReadonly, params string[] files) + { + this.InitialFiles = files.Select(ToPlatformPath).ToArray(); + this.FileSystem = CreateFileSystem(this.InitialFiles, allFilesReadonly); + this.InputDir = this.FileSystem.DirectoryInfo.New(ToPlatformPath(inputDir)); + this.OutputDir = this.FileSystem.DirectoryInfo.New(ToPlatformPath(outputDir)); + } + + public IFileSystem FileSystem { get; } + + public string[] InitialFiles { get; } + + public IDirectoryInfo InputDir { get; } + + public IDirectoryInfo OutputDir { get; } + + public static string ToPlatformPath(string path) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return path; + } + + var posixPath = path.Replace('\\', '/'); + posixPath = posixPath.Replace(":", string.Empty); + posixPath = "/cygdrive/" + posixPath; + return posixPath; + } + + public FolderCompressorParameters GetFolderCompressorParameters( + CompressionMode mode = CompressionMode.CompressUncompressed, + ExecutionOptions? executionOptions = null, + ProcessingOptions? processingOptions = null, + bool recursive = true) + { + processingOptions ??= new ProcessingOptions(CompressionLevel.Default); + executionOptions ??= new ExecutionOptions(ThreadCount.Default); + return new FolderCompressorParameters( + this.InputDir, + this.OutputDir, + recursive, + mode, + executionOptions, + processingOptions); + } + + private static MockFileSystem CreateFileSystem(string[] files, bool allFilesReadonly = false) + { + var filesDict = files.ToDictionary(f => f, f => new MockFileData(f)); + if (allFilesReadonly) + { + foreach (var file in filesDict.Values) + { + file.Attributes = FileAttributes.ReadOnly; + } + } + + var result = new MockFileSystem(filesDict); + return result; + } + } + + // Overrides EnumerateCzisAsync to first return files and then look into subdirectories. + // This is necessary when we want to test that output files placed into a subdirectory + // of the input directory are skipped. It seems that MockFileSystem collects all files + // immediately (in GetEnumerator() not in MoveNext()). + private class LazyEnumerateCziSut : MultiThreadedFolderCompressor + { + public LazyEnumerateCziSut(CreateProcessor createProcessor) + : base(createProcessor, new FileProcessingFailedHandler()) + { + } + + protected override IAsyncEnumerable EnumerateCzisAsync(IDirectoryInfo folder, bool recursive, CancellationToken token) + { + return recursive + ? LazyEnumerateCzisAsync(folder, token) + : base.EnumerateCzisAsync(folder, false, token); + + async IAsyncEnumerable LazyEnumerateCzisAsync( + IDirectoryInfo folder, + [EnumeratorCancellation] CancellationToken token) + { + await foreach (var item in base.EnumerateCzisAsync(folder, false, token) + .WithCancellation(token)) + { + yield return item; + } + + foreach (var dir in folder.EnumerateDirectories()) + { + await foreach (var item in LazyEnumerateCzisAsync(dir, token) + .WithCancellation(token)) + { + yield return item; + } + } + } + } + } +} diff --git a/czishrink/netczicompressTests/Models/NoOpFileProcessorTests.cs b/czishrink/netczicompressTests/Models/NoOpFileProcessorTests.cs new file mode 100644 index 0000000..91584ef --- /dev/null +++ b/czishrink/netczicompressTests/Models/NoOpFileProcessorTests.cs @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +/// +/// Tests for . +/// +public class NoOpFileProcessorTests +{ + [Fact] + public void NeedsExistingOutputDirectory_ShouldBeFalse() + { + using var target = new NoOpFileProcessor(); + target.NeedsExistingOutputDirectory.Should().BeFalse(); + } + + [Fact] + public void ProcessFile_WhenCalled_ReportsProgress100() + { + // ARRANGE + var fixture = new Fixture().Customize(new AutoMoqCustomization()); + var mock = fixture.Freeze>(); + + var sut = new NoOpFileProcessor(); + + // ACT + sut.ProcessFile( + fixture.Create(), + fixture.Create(), + mock.Object, + fixture.Create()); + + // ASSERT + mock.Verify(x => x.Invoke(100), Times.Once); + mock.VerifyNoOtherCalls(); + } +} diff --git a/czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs b/czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs new file mode 100644 index 0000000..2fbea63 --- /dev/null +++ b/czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs @@ -0,0 +1,164 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Reactive.Disposables; + +/// +/// Tests for . +/// +public class PInvokeFileProcessorTests +{ + [Fact] + public void Ctr_WhenCalledWithNoOp_Throws() + { + Action act = () => _ = new PInvokeFileProcessor(CompressionMode.NoOp, new ProcessingOptions(new CompressionLevel())); + + act.Should().Throw().WithParameterName("mode"); + } + + [Theory] + [InlineData(CompressionMode.CompressUncompressed)] + [InlineData(CompressionMode.CompressAll)] + [InlineData(CompressionMode.CompressUncompressedAndZstd)] + public void CompressAndDecompressOneFile_FilesHaveCorrectSize( + CompressionMode mode) + { + // ARRANGE + var testFile = GetTestFilePath(); + + var compressed = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".czi"); + using var deleteCompressed = DeleteLater(compressed); + + var uncompressed = compressed + "-decompressed.czi"; + using var deleteUncompressed = Disposable.Create(() => File.Delete(uncompressed)); + + // ACT + using var compressor = new PInvokeFileProcessor(mode, new ProcessingOptions(new CompressionLevel())); + compressor.ProcessFile(testFile, compressed, _ => { }, CancellationToken.None); + + using var decompressor = new PInvokeFileProcessor(CompressionMode.Decompress, new ProcessingOptions(new CompressionLevel())); + decompressor.ProcessFile(compressed, uncompressed, _ => { }, CancellationToken.None); + + var compressedSize = GetLength(compressed); + var decompressedSize = GetLength(uncompressed); + var originalSize = GetLength(testFile); + + // ASSERT + compressedSize.Should().Be(58432L); + decompressedSize.Should().BeCloseTo(originalSize, 2048); + decompressedSize.Should().Be(99552L); + } + + [Theory] + [InlineData(CompressionMode.CompressUncompressed)] + [InlineData(CompressionMode.CompressAll)] + [InlineData(CompressionMode.CompressUncompressedAndZstd)] + [InlineData(CompressionMode.Decompress)] + public void NeedsExistingOutputDirectory_ShouldBeTrue( + CompressionMode mode) + { + using var target = new PInvokeFileProcessor(mode, new ProcessingOptions(new CompressionLevel())); + target.NeedsExistingOutputDirectory.Should().BeTrue(); + } + + [Theory] + [InlineData(CompressionMode.CompressUncompressed)] + [InlineData(CompressionMode.CompressAll)] + [InlineData(CompressionMode.CompressUncompressedAndZstd)] + [InlineData(CompressionMode.Decompress)] + public void ProcessFile_WhenCancelled_Throws( + CompressionMode mode) + { + // ARRANGE + string testFile = GetTestFilePath(); + + var compressed = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".czi"); + using var deleteCompressed = DeleteLater(compressed); + + // ACT + using var compressor = PInvokeFileProcessor.Create(mode, new ProcessingOptions(new CompressionLevel())); + var token = new CancellationToken(true); + Action act = () => compressor.ProcessFile(testFile, compressed, _ => { }, token); + + // ASSERT + act.Should().Throw() + .Which + .CancellationToken.Should().Be(token); + } + + [Theory] + [InlineData(CompressionMode.CompressUncompressed)] + [InlineData(CompressionMode.CompressAll)] + [InlineData(CompressionMode.CompressUncompressedAndZstd)] + [InlineData(CompressionMode.Decompress)] + public void ProcessFile_WhenDisposed_Throws( + CompressionMode mode) + { + // ARRANGE + using var compressor = PInvokeFileProcessor.Create(mode, new ProcessingOptions(new CompressionLevel())); + compressor.Dispose(); + + Action act = () => compressor.ProcessFile("foo", "bar", _ => { }, CancellationToken.None); + + // ASSERT + act.Should().Throw(); + } + + [Fact] + public void GetLibFullName_WhenCalled_ReturnsExpected() + { + PInvokeFileProcessor.GetLibFullName().Should().Match("libczicompressc 0.*.*"); + } + + [Theory] + [InlineData(0, 99552L, 57760L)] + [InlineData(2, 99552L, 57920L)] + [InlineData(4, 99552L, 57472L)] + public void CompressWithLevel_FilesHaveCorrectSize( + int compressionLevel, long expectedUncompressedSize, long expectedCompressedSize) + { + // ARRANGE + var testFile = GetTestFilePath(); + + var compressed = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".czi"); + using var deleteCompressed = DeleteLater(compressed); + + var uncompressed = compressed + "-decompressed.czi"; + using var deleteUncompressed = Disposable.Create(() => File.Delete(uncompressed)); + + // ACT + using var compressor = new PInvokeFileProcessor( + CompressionMode.CompressAll, + new ProcessingOptions(new CompressionLevel() + { + Value = compressionLevel, + })); + compressor.ProcessFile(testFile, compressed, _ => { }, CancellationToken.None); + + using var decompressor = new PInvokeFileProcessor(CompressionMode.Decompress, new ProcessingOptions(new CompressionLevel())); + decompressor.ProcessFile(compressed, uncompressed, _ => { }, CancellationToken.None); + + var compressedSize = GetLength(compressed); + var decompressedSize = GetLength(uncompressed); + var originalSize = GetLength(testFile); + + // ASSERT + compressedSize.Should().Be(expectedCompressedSize); + decompressedSize.Should().Be(expectedUncompressedSize); + } + + private static long GetLength(string path) => new FileInfo(path).Length; + + private static IDisposable DeleteLater(string path) => Disposable.Create(() => File.Delete(path)); + + private static string GetTestFilePath() + { + var dirname = Path.GetDirectoryName(typeof(PInvokeFileProcessorTests).Assembly.Location); + dirname.Should().NotBeNull(); + var testFile = Path.Combine(dirname ?? ".", "mandelbrot.czi"); + return testFile; + } +} diff --git a/czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs b/czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs new file mode 100644 index 0000000..7c395ab --- /dev/null +++ b/czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Text.RegularExpressions; + +/// +/// Tests for . +/// +public class ProgramNameAndVersionTests +{ + [Fact] + public void ToString_WhenCalled_ReturnsExpected() + { + // ACT + var actual = new ProgramNameAndVersion().ToString(); + + // ASSERT + var re = new Regex(@"^CZI Shrink 1\.0\.0-alpha\.[1-9]\d\d*$"); + re.IsMatch(actual).Should().BeTrue(); + } + + [Fact] + public void Name_WhenCalled_ReturnsExpected() + { + // ACT + var actual = new ProgramNameAndVersion().Name; + + // ASSERT + actual.Should().Be("CZI Shrink"); + } + + [Fact] + public void Version_WhenCalled_ReturnsExpected() + { + // ACT + var actual = new ProgramNameAndVersion().Version; + + // ASSERT + var re = new Regex(@"^1\.0\.0-alpha\.[1-9]\d\d*$"); + re.IsMatch(actual).Should().BeTrue(); + } +} diff --git a/czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs b/czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs new file mode 100644 index 0000000..5488bfa --- /dev/null +++ b/czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs @@ -0,0 +1,109 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Collections.Generic; +using System.Diagnostics; +using System.IO.Abstractions; +using System.Reactive.Subjects; + +using netczicompressTests.Customizations; +using netczicompressTests.Models.Mocks; +using static netczicompress.Models.CompressorMessage; + +/// +/// Tests for . +/// +public class StatisticsRunObserverTests +{ + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(5)] + [InlineData(15)] + public void ObserveRun_WhenRunCompletes_CorrectFirstAndFinalResult(int scanTimeMillis) + { + // ARRANGE + var f = new Fixture().Customize(new AutoMoqCustomization()); + f.Customizations.Add(new ThreadCountSpecimenBuilder()); + var parameters = f.Create(); + + var recorder = new Recorder(); + var fileMock = new Mock(MockBehavior.Strict).Object; + + var data = new FileFinished[] + { + new(fileMock, 20, 10, null, null), + new(fileMock, 20, 10, null, null), + new(fileMock, 20, 10, null, null), + new(fileMock, 20, 10, null, null), + new(fileMock, 20, 10, null, null), + new(fileMock, 500, 400, null, null), + new(fileMock, 10, 1000, null, "Failed"), + new(fileMock, 10, 1000, null, "Failed"), + }; + + var observable = new Subject(); + var watch = Stopwatch.StartNew(); + + var sut = new StatisticsRunObserver( + recorder, + TimeSpan.FromMilliseconds(scanTimeMillis), + DefaultScheduler.Instance); + + // ACT + sut.ObserveRun(parameters, observable.AsObservable()); + + foreach (var item in data) + { + Thread.Sleep(scanTimeMillis / 2); + observable.OnNext(item); + } + + observable.OnCompleted(); + + var durationUpperLimit = watch.Elapsed + + TimeSpan.FromMilliseconds(2); + + SpinWait.SpinUntil(() => recorder.Completed); + + // ASSERT + recorder.Data.Count.Should().BeInRange(2, data.Length + 1); + AssertMonotonicity(recorder.Data); + + recorder.Data[0].Should().Be(AggregateStatistics.Empty); + + var lastStats = recorder.Data[^1]; + + lastStats.FilesWithErrors.Should().Be(2); + lastStats.FilesWithNoErrors.Should().Be(6); + lastStats.OutputToInputRatio.Should().Be(450.0f / 600); + lastStats.DeltaBytes.Should().Be(450 - 600); + lastStats.InputBytes.Should().Be(600); + lastStats.OutputBytes.Should().Be(450); + lastStats.Duration.Should().BeGreaterThan(TimeSpan.Zero); + lastStats.Duration.Should().BeLessThan(durationUpperLimit); + } + + private static void AssertMonotonicity( + IReadOnlyList data) + { + for (int i = 1; i < data.Count; i++) + { + var current = data[i]; + var previous = data[i - 1]; + + current.FilesWithErrors.Should().BeGreaterThanOrEqualTo( + previous.FilesWithErrors); + current.FilesWithNoErrors.Should().BeGreaterThanOrEqualTo( + previous.FilesWithNoErrors); + current.InputBytes.Should().BeGreaterThanOrEqualTo( + previous.InputBytes); + current.OutputBytes.Should().BeGreaterThanOrEqualTo( + previous.OutputBytes); + current.Duration.Should().BeGreaterThan(previous.Duration); + } + } +} diff --git a/czishrink/netczicompressTests/Models/TemporaryFileTests.cs b/czishrink/netczicompressTests/Models/TemporaryFileTests.cs new file mode 100644 index 0000000..cd384ff --- /dev/null +++ b/czishrink/netczicompressTests/Models/TemporaryFileTests.cs @@ -0,0 +1,239 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.IO.Abstractions; +using System.IO.Abstractions.TestingHelpers; + +/// +/// Tests for . +/// +public class TemporaryFileTests +{ + [Fact] + public void WhenNoOutputFileExist_CreationOfTemporaryOutputDirSucceeds() + { + // ARRANGE + var fileSystem = new MockFileSystem(new Dictionary()); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + + // ASSERT + var expectedOutFileName = fileSystem.Path.GetFullPath("outFile"); + var expectedTempOutFileName = expectedOutFileName + "~"; + sut.GetFullOutFileName().Should().Be(expectedOutFileName); + sut.TemporaryFileCreationFailed.Should().BeFalse(); + sut.Info.FullName.Should().Be(expectedTempOutFileName); + sut.Info.Exists.Should().BeFalse(); + } + + [Fact] + public void WhenNoOutputFileExistAndTemporaryFilesAreWritten_TemporaryFileShouldExistAndOutputFileNotYet() + { + // ARRANGE + var fileSystem = new MockFileSystem(new Dictionary()); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + sut.Info.Create(); // simulates the compression processing + + // ASSERT + sut.GetOutputFile().Exists.Should().BeFalse(); + sut.MoveToOutFileIfExists(); + sut.GetOutputFile().Exists.Should().BeTrue(); + } + + [Fact] + public void WhenNoOutputFileExistAndTemporaryFilesAreWrittenAndMoved_OutFileShouldExistAndTemporaryFileNotMore() + { + // ARRANGE + var fileSystem = new MockFileSystem(new Dictionary()); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + sut.Info.Create(); // simulates the compression processing + sut.MoveToOutFileIfExists(); // simulates the compression processing + + // ASSERT + var expectedTempOutFileName = fileSystem.Path.GetFullPath("outFile") + "~"; + + // the sut's temporary output file will be renamed upon the move, + // so we need to create a new file info from the original file name. + var tempOutFile = fileSystem.FileInfo.New(expectedTempOutFileName); + tempOutFile.Exists.Should().BeFalse(); + sut.DeleteAllOutFiles(); + sut.GetOutputFile().Exists.Should().BeFalse(); + } + + [Fact] + public void WhenOutputFileExistsAndCanBeDeleted_CreationOfTemporaryOutputFileSucceeds() + { + // ARRANGE + var fileSystem = CreateFileSystem(); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + + // ASSERT + var expectedOutFileName = fileSystem.Path.GetFullPath("outFile"); + var expectedTempOutFileName = expectedOutFileName + "~"; + sut.GetFullOutFileName().Should().Be(expectedOutFileName); + sut.TemporaryFileCreationFailed.Should().BeFalse(); + sut.Info.FullName.Should().Be(expectedTempOutFileName); + sut.Info.Exists.Should().BeFalse(); + } + + [Fact] + public void WhenFourTemporaryOutputFileExistAndCannotBeDeleted_CreationOfTemporaryOutputFileSucceeds() + { + // ARRANGE + var fileSystem = CreateFileSystem(readOnlyLevel: 2); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + + // ASSERT + var expectedOutFileName = fileSystem.Path.GetFullPath("outFile"); + var expectedTempOutFileName = expectedOutFileName + "~4"; + sut.GetFullOutFileName().Should().Be(expectedOutFileName); + sut.TemporaryFileCreationFailed.Should().BeFalse(); + sut.Info.FullName.Should().Be(expectedTempOutFileName); + sut.Info.Exists.Should().BeFalse(); + } + + [Fact] + public void WhenFourTemporaryOutputFileExistAndCannotBeDeletedAfterMove_OutputFileShouldExistAndTemporaryFileNoMote() + { + // ARRANGE + var fileSystem = CreateFileSystem(readOnlyLevel: 2); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + sut.Info.Create(); // simulates the compression processing + var tempOutFileName = sut.Info.FullName; + sut.MoveToOutFileIfExists(); + + // ASSERT + sut.GetOutputFile().Exists.Should().BeTrue(); + + // the sut's temporary output file will be renamed upon the move, + // so we need to create a new file info from the original file name. + fileSystem.FileInfo.New(tempOutFileName).Exists.Should().BeFalse(); + } + + [Fact] + public void WhenFourTemporaryOutputFileExistAndTwoCannotBeDeleted_CreationOfTemporaryOutputFileSucceeds() + { + // ARRANGE + var fileSystem = CreateFileSystem(readOnlyLevel: 1); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + + // ASSERT + var expectedOutFileName = fileSystem.Path.GetFullPath("outFile"); + var expectedTempOutFileName = expectedOutFileName + "~2"; + sut.GetFullOutFileName().Should().Be(expectedOutFileName); + sut.TemporaryFileCreationFailed.Should().BeFalse(); + sut.Info.FullName.Should().Be(expectedTempOutFileName); + sut.Info.Exists.Should().BeFalse(); + } + + [Fact] + public void WhenFourTemporaryOutputFileExistAndTwoCannotBeDeletedAfterMove_OutputFileShouldExistAndTemporaryFileNoMote() + { + // ARRANGE + var fileSystem = CreateFileSystem(readOnlyLevel: 1); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile); + sut.Info.Create(); // simulates the compression processing + var tempOutFileName = sut.Info.FullName; + sut.MoveToOutFileIfExists(); + + // ASSERT + sut.GetOutputFile().Exists.Should().BeTrue(); + fileSystem.FileInfo.New(tempOutFileName).Exists.Should().BeFalse(); + } + + [Fact] + public void WhenMaximumTriesToCreateTemporaryFileAreReached_CreationOfTemporaryOutputFileFails() + { + // ARRANGE + var fileSystem = CreateFileSystem(readOnlyLevel: 2); + var outFile = fileSystem.FileInfo.New("outFile"); + + // ACT + var sut = new TemporaryFileOverridenDelete(outFile, 4); + + // ASSERT + sut.TemporaryFileCreationFailed.Should().BeTrue(); + } + + private static MockFileSystem CreateFileSystem(uint readOnlyLevel = 0) + { + // var outFileName = "outFile"; + var tempOutFile = "outFile~"; + var tempOutFile1 = "outFile~1"; + var tempOutFile2 = "outFile~2"; + var tempOutFile3 = "outFile~3"; + + // var outFileMock = new MockFileData("this is the outfile."); + var tempOutFileMock = new MockFileData("this is the temporary outfile."); + var tempOutFileMock1 = new MockFileData("this is the temporary outfile 1."); + var tempOutFileMock2 = new MockFileData("this is the temporary outfile 2."); + var tempOutFileMock3 = new MockFileData("this is the temporary outfile 3."); + + if (readOnlyLevel >= 1) + { + tempOutFileMock.Attributes = FileAttributes.ReadOnly; + tempOutFileMock1.Attributes = FileAttributes.ReadOnly; + } + + if (readOnlyLevel >= 2) + { + tempOutFileMock2.Attributes = FileAttributes.ReadOnly; + tempOutFileMock3.Attributes = FileAttributes.ReadOnly; + } + + var files = new Dictionary + { + { tempOutFile, tempOutFileMock }, + { tempOutFile1, tempOutFileMock1 }, + { tempOutFile2, tempOutFileMock2 }, + { tempOutFile3, tempOutFileMock3 }, + }; + + var result = new MockFileSystem(files); + return result; + } + + private class TemporaryFileOverridenDelete : TemporaryFile + { + public TemporaryFileOverridenDelete(IFileInfo outfile, int maxNumberOfTriesToCreate = 5) + : base(outfile, maxNumberOfTriesToCreate) + { + } + + public IFileInfo GetOutputFile() + { + return this.OutFile; + } + + public string GetFullOutFileName() + { + return this.OutFile.FullName; + } + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Models/ThreadCountTests.cs b/czishrink/netczicompressTests/Models/ThreadCountTests.cs new file mode 100644 index 0000000..d9c3fbc --- /dev/null +++ b/czishrink/netczicompressTests/Models/ThreadCountTests.cs @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +/// +/// Tests for . +/// +public class ThreadCountTests +{ + [Fact] + public void DefaultConstructor_HasDefaultValue() + { + var sut = new ThreadCount(); + sut.Value.Should().Be(ThreadCount.DefaultValue); + } + + [Theory] + [InlineData(0)] + [InlineData(-100)] + [InlineData(230)] + public void OutOfRange_ShouldThrowOutOfRangeException(int value) + { + var act = () => + { + var sut = new ThreadCount() { Value = value }; + }; + + act.Should().Throw(); + } + + [Theory] + [InlineData(1)] + public void InRangeValue_ShouldBeEqual(int value) + { + var sut = new ThreadCount() { Value = value }; + sut.Value.Should().Be(value); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/Models/TraceLoggerFactoryTests.cs b/czishrink/netczicompressTests/Models/TraceLoggerFactoryTests.cs new file mode 100644 index 0000000..018b7d6 --- /dev/null +++ b/czishrink/netczicompressTests/Models/TraceLoggerFactoryTests.cs @@ -0,0 +1,182 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.Models; + +using System.Diagnostics; +using System.Text; +using Microsoft.Extensions.Logging; + +/// +/// Tests for . +/// +public sealed class TraceLoggerFactoryTests : IDisposable +{ + private readonly MemoryTraceListener listener = new(); + + public TraceLoggerFactoryTests() + { + Trace.Listeners.Add(this.listener); + this.listener.Reset(); + } + + [Fact] + public void AddProvider_WhenCalled_Throws() + { + // ARRANGE + using ILoggerFactory sut = new TraceLoggerFactory(); + + // ACT + Action act = () => sut.AddProvider(Mock.Of()); + + // ASSERT + act.Should().Throw(); + } + + [Theory] + [InlineData(true, LogLevel.Information, "Information", "INFO")] + [InlineData(false, LogLevel.Information, "Information", "INFO")] + [InlineData(true, LogLevel.Warning, "Warning", "WARN")] + [InlineData(false, LogLevel.Warning, "Warning", "WARN")] + [InlineData(true, LogLevel.Error, "Error", "ERROR")] + [InlineData(false, LogLevel.Error, "Error", "ERROR")] + [InlineData(true, LogLevel.Critical, "Error", "FATAL")] + [InlineData(false, LogLevel.Critical, "Error", "FATAL")] + public void LogHighLevel_WhenCalled_TracesExpected( + bool useLogLevels, + LogLevel level, + string expectedTraceLevel, + string expectedLogLevel) + { + // ARRANGE + using ILoggerFactory sut = new TraceLoggerFactory(useLogLevels); + var logger = sut.CreateLogger(); + + // ACT + DateTimeOffset before = DateTimeOffset.Now; + logger.Log(level, "Bla {eins} {zwei}", 1, 2); + + // ASSERT + var trace = this.listener.ToString(); + if (useLogLevels) + { + trace = CheckAndSkipPrefix(trace, expectedTraceLevel); + } + + CheckLogMessage(trace, before, expectedLogLevel, "Bla 1 2"); + } + + [Theory] + [InlineAutoData(LogLevel.None)] + [InlineAutoData(LogLevel.Debug)] + [InlineAutoData(LogLevel.Trace)] + [InlineAutoData((LogLevel)int.MaxValue)] + public void LogLowLevel_WhenCalled_TracesNothing(LogLevel level, bool useLogLevels) + { + // ARRANGE + using ILoggerFactory sut = new TraceLoggerFactory(useLogLevels); + var logger = sut.CreateLogger(); + + // ACT + logger.Log(level, "Bla {eins} {zwei}", 1, 2); + + // ASSERT + var trace = this.listener.ToString(); + trace.Should().BeEmpty(); + } + + [Theory] + [InlineAutoData(LogLevel.None, false)] + [InlineAutoData(LogLevel.Debug, false)] + [InlineAutoData(LogLevel.Trace, false)] + [InlineAutoData((LogLevel)int.MaxValue, false)] + [InlineAutoData(LogLevel.Information, true)] + [InlineAutoData(LogLevel.Warning, true)] + [InlineAutoData(LogLevel.Error, true)] + [InlineAutoData(LogLevel.Critical, true)] + public void LoggerIsEnabled_WhenCalled_ReturnsExpected(LogLevel level, bool expected, bool useLogLevels) + { + // ARRANGE + using ILoggerFactory sut = new TraceLoggerFactory(useLogLevels); + var logger = sut.CreateLogger(); + + // ACT + var actual = logger.IsEnabled(level); + + // ASSERT + actual.Should().Be(expected); + } + + [Theory] + [AutoData] + public void LoggerBeginScope_WhenCalled_ReturnsNull(bool useLogLevels) + { + // ARRANGE + using ILoggerFactory sut = new TraceLoggerFactory(useLogLevels); + var logger = sut.CreateLogger(); + + // ACT + var actual = logger.BeginScope("bla"); + + // ASSERT + actual.Should().BeNull(); + this.listener.ToString().Should().BeEmpty(); + } + + public void Dispose() + { + Trace.Listeners.Remove(this.listener); + } + + private static string CheckAndSkipPrefix(string trace, string level) + { + // we expect that the trace-text starts with something like " {level}: 0 : ", + // and we want to remove this part from the string + var levelText = $"{level}: 0 : "; + int index = trace.IndexOf(levelText, StringComparison.Ordinal); + index.Should().BePositive(); + trace = trace[(index + levelText.Length)..]; + return trace; + } + + private static void CheckLogMessage(string logLine, DateTimeOffset before, string expectedLevel, string expectedMessage) + { + var traceTokens = logLine.Split('|'); + traceTokens.Length.Should().Be(5); + var loggedDate = DateTimeOffset.Parse(traceTokens[0]); + loggedDate.Should().BeBefore(DateTimeOffset.Now); + loggedDate.Should().BeAfter(before); + traceTokens[1].Should().Be(typeof(TraceLoggerFactoryTests).FullName); + traceTokens[2].Should().Be(expectedLevel); + traceTokens[3].Should().Be("0"); + traceTokens[4].Should().Be(expectedMessage + "\n"); + } + + private class MemoryTraceListener : TraceListener + { + private readonly StringBuilder result = new(); + + public void Reset() + { + Trace.Flush(); + this.result.Clear(); + } + + public override void Write(string? message) + { + this.result.Append(message); + } + + public override void WriteLine(string? message) + { + this.result.Append(message).Append('\n'); + } + + public override string ToString() + { + Trace.Flush(); + return this.result.ToString(); + } + } +} diff --git a/czishrink/netczicompressTests/Usings.cs b/czishrink/netczicompressTests/Usings.cs new file mode 100644 index 0000000..8befff0 --- /dev/null +++ b/czishrink/netczicompressTests/Usings.cs @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma warning disable SA1200 // Using directives should be placed correctly + +global using System; +global using System.Collections.Generic; +global using System.Reactive.Concurrency; +global using System.Reactive.Linq; + +global using AutoFixture; +global using AutoFixture.AutoMoq; +global using AutoFixture.Xunit2; + +global using FluentAssertions; + +global using Moq; + +global using netczicompress.Models; + +global using Xunit; \ No newline at end of file diff --git a/czishrink/netczicompressTests/ViewModels/AboutViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/AboutViewModelTests.cs new file mode 100644 index 0000000..48105f0 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/AboutViewModelTests.cs @@ -0,0 +1,114 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +public class AboutViewModelTests +{ + [Fact] + public void AfterConstruction_HasExpectedProperties() + { + // ARRANGE + IFixture fixture = CreateFixture(); + var launcher = fixture.Create(); + var versionInfo = fixture.Create>(); + var libname = fixture.Create(); + versionInfo.Setup(x => x.ToString()).Returns("FooBar 99.3.7"); + + // ACT + var sut = new AboutViewModel(launcher, versionInfo.Object) { LibraryName = libname }; + + // ASSERT + sut.IsVisible.Should().BeFalse(); + sut.LibraryName.Should().BeSameAs(libname); + sut.ProgramVersionAndCopyRight.Should().Be("FooBar 99.3.7, © 2023 Carl Zeiss Microscopy GmbH and others"); + } + + [Theory] + [AutoData] + public void IsVisible_WhenSet_RaisesEvent(bool initialValue) + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + sut.IsVisible = initialValue; + using var monitor = sut.Monitor(); + + // ACT + sut.IsVisible = !initialValue; + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.IsVisible); + sut.IsVisible.Should().Be(!initialValue); + } + + [Fact] + public void ShowAboutCommand_WhenNotVisible_SetsVisibleToTrue() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + sut.IsVisible = false; + using var monitor = sut.Monitor(); + + // ACT + sut.ShowAboutCommand.CanExecute(null).Should().BeTrue(); + sut.ShowAboutCommand.Execute(null); + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.IsVisible); + sut.IsVisible.Should().BeTrue(); + } + + [Fact] + public void CloseAboutCommand_WhenVisible_SetsVisibleToFalse() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + sut.IsVisible = true; + using var monitor = sut.Monitor(); + + // ACT + sut.CloseAboutCommand.CanExecute(null).Should().BeTrue(); + sut.CloseAboutCommand.Execute(null); + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.IsVisible); + sut.IsVisible.Should().BeFalse(); + } + + [Fact] + public void ShowTextFileCommand_WhenCalled_LaunchesFileFromBaseDirectory() + { + // ARRANGE + IFixture fixture = CreateFixture(); + var launcherMock = fixture.Freeze>(); + + var sut = fixture.Create(); + const string file = "foobar.ext"; + + // ACT + sut.ShowTextFileCommand.CanExecute(file).Should().BeTrue(); + sut.ShowTextFileCommand.Execute(file); + + // ASSERT + var expectedFileName = System.IO.Path.Combine(AppContext.BaseDirectory, file); + launcherMock.Verify(x => x.Launch(expectedFileName), Times.Once); + } + + private static IFixture CreateFixture() + { + // ARRANGE + return new Fixture().Customize(new AutoMoqCustomization()); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/AggregateIndicationViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/AggregateIndicationViewModelTests.cs new file mode 100644 index 0000000..69d567f --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/AggregateIndicationViewModelTests.cs @@ -0,0 +1,106 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +public class AggregateIndicationViewModelTests +{ + [Fact] + public void Properties_AfterCreation_HaveExpectedValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + // ACT + var sut = fixture.Create(); + + // ASSERT + sut.IndicationStatus.Should().Be(AggregateIndicationStatus.NotStarted); + } + + [Fact] + public void OnNext_WhenCalled_ChangesPropertyValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + var newValue = fixture.Create(); + using var monitor = sut.Monitor(); + + // ACT + sut.OnNext(newValue); + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.IndicationStatus); + sut.IndicationStatus.Should().Be(AggregateIndicationStatus.Started); + } + + [Theory] + [InlineData(0, AggregateIndicationStatus.Success)] + [InlineData(-1, AggregateIndicationStatus.Success)] + [InlineData(int.MinValue, AggregateIndicationStatus.Success)] + [InlineData(1, AggregateIndicationStatus.Error)] + [InlineData(100, AggregateIndicationStatus.Error)] + [InlineData(int.MaxValue, AggregateIndicationStatus.Error)] + public void OnCompleted_WhenCalled_ChangesIndicationStatus(int filesWithErrors, AggregateIndicationStatus expectation) + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + var newValue = fixture.Create(); + newValue = newValue with { FilesWithErrors = filesWithErrors }; + sut.OnNext(newValue); + using var monitor = sut.Monitor(); + + // ACT + sut.OnCompleted(); + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.IndicationStatus); + sut.IndicationStatus.Should().Be(expectation); + } + + [Fact] + public void OnError_WhenExceptionIsOperationCancelledException_ChangesStatusToCancelled() + { + OnError_WhenExceptionIsOfType_ChangesStatusTo(AggregateIndicationStatus.Cancelled); + } + + [Fact] + public void OnError_WhenExceptionIsNotOperationCancelledException_ChangesStatusToError() + { + OnError_WhenExceptionIsOfType_ChangesStatusTo( + AggregateIndicationStatus.Error); + } + + private static void OnError_WhenExceptionIsOfType_ChangesStatusTo(AggregateIndicationStatus expectation) + where T : Exception + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + using var monitor = sut.Monitor(); + + // ACT + sut.OnError(Mock.Of()); + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.IndicationStatus); + sut.IndicationStatus.Should().Be(expectation); + } + + private static IFixture CreateFixture() + { + // ARRANGE + return new Fixture().Customize(new AutoMoqCustomization()); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/AggregateStatisticsViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/AggregateStatisticsViewModelTests.cs new file mode 100644 index 0000000..07a659e --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/AggregateStatisticsViewModelTests.cs @@ -0,0 +1,102 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.ComponentModel; + +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +public class AggregateStatisticsViewModelTests +{ + [Fact] + public void Properties_AfterCreation_HaveExpectedValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + // ACT + var sut = fixture.Create(); + + // ASSERT + sut.Should().BeEquivalentTo(AggregateStatistics.Empty); + } + + [Fact] + public void OnNext_WhenCalled_ChangesPropertyValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + var newValue = fixture.Create(); + var propertyListener = new Mock(); + sut.PropertyChanged += propertyListener.Object; + + // ACT + sut.OnNext(newValue); + + // ASSERT + propertyListener.Verify( + x => x.Invoke( + sut, + It.Is(e => e.PropertyName == string.Empty)), + Times.Once); + propertyListener.VerifyNoOtherCalls(); + + sut.Should().BeEquivalentTo(newValue); + } + + [Fact] + public void OnCompleted_WhenCalled_DoesNotDoAnything() + { + WhenCalled_DoesNotDoAnything((sut, _) => sut.OnCompleted()); + } + + [Fact] + public void OnError_WhenCalled_DoesNotDoAnything() + { + WhenCalled_DoesNotDoAnything((sut, fixture) => sut.OnError(fixture.Create())); + } + + [Fact] + public void AggregateIndicationViewModel_WhenGot_IsInjectedInstance() + { + // ARRANGE + IFixture fixture = CreateFixture(); + var injected = fixture.Freeze(); + + // ACT + var sut = fixture.Create(); + + // ASSERT + sut.AggregateIndicationViewModel.Should().BeSameAs(injected); + } + + private static void WhenCalled_DoesNotDoAnything(Action, IFixture> act) + { + // ARRANGE + IFixture fixture = CreateFixture(); + var oldValue = fixture.Create(); + var sut = fixture.Create(); + sut.OnNext(oldValue); + + // ACT + using var monitor = sut.Monitor(); + act(sut, fixture); + + // ASSERT + monitor.OccurredEvents.Should().BeEmpty(); + sut.Should().BeEquivalentTo(oldValue); + } + + private static IFixture CreateFixture() + { + // ARRANGE + return new Fixture().Customize(new AutoMoqCustomization()); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs new file mode 100644 index 0000000..772f406 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs @@ -0,0 +1,81 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.Reactive.Subjects; + +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +/// +/// Note that +/// is tested via . +/// +public class CompressionTaskViewModelTests +{ + [Fact] + public void PublicProperties_WhenGot_HaveExpectedValues() + { + // ARRANGE + var fileName = CreateFixture().Create(); + var progress = new BehaviorSubject(0); + var sut = new CompressionTaskViewModel( + fileName, + progress); + + List<(int Progress, (string FileName, int ProgressPercent, bool IsIndeterminateProgress, bool IsCompleted, string ChangedProps))> data = new(); + var changedProperties = new List(); + sut.PropertyChanged += (s, e) => changedProperties.Add(e.PropertyName); + + void Collect(int p) + { + changedProperties.Clear(); + progress.OnNext(p); + changedProperties.Sort(); + data.Add( + (p, + (sut.FileName, + sut.ProgressPercent, + sut.IsIndeterminateProgress, + sut.IsCompleted, + string.Join(",", changedProperties)))); + } + + // ACT + Collect(0); + Collect(1); + Collect(2); + Collect(2); + Collect(10); + Collect(50); + Collect(99); + Collect(100); + + // ASSERT + const string ProgressPercent = nameof(sut.ProgressPercent); + const string IsIndeterminateProgress = nameof(sut.IsIndeterminateProgress); + const string IsCompleted = nameof(sut.IsCompleted); + static string Cat(params string[] args) => string.Join(",", args); + data.Should().BeEquivalentTo( + new[] + { + (0, (fileName, 0, true, false, string.Empty)), + (1, (fileName, 1, true, false, ProgressPercent)), + (2, (fileName, 2, false, false, Cat(IsIndeterminateProgress, ProgressPercent))), + (2, (fileName, 2, false, false, string.Empty)), + (10, (fileName, 10, false, false, ProgressPercent)), + (50, (fileName, 50, false, false, ProgressPercent)), + (99, (fileName, 99, false, false, ProgressPercent)), + (100, (fileName, 100, false, true, Cat(IsCompleted, ProgressPercent))), + }); + } + + private static IFixture CreateFixture() + { + return new Fixture().Customize(new AutoMoqCustomization()); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToAnimationConverterTests.cs b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToAnimationConverterTests.cs new file mode 100644 index 0000000..0b2afbe --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToAnimationConverterTests.cs @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels.Converters; + +using System.Globalization; + +using netczicompress.ViewModels; +using netczicompress.ViewModels.Converters; + +using Projektanker.Icons.Avalonia; + +/// +/// Tests for . +/// +public class AggregateStatusToAnimationConverterTests +{ + [Theory] + [InlineData(AggregateIndicationStatus.Started, IconAnimation.Spin)] + [InlineData(AggregateIndicationStatus.Cancelled, IconAnimation.None)] + [InlineData(AggregateIndicationStatus.NotStarted, IconAnimation.None)] + [InlineData(AggregateIndicationStatus.Error, IconAnimation.None)] + [InlineData(AggregateIndicationStatus.Success, IconAnimation.None)] + public void ConversionWorks(AggregateIndicationStatus status, IconAnimation expected) + { + var converter = new AggregateStatusToAnimationConverter(); + var result = converter.Convert(status, typeof(IconAnimation), null, CultureInfo.CurrentCulture); + result.Should().Be(expected); + } + + [Fact] + public void BackConversion_Throws() + { + var converter = new AggregateStatusToAnimationConverter(); + Action act = () => converter.ConvertBack(null, typeof(void), null, CultureInfo.CurrentCulture); + act.Should().Throw(); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToForegroundConverterTests.cs b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToForegroundConverterTests.cs new file mode 100644 index 0000000..45c4dee --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToForegroundConverterTests.cs @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels.Converters; + +using System.Globalization; + +using Avalonia.Media; + +using netczicompress.ViewModels; +using netczicompress.ViewModels.Converters; + +using Projektanker.Icons.Avalonia; + +/// +/// Tests for . +/// +public class AggregateStatusToForegroundConverterTests +{ + public static IEnumerable DataWithStatusInput => + new List + { + new object[] { AggregateIndicationStatus.NotStarted, Colors.Black }, + new object[] { AggregateIndicationStatus.Started, Colors.CadetBlue }, + new object[] { AggregateIndicationStatus.Success, Colors.Green }, + new object[] { AggregateIndicationStatus.Error, Colors.Red }, + new object[] { AggregateIndicationStatus.Cancelled, Colors.LightGray }, + }; + + public static IEnumerable DataWithOtherInput => + new List + { + new object[] { 999, Colors.Red }, + new object[] { true, Colors.Red }, + new object[] { new(), Colors.Red }, + }; + + [Theory] + [MemberData(nameof(DataWithStatusInput))] + public void ForStatusInput_ConversionWorks(AggregateIndicationStatus status, Color expected) + { + var converter = new AggregateStatusToForegroundConverter(); + var result = converter.Convert(status, typeof(IconAnimation), null, CultureInfo.CurrentCulture); + IImmutableSolidColorBrush? brush = result as IImmutableSolidColorBrush; + brush.Should().NotBeNull(); + brush?.Color.Should().Be(expected); + } + + [Theory] + [MemberData(nameof(DataWithOtherInput))] + public void ForArbitraryInput_ConversionWorks(object status, Color expected) + { + var converter = new AggregateStatusToForegroundConverter(); + var result = converter.Convert(status, typeof(IconAnimation), null, CultureInfo.CurrentCulture); + IImmutableSolidColorBrush? brush = result as IImmutableSolidColorBrush; + brush.Should().NotBeNull(); + brush?.Color.Should().Be(expected); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToIconConverterTests.cs b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToIconConverterTests.cs new file mode 100644 index 0000000..2c0dbe2 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToIconConverterTests.cs @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels.Converters; + +using System.Globalization; +using netczicompress.ViewModels; +using netczicompress.ViewModels.Converters; +using Projektanker.Icons.Avalonia; + +/// +/// Tests for . +/// +public class AggregateStatusToIconConverterTests +{ + [Theory] + [InlineData(AggregateIndicationStatus.Started, "fa-sync")] + [InlineData(AggregateIndicationStatus.Cancelled, "fa-solid fa-circle-info")] + [InlineData(AggregateIndicationStatus.NotStarted, "fa-solid fa-circle-info")] + [InlineData(AggregateIndicationStatus.Error, "fa-solid fa-circle-info")] + [InlineData(AggregateIndicationStatus.Success, "fa-solid fa-circle-info")] + public void ConversionWorks(AggregateIndicationStatus status, string expected) + { + var converter = new AggregateStatusToIconConverter(); + var result = converter.Convert(status, typeof(IconAnimation), null, CultureInfo.CurrentCulture); + result.Should().Be(expected); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToTextConverterTests.cs b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToTextConverterTests.cs new file mode 100644 index 0000000..8556c85 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/Converters/AggregateStatusToTextConverterTests.cs @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels.Converters; + +using System.Globalization; +using netczicompress.ViewModels; +using netczicompress.ViewModels.Converters; +using Projektanker.Icons.Avalonia; + +/// +/// Tests for . +/// +public class AggregateStatusToTextConverterTests +{ + [Theory] + [InlineData(AggregateIndicationStatus.NotStarted, "Compression not started")] + [InlineData(AggregateIndicationStatus.Started, "Compression in progress")] + [InlineData(AggregateIndicationStatus.Success, "Compression succeeded")] + [InlineData(AggregateIndicationStatus.Error, "Compression had errors")] + [InlineData(AggregateIndicationStatus.Cancelled, "Compression was cancelled")] + public void ConversionWorks_ForStatusInput(AggregateIndicationStatus status, string expected) + { + var converter = new AggregateStatusToTextConverter(); + var result = converter.Convert(status, typeof(IconAnimation), null, CultureInfo.CurrentCulture); + result.Should().Be(expected); + } + + [Theory] + [InlineData(7)] + [InlineData(true)] + [InlineData("nonsense")] + public void ConversionReturnsEmptyString_ForOtherInput(object input) + { + var converter = new AggregateStatusToTextConverter(); + var result = converter.Convert(input, typeof(IconAnimation), null, CultureInfo.CurrentCulture); + result.Should().Be(string.Empty); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/ViewModels/Converters/BytesToStringConverterTests.cs b/czishrink/netczicompressTests/ViewModels/Converters/BytesToStringConverterTests.cs new file mode 100644 index 0000000..cd55cb9 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/Converters/BytesToStringConverterTests.cs @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels.Converters; + +using System.Globalization; +using netczicompress.ViewModels.Converters; +using Projektanker.Icons.Avalonia; + +/// +/// Tests for . +/// +public class BytesToStringConverterTests +{ + [Theory] + [InlineData(0, "0 bytes")] + [InlineData(1000, "1.00 kB")] + [InlineData(1234, "1.23 kB")] + [InlineData(2345, "2.35 kB")] + [InlineData(1e6, "1.00 MB")] + [InlineData(1e9, "1.00 GB")] + [InlineData(1e12, "1.00 TB")] + [InlineData(1e15, "1.00 PB")] + [InlineData(1e18, "1.00 EB")] + public void ConversionWorksWithLong(long byteCount, string expected) + { + var converter = new BytesToStringConverter(); + var result = converter.Convert(byteCount, typeof(IconAnimation), null, CultureInfo.InvariantCulture); + result.Should().Be(expected); + } + + [Theory] + [InlineData(0, "0 bytes")] + [InlineData(1000, "1.00 kB")] + [InlineData(1234, "1.23 kB")] + [InlineData(2345, "2.35 kB")] + [InlineData(1e6, "1.00 MB")] + [InlineData(1e9, "1.00 GB")] + public void ConversionWorksWithInt(int byteCount, string expected) + { + var converter = new BytesToStringConverter(); + var result = converter.Convert(byteCount, typeof(IconAnimation), null, CultureInfo.InvariantCulture); + result.Should().Be(expected); + } + + [Theory] + [InlineData(1e6, 0)] + [InlineData(true, 0)] + [InlineData(null, 0)] + public void ConversionWithArbitraryInput_Returns0(object byteCount, object expected) + { + var converter = new BytesToStringConverter(); + var result = converter.Convert(byteCount, typeof(IconAnimation), null, CultureInfo.InvariantCulture); + result.Should().Be(expected); + } +} \ No newline at end of file diff --git a/czishrink/netczicompressTests/ViewModels/Converters/FloatToCompressionRatioStringConverterTests.cs b/czishrink/netczicompressTests/ViewModels/Converters/FloatToCompressionRatioStringConverterTests.cs new file mode 100644 index 0000000..f4b4a87 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/Converters/FloatToCompressionRatioStringConverterTests.cs @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels.Converters; + +using System.Globalization; +using netczicompress.ViewModels.Converters; + +/// +/// Tests for . +/// +public class FloatToCompressionRatioStringConverterTests +{ + [Theory] + [InlineData(0, "0.000")] + [InlineData(1.23f, "1.230")] + [InlineData(float.NaN, "")] + public void CheckConversionWorksWithFloats(float value, string expected) + { + var converter = new FloatToCompressionRatioStringConverter(); + var result = converter.Convert(value, typeof(float), null, CultureInfo.InvariantCulture); + result.Should().Be(expected); + } + + [Theory] + [InlineData(0, "0.000")] + [InlineData(1.23, "1.230")] + [InlineData(double.NaN, "")] + public void CheckConversionWorksWithDoubles(double value, string expected) + { + var converter = new FloatToCompressionRatioStringConverter(); + var result = converter.Convert(value, typeof(double), null, CultureInfo.InvariantCulture); + result.Should().Be(expected); + } + + [Theory] + [InlineData("foo")] + [InlineData(null)] + [InlineData(typeof(string))] + public void Convert_WhenCalledOnSomethingThatIsNeitherFloatNorDouble_ReturnsEmptyString(object value) + { + var converter = new FloatToCompressionRatioStringConverter(); + var result = converter.Convert(value, typeof(double), null, CultureInfo.InvariantCulture); + result.Should().Be(string.Empty); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs new file mode 100644 index 0000000..aff64a8 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs @@ -0,0 +1,126 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.Diagnostics; +using System.IO.Abstractions; +using System.Reactive.Subjects; + +using netczicompress.ViewModels; + +using netczicompressTests.Models.Mocks; + +using static netczicompress.Models.CompressorMessage; + +/// +/// Tests for . +/// +public class CurrentTasksViewModelTests +{ + [Fact] + public void OnNext_WhenTaskNotFinished_AddsTaskToList() + { + // ARRANGE + var sut = new CurrentTasksViewModel(ImmediateScheduler.Instance); + + for (int i = 0; i < 10; i++) + { + var message = CreateFixture().Create(); + + // ACT + sut.OnNext(message); + + // ASSERT + sut.CompressionTasks.Count().Should().Be(i + 1); + sut.CompressionTasks[i].FileName.Should().Be(message.InputFile.FullName); + } + } + + [Fact] + public void OnNext_WhenTaskFinished_DoesNotAddTaskToList() + { + // ARRANGE + var sut = new CurrentTasksViewModel(ImmediateScheduler.Instance); + + var message = new FileStarting(Mock.Of(), new BehaviorSubject(100)); + + // ACT + sut.OnNext(message); + + // ASSERT + sut.CompressionTasks.Should().BeEmpty(); + } + + [Fact] + public void OnCompleted_WhenCalled_ClearsTaskList() + { + // ARRANGE + var sut = new CurrentTasksViewModel(ImmediateScheduler.Instance); + + sut.OnNextAll(CreateFixture().CreateMany(10)); + Debug.Assert(sut.CompressionTasks.Count == 10, "Error in ARRANGE"); + + // ACT + sut.OnCompleted(); + + // ASSERT + sut.CompressionTasks.Should().BeEmpty(); + } + + [Fact] + public void OnError_WhenCalled_ClearsTaskList() + { + // ARRANGE + var sut = new CurrentTasksViewModel(ImmediateScheduler.Instance); + + sut.OnNextAll(CreateFixture().CreateMany(10)); + Debug.Assert(sut.CompressionTasks.Count == 10, "Error in ARRANGE"); + + // ACT + sut.OnError(new Exception()); + + // ASSERT + sut.CompressionTasks.Should().BeEmpty(); + } + + [Fact] + public void WhenTaskCompletes_TaskIsRemovedFromListOnGuiScheduler() + { + // ARRANGE + var guiScheduler = new SchedulerMock(); + var sut = new CurrentTasksViewModel(guiScheduler); + + sut.OnNextAll(CreateFixture().CreateMany(5)); + var progress = new BehaviorSubject(0); + var completingTask = new FileStarting( + Mock.Of(f => f.FullName == "Foo_Bar_Baz"), + progress); + sut.OnNext(completingTask); + sut.OnNextAll(CreateFixture().CreateMany(5)); + + var taskViewModel = sut.CompressionTasks[5]; + var initialTasks = sut.CompressionTasks.ToArray(); + Debug.Assert(initialTasks.Length == 11, "Error in ARRANGE"); + Debug.Assert(taskViewModel.FileName == "Foo_Bar_Baz", "Error in ARRANGE"); + + // ACT + progress.OnNext(100); + var beforeSchedulerRun = sut.CompressionTasks.ToArray(); + guiScheduler.RunQueuedActions(); + var afterSchedulerRun = sut.CompressionTasks.ToArray(); + + // ASSERT + beforeSchedulerRun.Should().HaveCount(11); + beforeSchedulerRun.SequenceEqual(initialTasks).Should().BeTrue(); + + afterSchedulerRun.Should().HaveCount(10); + afterSchedulerRun.SequenceEqual(initialTasks.Where(t => t != taskViewModel)).Should().BeTrue(); + } + + private static IFixture CreateFixture() + { + return new Fixture().Customize(new AutoMoqCustomization()); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs b/czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs new file mode 100644 index 0000000..65b026b --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.ComponentModel; +using System.Reflection; +using System.Runtime.CompilerServices; + +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +public class ErrorItemTests +{ + /// + /// Tests that is indeed immutable. + /// + [Fact] + public void WritableProperties_AreInitOnly() + { + foreach (var property in WritableProperties()) + { + var setMethod = property.SetMethod; + + // Get the modifiers applied to the return parameter. + var setMethodReturnParameterModifiers = setMethod!.ReturnParameter.GetRequiredCustomModifiers(); + + // Init-only properties are marked with the IsExternalInit type. + bool isInitOnly = setMethodReturnParameterModifiers.Any(x => + x.FullName == + "System.Runtime.CompilerServices.IsExternalInit"); + + isInitOnly.Should().BeTrue(); + } + } + + /// + /// Tests that is indeed immutable. + /// + [Fact] + public void WritableProperties_AreRequired() + { + foreach (var property in WritableProperties()) + { + property.GetCustomAttributes(false).OfType().Should().NotBeEmpty(); + } + } + + [Fact] + public void ImplementsINotifyPropertyChanged() + { + INotifyPropertyChanged sut = new ErrorItem { File = "foo", ErrorMessage = "bar" }; + var handler = new Mock(MockBehavior.Strict).Object; + + sut.PropertyChanged += handler; + sut.ToString().Should().Be("foo : bar"); + sut.PropertyChanged -= handler; + } + + private static IEnumerable WritableProperties() + { + return typeof(ErrorItem).GetProperties().Where(p => p.CanWrite); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs new file mode 100644 index 0000000..c445b88 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs @@ -0,0 +1,445 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.Collections; +using System.Collections.Specialized; +using System.Diagnostics; +using System.IO.Abstractions; +using System.Windows.Input; + +using netczicompress.Models; +using netczicompress.ViewModels; +using netczicompressTests.Customizations; +using netczicompressTests.Models.Mocks; +using ReactiveUI; +using static netczicompress.Models.CompressorMessage; + +/// +/// Tests for . +/// +public class ErrorListViewModelTests +{ + [Fact] + public void SelectedErrorItem_WhenSet_RaisesPropertyChanged() + { + var sut = CreateSut(); + var fixture = new Fixture(); + + using (var m = sut.Monitor()) + { + sut.SelectedErrorItem = fixture.Create(); + m.Should().RaisePropertyChangeFor(x => x.SelectedErrorItem); + } + } + + [Theory] + [InlineData(1)] + [InlineData(2)] + [InlineData(5)] + [InlineData(7)] + [InlineData(20)] + [InlineData(100)] + public void ObserveRun_WhenItemsAddedBelowBulkAddThreshold_PerformsSingleAdds(int bufferCap) + { + // ARRANGE + const int MaxItemsToShow = 10; + ErrorListViewModel sut = CreateSut(bufferCap, MaxItemsToShow); + Debug.Assert( + sut.BulkAddThreshold > Math.Min(bufferCap, MaxItemsToShow), + "ItemsAddedBelowResetThreshold"); + + var errorListChangesRecorder = ObserveErrorListChanges(sut).StartRecording(); + IFixture fixture = CreateFixture(); + var input = GenerateMessages(fixture).Take(54).ToArray(); + var run = input.ToObservableAction(); + + // ACT + sut.ObserveRun( + fixture.Create(), + run.Output); + run.Start(); + + // ASSERT + // Number of changes: 1 Reset + 1 Add per Item + 1 Add of Truncation Notice + // Changes + var expectedChanges = GetExpectedErrorListChangesForSingleAdds(input, MaxItemsToShow); + errorListChangesRecorder.Data.Count.Should().Be(expectedChanges.Length); + errorListChangesRecorder.Data.Should().BeEquivalentTo(expectedChanges); + + // Final state + sut.Errors.Should().BeEquivalentTo(expectedChanges[^1].SnapShot); + } + + [Fact] + public void ObserveRun_WhenItemsAddedExceedBulkAddThreshold_PerformsBulkAdd() + { + // ARRANGE + const int MaxItemsToShow = 30; + const int BufferCapacity = 30; + ErrorListViewModel sut = CreateSut(BufferCapacity, MaxItemsToShow); + Debug.Assert( + sut.BulkAddThreshold < Math.Min(MaxItemsToShow, BufferCapacity), + "ItemsAddedExceedResetThreshold"); + + var errorListChangesRecorder = ObserveErrorListChanges(sut).StartRecording(); + var fixture = CreateFixture(); + var input = GenerateMessages(fixture).Take(61).ToArray(); + var run = input.ToObservableAction(); + + // ACT + sut.ObserveRun( + fixture.Create(), + run.Output); + run.Start(); + + // ASSERT + // Changes + var expectedRealErrorItems = GetExpectedErrorItems(input).Take(MaxItemsToShow).ToArray(); + var expectedErrorItems = expectedRealErrorItems.Append(GetExpectedTruncationItem()).ToArray(); + var expectation = new[] + { + (Array.Empty(), "Reset"), + (expectedRealErrorItems, "Reset"), + GetExpectedAddLastChange(expectedErrorItems), + }; + + errorListChangesRecorder.Data.Count.Should().Be(expectation.Length); + errorListChangesRecorder.Data.Should().BeEquivalentTo(expectation); + + // Final state + sut.Errors.Should().BeEquivalentTo(expectedErrorItems); + sut.SelectedErrorItem.Should().BeEquivalentTo(expectedRealErrorItems[^1]); + } + + [Theory] + [InlineData(0.2)] + [InlineData(0.5)] + [InlineData(1)] + [InlineData(5)] + public void ObserveRun_WhenRunIsErrored_HasCorrectFinalState(double bufferTimeMillis) + { + // ARRANGE + ErrorListViewModel sut = CreateSut( + bufferCap: 30, + maxItemsToShow: int.MaxValue, + bufferTimeout: TimeSpan.FromMilliseconds(bufferTimeMillis), + scheduler: ImmediateScheduler.Instance); + + var fixture = CreateFixture(); + var input = GenerateMessages(fixture).Take(125).ToArray(); + var observableMock = new Mock>(); + IObserver? subscriber = null; + observableMock + .Setup(x => x.Subscribe(It.IsAny>())) + .Callback>(obs => subscriber = obs); + + // ACT + sut.ObserveRun( + fixture.Create(), + observableMock.Object); + subscriber?.OnNextAll(input); + subscriber?.OnError(new Exception()); + + // ASSERT + var expectedErrorItems = GetExpectedErrorItems(input).ToArray(); + sut.Errors.Should().BeEquivalentTo(expectedErrorItems); + sut.SelectedErrorItem.Should().BeEquivalentTo(expectedErrorItems[^1]); + } + + [Theory] + [InlineData(0.2)] + [InlineData(0.5)] + [InlineData(1)] + [InlineData(5)] + public void ObserveRun_WhenSchedulerIsSlow_HasCorrectFinalState(double bufferTimeMillis) + { + // ARRANGE + var scheduler = new SchedulerMock(); + ErrorListViewModel sut = CreateSut( + bufferCap: 30, + maxItemsToShow: int.MaxValue, + bufferTimeout: TimeSpan.FromMilliseconds(bufferTimeMillis), + scheduler: scheduler); + + var fixture = CreateFixture(); + var input = GenerateMessages(fixture).Take(125).ToArray(); + var run = input.ToObservableAction(); + + // ACT + sut.ObserveRun( + fixture.Create(), + run.Output); + run.Start(); + + scheduler.RunQueuedActions(); + + // ASSERT + var expectedErrorItems = GetExpectedErrorItems(input).ToArray(); + sut.Errors.Should().BeEquivalentTo(expectedErrorItems); + sut.SelectedErrorItem.Should().BeEquivalentTo(expectedErrorItems[^1]); + } + + [Theory] + [InlineData(1)] + [InlineData(2)] + [InlineData(5)] + [InlineData(10)] + [InlineData(20)] + [InlineData(100)] + public void ObserveRun_AsItemsAreDelivered_SelectsLastRealItem(int bufferCap) + { + // ARRANGE + const int MaxItemsToShow = 10; + ErrorListViewModel sut = CreateSut(bufferCap, MaxItemsToShow); + + var recorder = ObserveSelectedItemChanges(sut).StartRecording(); + var fixture = CreateFixture(); + var input = GenerateMessages(fixture, 54).ToArray(); + var run = input.ToObservableAction(); + + // ACT + sut.ObserveRun( + fixture.Create(), + run.Output); + run.Start(); + + // ASSERT + // Number of changes: we expect only one update per buffer + int expectedNumberOfUpdates = (int)Math.Ceiling(1.0 * MaxItemsToShow / bufferCap); + recorder.Data.Count.Should().Be(expectedNumberOfUpdates); + + // State after each change + foreach (var (snapshot, selectedItem) in recorder.Data) + { + selectedItem.Should().BeSameAs(snapshot.LastOrDefault()); + } + + // Final state: Truncation Notice is not selected, last 'real' error remains selected + sut.SelectedErrorItem.Should().BeSameAs(sut.Errors[^2]); + } + + [Fact] + public void ShowSelectedFileCommand_CanExecuteWhenSelectedErrorItemIsNotNull() + { + var sut = CreateSut(); + Command_CanExecuteWhenSelectedErrorItemIsNotNull(sut, sut.ShowSelectedFileCommand); + } + + [Fact] + public void ShowSelectedFileCommand_WhenSelectedErrorItemIsNotNull_RevealsFile() + { + // ARRANGE + var launcherMock = new Mock(); + var sut = CreateSut(launcher: launcherMock.Object); + var fixture = new Fixture(); + var errorItem = fixture.Create(); + sut.SelectedErrorItem = errorItem; + + // ACT + sut.ShowSelectedFileCommand.Execute(null); + + // ASSERT + launcherMock.Verify(x => x.Reveal(errorItem.File), Times.Once); + launcherMock.VerifyNoOtherCalls(); + } + + [Fact] + public void ShowSelectedFileCommand_WhenSelectedErrorItemIsNull_NoError() + { + // ARRANGE + var launcherMock = new Mock(); + var sut = CreateSut(launcher: launcherMock.Object); + sut.SelectedErrorItem = null; + + // ACT + sut.ShowSelectedFileCommand.Execute(null); + + // ASSERT + launcherMock.VerifyNoOtherCalls(); + } + + [Fact] + public void OpenSelectedFileCommand_WhenSelectedErrorItemIsNull_NoError() + { + // ARRANGE + var launcherMock = new Mock(); + var sut = CreateSut(launcher: launcherMock.Object); + sut.SelectedErrorItem = null; + + // ACT + sut.OpenSelectedFileCommand.Execute(null); + + // ASSERT + launcherMock.VerifyNoOtherCalls(); + } + + [Fact] + public void OpenSelectedFileCommand_WhenSelectedErrorItemIsNotNull_OpensFile() + { + // ARRANGE + var launcherMock = new Mock(); + var sut = CreateSut(launcher: launcherMock.Object); + var fixture = new Fixture(); + var errorItem = fixture.Create(); + sut.SelectedErrorItem = errorItem; + + // ACT + sut.OpenSelectedFileCommand.Execute(null); + + // ASSERT + launcherMock.Verify(x => x.Launch(errorItem.File), Times.Once); + launcherMock.VerifyNoOtherCalls(); + } + + [Fact] + public void OpenSelectedFileCommand_CanExecuteWhenSelectedErrorItemIsNotNull() + { + var sut = CreateSut(); + Command_CanExecuteWhenSelectedErrorItemIsNotNull(sut, sut.OpenSelectedFileCommand); + } + + private static void Command_CanExecuteWhenSelectedErrorItemIsNotNull(ErrorListViewModel sut, ICommand command) + { + sut.SelectedErrorItem.Should().BeNull(); + command.CanExecute(null).Should().BeFalse(); + + using (var m = command.Monitor()) + { + var fixture = new Fixture(); + sut.SelectedErrorItem = fixture.Create(); + command.CanExecute(null).Should().BeTrue(); + m.Should().Raise(nameof(ICommand.CanExecuteChanged)); + } + + using (var m = command.Monitor()) + { + sut.SelectedErrorItem = null; + command.CanExecute(null).Should().BeFalse(); + m.Should().Raise(nameof(ICommand.CanExecuteChanged)); + } + } + + private static IFixture CreateFixture() + { + var f = new Fixture().Customize(new AutoMoqCustomization()); + f.Customizations.Add(new ThreadCountSpecimenBuilder()); + return f; + } + + private static ErrorListViewModel CreateSut( + int bufferCap = 50, + int maxItemsToShow = int.MaxValue, + TimeSpan? bufferTimeout = null, + IScheduler? scheduler = null, + IFileLauncher? launcher = null) + { + return new ErrorListViewModel( + maxNumberOfErrorsToShow: maxItemsToShow, + bufferInterval: bufferTimeout ?? TimeSpan.FromMinutes(5), + bufferCapacity: bufferCap, + scheduler: scheduler ?? ImmediateScheduler.Instance, + launcher: launcher ?? Mock.Of()); + } + + private static IEnumerable GenerateMessages(IFixture fixture, int count = int.MaxValue) + { + return from i in Enumerable.Range(0, count) + let error = i % 2 == 0 ? $"E{i}" : null + select new FileFinished( + Mock.Of(f => f.FullName == $"F{i}"), + fixture.Create(), + fixture.Create(), + fixture.Create(), + error); + } + + private static IObservable<(ErrorItem[] Snapshot, string Change)> ObserveErrorListChanges( + ErrorListViewModel sut) + { + INotifyCollectionChanged errorsColl = sut.Errors; + var changes = Observable.FromEventPattern( + e => errorsColl.CollectionChanged += e, + e => errorsColl.CollectionChanged -= e); + var resultSnapshotObservable = from change in changes + select (sut.Errors.ToArray(), ToString(change.EventArgs)); + return resultSnapshotObservable; + } + + private static (IReadOnlyList SnapShot, string Change)[] GetExpectedErrorListChangesForSingleAdds( + IEnumerable inputData, + int maxItemsToShow) + { + int expectedChangeCount = maxItemsToShow + 2; + var changeIndices = Enumerable.Range(0, expectedChangeCount); + + // Changes + var expectedChanges = from changeIndex in changeIndices + select GetExpectedErrorListChangeForSingleAdds(changeIndex, inputData, maxItemsToShow); + return expectedChanges.ToArray(); + } + + private static (IReadOnlyList SnapShot, string Change) GetExpectedErrorListChangeForSingleAdds( + int changeIndex, + IEnumerable inputData, + int maxItemsToShow) + { + if (changeIndex == 0) + { + // First snapshot is the clearing of the list. + return (Array.Empty(), "Reset"); + } + + IEnumerable allExpected = GetExpectedErrorItems(inputData); + var truncatedExpectation = allExpected.Take(maxItemsToShow).Append(GetExpectedTruncationItem()); + var list = truncatedExpectation.Take(changeIndex).ToList(); + return GetExpectedAddLastChange(list); + } + + private static ErrorItem GetExpectedTruncationItem() + { + return new ErrorItem { File = "…", ErrorMessage = "See log file for further errors." }; + } + + private static IEnumerable GetExpectedErrorItems(IEnumerable inputData) + { + return from m in inputData + let e = m.ErrorMessage + where e != null + select new ErrorItem { File = m.InputFile.FullName, ErrorMessage = e }; + } + + private static IObservable<(ErrorItem[] Snapshot, ErrorItem? SelectedItem)> ObserveSelectedItemChanges(ErrorListViewModel sut) + { + var changes = sut.ObservableForProperty(vm => vm.SelectedErrorItem); + return from change in changes select (sut.Errors.ToArray(), sut.SelectedErrorItem); + } + + private static string ToString(NotifyCollectionChangedEventArgs e) + { + return e.Action switch + { + NotifyCollectionChangedAction.Add => FormatAdd(e.NewStartingIndex, ToString(e.NewItems)), + _ => e.Action.ToString(), + }; + + static string ToString(IEnumerable? newItems) + { + var errorItems = newItems!.Cast(); + return string.Join("\t", errorItems); + } + } + + private static string FormatAdd(int addIndex, object? newItems) + { + return $"Add {newItems} at {addIndex}"; + } + + private static (IReadOnlyList SnapShot, string Change) GetExpectedAddLastChange(IReadOnlyList list) + { + string addLastChange = FormatAdd(list.Count - 1, list[^1]); + return (list, addLastChange); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs new file mode 100644 index 0000000..4c38da5 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs @@ -0,0 +1,367 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.Collections.Immutable; +using System.IO.Abstractions; +using System.IO.Abstractions.TestingHelpers; +using System.Reactive.Concurrency; +using System.Reactive.Subjects; + +using netczicompress.ViewModels; +using netczicompressTests.Customizations; +using netczicompressTests.Models.Mocks; + +/// +/// Tests for . +/// +public class LogFileViewModelTests +{ + [Theory] + [InlineData(true)] + [InlineData(false)] + public void ObserveRun_WhenCalled_LogsMessages(bool exception) + { + // ARRANGE + var fixture = CreateFixture(); + var p = fixture.Create(); + + fixture.Inject(ImmediateScheduler.Instance); + + var strategyMock = fixture.Freeze>(); + var recorder = new Recorder(); + using var writer = new StreamWriter(new MemoryStream()); + strategyMock.Setup(x => x.CreateLogFile(p)).Returns(Mock.Of(x => x.CreateText() == writer)); + strategyMock.Setup(x => x.CreateLogger(writer)).Returns(recorder); + strategyMock.Setup(x => x.LoggerScheduler).Returns(ImmediateScheduler.Instance); + + var sut = fixture.Create(); + + var subject = new Subject(); + + // ACT + sut.ObserveRun(p, subject); + + var messages = fixture.CreateMany(); + subject.OnNextAll(messages); + + var messagesLoggedBeforeTermination = recorder.Data.ToImmutableArray(); + Complete(subject, exception); + + // ASSERT + recorder.Completed.Should().BeTrue(); + recorder.Data.Should().BeEquivalentTo(messages); + messagesLoggedBeforeTermination.Should().BeEquivalentTo(messages); + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public void ObserveRun_UsesLoggerSchedulerToLogMessages(bool exception) + { + // ARRANGE + var fixture = CreateFixture(); + var p = fixture.Create(); + + fixture.Inject(ImmediateScheduler.Instance); + + var strategyMock = fixture.Freeze>(); + var recorder = new Recorder(); + var loggerScheduler = new SchedulerMock(); + using var writer = new StreamWriter(new MemoryStream()); + strategyMock.Setup(x => x.CreateLogFile(p)).Returns(Mock.Of(x => x.CreateText() == writer)); + strategyMock.Setup(x => x.CreateLogger(writer)).Returns(recorder); + strategyMock.Setup(x => x.LoggerScheduler).Returns(loggerScheduler); + + var sut = fixture.Create(); + + List<(string, ImmutableArray LoggedMessages, bool Completed)> data = new(); + void StoreDataPoint(string name) + { + recorder.Error.Should().BeNull(); + data.Add((name, recorder.Data.ToImmutableArray(), recorder.Completed)); + } + + // ACT + var subject = new Subject(); + sut.ObserveRun(p, subject.AsObservable()); + var messages = fixture.CreateMany(); + subject.OnNextAll(messages); + + Complete(subject, exception); + StoreDataPoint("Completed"); + + loggerScheduler.RunQueuedActions(); + StoreDataPoint("Completed and Scheduler Queue Run"); + + // ASSERT + var allMessages = messages.ToImmutableArray(); + var noMessages = ImmutableArray.Empty; + + data.Should().BeEquivalentTo( + new[] + { + ("Completed", noMessages, false), + ("Completed and Scheduler Queue Run", allMessages, true), + }); + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public void ObserveRun_WhenCalled_CorrectlyPublishesLogFile(bool exception) + { + // ARRANGE + var fixture = CreateFixture(); + var p = fixture.Create(); + + fixture.Inject(ImmediateScheduler.Instance); + + var fs = new MockFileSystem(new MockFileSystemOptions { CreateDefaultTempDir = true }); + IFileInfo? logFile = null; + var strategyMock = fixture.Freeze>(); + strategyMock.Setup(x => x.CreateLogFile(p)).Returns(_ => + { + var result = fs.FileInfo.New(fs.Path.GetTempFileName()); + logFile = result; + return result; + }); + strategyMock.Setup(x => x.LoggerScheduler).Returns(ImmediateScheduler.Instance); + + var sut = fixture.Create(); + + Dictionary data = new(); + void LogDataPoint(string name) + { + data[name] = (sut.LogFileOfLastRun, sut.OpenLogFileCommand.CanExecute(null)); + } + + LogDataPoint("Never Run"); + for (int i = 0; i < 2; i++) + { + // ACT + var subject = new Subject(); + sut.ObserveRun(p, subject); + LogDataPoint("Before Run"); + + var messages = fixture.CreateMany(); + subject.OnNextAll(messages); + + LogDataPoint("During Run"); + + using (var monitor = sut.Monitor()) + { + Complete(subject, exception); + monitor.Should().RaisePropertyChangeFor(x => x.LogFileOfLastRun); + } + + LogDataPoint("After Run"); + + // ASSERT + data["Never Run"].Should().Be((null, false)); + data["Before Run"].Should().Be((null, false)); + data["During Run"].Should().Be((null, false)); + data["After Run"].Should().Be((logFile, true)); + } + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public void ObserveRun_WhenCalled_UsesGuiSchedulerToPublishLogFile(bool exception) + { + // ARRANGE + var fixture = CreateFixture(); + var p = fixture.Create(); + var guiScheduler = new SchedulerMock(); + fixture.Inject(guiScheduler); + + var fs = new MockFileSystem(new MockFileSystemOptions { CreateDefaultTempDir = true }); + var strategyMock = fixture.Freeze>(); + strategyMock.Setup(x => x.CreateLogFile(p)).Returns(_ => + { + return fs.FileInfo.New(fs.Path.GetTempFileName()); + }); + strategyMock.Setup(x => x.LoggerScheduler).Returns(ImmediateScheduler.Instance); + + var sut = fixture.Create(); + + Dictionary data = new(); + void LogDataPoint(string name) + { + data[name] = (sut.LogFileOfLastRun, sut.OpenLogFileCommand.CanExecute(null)); + } + + for (int i = 0; i < 2; i++) + { + // ACT + var subject = new Subject(); + sut.ObserveRun(p, subject); + + var messages = fixture.CreateMany(); + subject.OnNextAll(messages); + + using (var monitor = sut.Monitor()) + { + Complete(subject, exception); + monitor.Should().NotRaisePropertyChangeFor(x => x.LogFileOfLastRun); + LogDataPoint("Before scheduler queue has run"); + + guiScheduler.RunQueuedActions(); + monitor.Should().RaisePropertyChangeFor(x => x.LogFileOfLastRun); + LogDataPoint("After scheduler queue has run"); + } + + // ASSERT + data["Before scheduler queue has run"].Should().Be((null, false)); + var after = data["After scheduler queue has run"]; + after.LogFileOfLastRun.Should().NotBeNull(); + after.CanShowLogFile.Should().BeTrue(); + } + } + + [Fact] + public void ShowLogFileCommand_WhenCannotExecute_ExecuteDoesNothing() + { + // ARRANGE + var fixture = CreateFixture(); + fixture.Inject(ImmediateScheduler.Instance); + var loggingStrategyMock = fixture.Freeze>(); + var sut = fixture.Create(); + + // ACT + sut.OpenLogFileCommand.Execute(null); + + // ASSERT + loggingStrategyMock.Verify(x => x.OpenLogFile(It.IsAny()), Times.Never); + } + + [Fact] + public void ShowLogFile_WhenLogFileExists_OpensLogFile() + { + // ARRANGE + var fixture = CreateFixture(); + fixture.Inject(ImmediateScheduler.Instance); + var loggingStrategyMock = fixture.Freeze>(); + var logFileMock = new Mock(); + var sut = fixture.Create(); + + var p = fixture.Create(); + + loggingStrategyMock.Setup(x => x.CreateLogFile(p)).Returns(logFileMock.Object); + var messages = fixture.CreateMany(); + var run = messages.ToObservableAction(); + + sut.ObserveRun(p, run.Output); + run.Start(); + logFileMock + .Setup( + x => x.Refresh()) + .Callback( + () => logFileMock + .SetupGet( + x => x.Exists) + .Returns( + true)); + sut.LogFileOfLastRun.Should().BeSameAs(logFileMock.Object); + sut.LogFileOfLastRun!.Exists.Should().BeFalse(); + sut.OpenLogFileCommand.CanExecute(null).Should().BeTrue(); + + // ACT + sut.OpenLogFileCommand.Execute(null); + + // ASSERT + loggingStrategyMock.Verify(x => x.OpenLogFile(logFileMock.Object), Times.Once); + sut.LogFileOfLastRun.Should().BeSameAs(logFileMock.Object); + sut.LogFileOfLastRun!.Exists.Should().BeTrue(); + sut.OpenLogFileCommand.CanExecute(null).Should().BeTrue(); + } + + [Fact] + public void ShowLogFile_WhenLogFileDoesNotExist_UpdatesCanExecute() + { + // ARRANGE + var fixture = CreateFixture(); + fixture.Inject(ImmediateScheduler.Instance); + var loggingStrategyMock = fixture.Freeze>(); + var logFileMock = new Mock(); + var sut = fixture.Create(); + + var p = fixture.Create(); + + loggingStrategyMock.Setup(x => x.CreateLogFile(p)).Returns(logFileMock.Object); + var messages = fixture.CreateMany(); + var run = messages.ToObservableAction(); + + sut.ObserveRun(p, run.Output); + run.Start(); + sut.LogFileOfLastRun.Should().BeSameAs(logFileMock.Object); + sut.LogFileOfLastRun!.Exists.Should().BeFalse(); + sut.OpenLogFileCommand.CanExecute(null).Should().BeTrue(); + + // ACT + sut.OpenLogFileCommand.Execute(null); + + // ASSERT + loggingStrategyMock.Verify(x => x.OpenLogFile(logFileMock.Object), Times.Never); + sut.LogFileOfLastRun.Should().BeNull(); + sut.OpenLogFileCommand.CanExecute(null).Should().BeFalse(); + } + + [Fact] + public void ShowLogFile_WhenOpeningTheLogFileFails_UpdatesCanExecute() + { + // ARRANGE + var fixture = CreateFixture(); + fixture.Inject(ImmediateScheduler.Instance); + var loggingStrategyMock = fixture.Freeze>(); + var logFile = Mock.Of(x => x.Exists == true); + var sut = fixture.Create(); + + var p = fixture.Create(); + + loggingStrategyMock.Setup(x => x.CreateLogFile(p)).Returns(logFile); + var messages = fixture.CreateMany(); + var run = messages.ToObservableAction(); + + sut.ObserveRun(p, run.Output); + run.Start(); + sut.LogFileOfLastRun.Should().BeSameAs(logFile); + sut.LogFileOfLastRun!.Exists.Should().BeTrue(); + sut.OpenLogFileCommand.CanExecute(null).Should().BeTrue(); + loggingStrategyMock + .Setup( + x => x.OpenLogFile(logFile)) + .Throws(); + + // ACT + sut.OpenLogFileCommand.Execute(null); + + // ASSERT + loggingStrategyMock.Verify(x => x.OpenLogFile(logFile), Times.Once); + sut.LogFileOfLastRun.Should().BeNull(); + sut.OpenLogFileCommand.CanExecute(null).Should().BeFalse(); + } + + private static IFixture CreateFixture() + { + var result = new Fixture().Customize(new AutoMoqCustomization()); + result.Customizations.Add(new ThreadCountSpecimenBuilder()); + return result; + } + + private static void Complete(IObserver subject, bool exception) + { + if (exception) + { + var ex = new Exception(); + subject.OnError(ex); + } + else + { + subject.OnCompleted(); + } + } +} diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.ChildViewModels.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.ChildViewModels.cs new file mode 100644 index 0000000..7a08f41 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.ChildViewModels.cs @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using AutoFixture; + +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +/// Tests for child view models. +public partial class MainViewModelTests +{ + [Fact] + public void ChildViewModels_AreThoseInjected() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var errorList = fixture.Freeze(); + var currentTasks = fixture.Freeze(); + var aggregateStatistics = fixture.Freeze(); + var about = fixture.Freeze(); + + // ACT + var sut = fixture.Create(); + + // ASSERT + sut.About.Should().BeSameAs(about); + sut.AggregateStatisticsViewModel.Should().BeSameAs(aggregateStatistics); + sut.CurrentTasks.Should().BeSameAs(currentTasks); + sut.ErrorList.Should().BeSameAs(errorList); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.Modes.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.Modes.cs new file mode 100644 index 0000000..cff3d8c --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.Modes.cs @@ -0,0 +1,104 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.IO.Abstractions; +using System.Reactive; + +using AutoFixture; + +using netczicompress.Models; +using netczicompress.ViewModels; + +using netczicompressTests.Models.Mocks; + +/// +/// Tests for . +/// +/// Tests for members related to mode selection. +public partial class MainViewModelTests +{ + [Fact] + public void Modes_WhenGot_HaveExpectedValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + + // ACT + var actual = sut.Modes.Cast().ToArray(); + + // ASSERT + actual.Should().BeEquivalentTo(new OperationMode[] + { + new(CompressionMode.CompressUncompressed, "Compress uncompressed data", "Compress only uncompressed subblocks and copy others."), + new(CompressionMode.CompressUncompressedAndZstd, "Compress uncompressed and Zstd-compressed data", "Compress subblocks that were originally compressed with zstd or uncompressed."), + new(CompressionMode.CompressAll, "Compress all data", "Compress all subblocks regardless of current compression method (if possible)."), + new(CompressionMode.Decompress, "Decompress all data", "Decompress all possible subblocks."), + new(CompressionMode.NoOp, "Dry Run (enumerate and log files)", "Do not compress/decompress rather just enumerate and log files that would be affected."), + }); + } + + [Fact] + public void SelectedMode_WhenGot_HasExpectedValue() + { + // ARRANGE + IFixture fixture = CreateFixture(); + + var sut = fixture.Create(); + + // ACT + var actual = sut.SelectedMode; + + // ASSERT + actual.Should().BeSameAs(sut.Modes.Cast().First()); + actual.Value.Should().Be(CompressionMode.CompressUncompressed); + } + + [Theory] + [AutoData] + public async Task Start_WhenCalled_UsesSelectedMode(ushort selectedModeIndex) + { + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + var compressorMock = fixture.Freeze>().WithAutoData(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs); + + var modes = sut.Modes.Cast().ToArray(); + var selectedIndex = selectedModeIndex % modes.Length; + var selectedMode = modes[selectedIndex]; + + // ACT + sut.SelectedMode = selectedMode; + await sut.StartCommand.Execute(Unit.Default); + + // ASSERT + compressorMock.Verify( + x => + x.PrepareNewRun( + It.Is(x => x.Mode == selectedMode.Value), + It.Is(c => !c.IsCancellationRequested)), + Times.Once); + } + + [Theory] + [AutoData] + public void OperationMode_ToString_ReturnsDisplayText(CompressionMode mode, string displayText, string tooltipText) + { + var sut = new OperationMode(mode, displayText, tooltipText); + + sut.ToString().Should().BeSameAs(displayText); + } + + private static IFixture CreateFixture(bool omitAutoProperties = true) + { + // ARRANGE + return new Fixture { OmitAutoProperties = omitAutoProperties }.Customize(new AutoMoqCustomization()); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs new file mode 100644 index 0000000..37d7763 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs @@ -0,0 +1,313 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.IO.Abstractions; +using System.IO.Abstractions.TestingHelpers; +using System.Reactive; +using System.Reactive.Threading.Tasks; +using System.Windows.Input; + +using AutoFixture; + +using Microsoft.Extensions.Logging; + +using netczicompress.Models; +using netczicompress.ViewModels; + +using netczicompressTests.Models.Mocks; + +/// +/// Tests for . +/// +/// Tests for members related to overall status. +public partial class MainViewModelTests +{ + [Fact] + public void OverallStatus_WhenNotRun_IsEmpty() + { + // ARRANGE + var fixture = CreateFixture(); + + var sut = fixture.Create(); + + // ACT + var actual = sut.OverallStatus; + + // ASSERT + actual.Should().BeEmpty(); + } + + [Fact] + public async Task OverallStatus_WhenRunSuccessful_IsExpected() + { + // ARRANGE + var fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + _ = fixture.Freeze>().WithAutoData(fixture); + var loggerMock = new LoggerMock().Inject(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs); + + // ACT + await sut.StartCommand.Execute(Unit.Default); + + // ASSERT + sut.OverallStatus.Should().Be("Finished"); + loggerMock.VerifyEntryCount(2); + loggerMock.VerifyEntry(^1, LogLevel.Information, "Run finished normally."); + } + + [Fact] + public async Task OverallStatus_WhenRunCanceled_IsExceptionMessage() + { + // ARRANGE + var fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + var opCanceled = new OperationCanceledException("CaNcElEd"); + _ = fixture.Freeze>().WithException(opCanceled); + var loggerMock = new LoggerMock().Inject(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs); + + // ACT + await sut.StartCommand.Execute(Unit.Default); + + // ASSERT + sut.OverallStatus.Should().Be(opCanceled.Message); + loggerMock.VerifyEntryCount(2); + loggerMock.VerifyEntry(1, LogLevel.Warning, "Run canceled."); + } + + [Fact] + public async Task OverallStatus_WhenOtherException_IsExceptionMessageWithWarningSign() + { + // ARRANGE + var fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + var invalidOp = new InvalidOperationException("Foo bar baz."); + _ = fixture.Freeze>().WithException(invalidOp); + var loggerMock = new LoggerMock().Inject(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs); + + // ACT + await sut.StartCommand.Execute(Unit.Default); + + // ASSERT + sut.OverallStatus.Should().Be("⚠ Foo bar baz."); + loggerMock.VerifyEntryCount(2); + loggerMock.VerifyEntry(^1, LogLevel.Error, "Run failed: " + invalidOp); + } + + [Fact] + public async Task OverallStatus_WhenInputDirectoryNotSet_IsExpected() + { + // ARRANGE + var fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + var compressorMock = fixture.Freeze>(); + var loggerMock = new LoggerMock().Inject(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs, setInput: false); + + // ACT + await sut.StartCommand.Execute(Unit.Default); + + // ASSERT + sut.OverallStatus.Should().Be("⚠ Input folder is not set."); + + loggerMock.VerifySingleEntry(LogLevel.Error, "Run failed: System.InvalidOperationException: Input folder is not set.*at*"); + + compressorMock.VerifyNoOtherCalls(); + } + + [Fact] + public async Task OverallStatus_WhenOutputDirectoryNotSet_IsExpected() + { + // ARRANGE + var fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + var compressorMock = fixture.Freeze>(); + var loggerMock = new LoggerMock().Inject(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs, setOutput: false); + + // ACT + await sut.StartCommand.Execute(Unit.Default); + + // ASSERT + sut.OverallStatus.Should().Be("⚠ Output folder is not set."); + + loggerMock.VerifySingleEntry(LogLevel.Error, "Run failed: System.InvalidOperationException: Output folder is not set.*at*"); + + compressorMock.VerifyNoOtherCalls(); + } + + [Fact] + public async Task OverallStatus_WhenInputDirectoryDoesNotExist_IsExpected() + { + // ARRANGE + var fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + var compressorMock = fixture.Freeze>(); + var loggerMock = new LoggerMock().Inject(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs); + string inputDir = fs.Path.Join(fs.Path.GetTempPath(), "Input"); + sut.InputDirectory = inputDir; + + // ACT + await sut.StartCommand.Execute(Unit.Default); + + // ASSERT + sut.OverallStatus.Should().Be($"⚠ Directory {inputDir} does not exist."); + loggerMock.VerifySingleEntry(LogLevel.Error, $"Run failed: System.IO.DirectoryNotFoundException: Directory {inputDir} does not exist.*at*"); + compressorMock.VerifyNoOtherCalls(); + } + + [Fact] + public async Task OverallStatus_WhenProcessing_HasExpectedValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + _ = fixture.Freeze>().WithWaitForCancellation(); + + var sut = fixture.Create(); + ICommand start = sut.StartCommand; + ICommand stop = sut.StopCommand; + SetFolders(sut, fs); + + Dictionary overallStatusWhen = new(); + + void AddDataPoint(string timePoint) + { + overallStatusWhen[timePoint] = sut.OverallStatus; + } + + // ACT + AddDataPoint("ready to run"); + + for (int i = 0; i < 2; i++) + { + Task startCommandTask; + using (var monitor = sut.Monitor()) + { + startCommandTask = sut.StartCommand.Execute(default).ToTask(); + AddDataPoint("running" + i); + + if (i == 0) + { + monitor.Should().NotRaisePropertyChangeFor(mvm => mvm.OverallStatus); + } + else + { + monitor.Should().RaisePropertyChangeFor(mvm => mvm.OverallStatus); + } + } + + Task stopCommandTask; + using (var monitor = sut.Monitor()) + { + stopCommandTask = sut.StopCommand.Execute(default).ToTask(); + + await startCommandTask; + await stopCommandTask; + + AddDataPoint("stopped" + i); + monitor.Should().RaisePropertyChangeFor(mvm => mvm.OverallStatus); + } + } + + // ASSERT + overallStatusWhen["ready to run"].Should().BeEmpty(); + overallStatusWhen["running0"].Should().BeEmpty(); + overallStatusWhen["stopped0"].Should().Be(new OperationCanceledException().Message); + overallStatusWhen["running1"].Should().BeEmpty(); + overallStatusWhen["stopped1"].Should().Be(new OperationCanceledException().Message); + } + + private static MockFileSystem NewMockFileSystem() + { + return new MockFileSystem( + new MockFileSystemOptions { CreateDefaultTempDir = true }); + } + + private static void SetFolders(MainViewModel sut, IFileSystem fs, bool setInput = true, bool setOutput = true) + { + string someExistingDir = fs.Path.GetTempPath(); + if (setInput) + { + sut.InputDirectory = someExistingDir; + } + + if (setOutput) + { + sut.OutputDirectory = fs.Path.Join(someExistingDir, "output"); + } + } + + private class LoggerMock : ILogger + { + private static readonly EventId Zero = (EventId)0; + + private List<(LogLevel Level, EventId Event, string Message)> LogEntries { get; } = new(); + + public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) + { + lock (this.LogEntries) + { + this.LogEntries.Add(new(logLevel, eventId, formatter.Invoke(state, exception))); + } + } + + public void VerifyEntryCount(int count) + { + this.LogEntries.Should().HaveCount(count); + } + + public void VerifyEntry(Index index, LogLevel expectedLevel, string messageWildcardPattern) + { + (LogLevel level, EventId eventId, string message) = this.LogEntries[index]; + level.Should().Be(expectedLevel); + eventId.Should().Be(Zero); + message.Should().Match(messageWildcardPattern); + } + + public void VerifySingleEntry(LogLevel expectedLevel, string messageWildcardPattern) + { + this.VerifyEntryCount(1); + this.VerifyEntry(0, expectedLevel, messageWildcardPattern); + } + + public LoggerMock Inject(IFixture fixture) + { + fixture.Inject>(this); + return this; + } + + public bool IsEnabled(LogLevel logLevel) => true; + + public IDisposable? BeginScope(TState state) + where TState : notnull + { + return null; + } + } +} diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.PropertyChanged.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.PropertyChanged.cs new file mode 100644 index 0000000..64cf707 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.PropertyChanged.cs @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.ComponentModel; + +using AutoFixture; + +using netczicompress.ViewModels; + +/// +/// Tests for . +/// +/// Tests for . +public partial class MainViewModelTests +{ + [Fact] + public void InputDirectory_WhenSet_RaisesPropertyChanged() + { + // ARRANGE + var fixture = CreateFixture(); + var sut = fixture.Create(); + + // ACT + using var monitor = sut.Monitor(); + sut.InputDirectory = "foo"; + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.InputDirectory); + } + + [Fact] + public void OutputDirectory_WhenSet_RaisesPropertyChanged() + { + // ARRANGE + var fixture = CreateFixture(); + var sut = fixture.Create(); + + // ACT + using var monitor = sut.Monitor(); + sut.OutputDirectory = "foo"; + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.OutputDirectory); + } + + [Fact] + public void Recursive_WhenSet_RaisesPropertyChanged() + { + // ARRANGE + var fixture = CreateFixture(); + var sut = fixture.Create(); + + // ACT + using var monitor = sut.Monitor(); + sut.Recursive = !sut.Recursive; + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.Recursive); + } + + [Theory] + [AutoData] + public void SelectedMode_WhenSet_RaisesPropertyChanged(OperationMode mode) + { + // ARRANGE + var fixture = CreateFixture(); + var sut = fixture.Create(); + + // ACT + using var monitor = sut.Monitor(); + sut.SelectedMode = mode; + + // ASSERT + monitor.Should().RaisePropertyChangeFor(x => x.SelectedMode); + } +} diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs new file mode 100644 index 0000000..f148c54 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs @@ -0,0 +1,232 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.IO.Abstractions; +using System.Reactive.Threading.Tasks; +using System.Windows.Input; + +using AutoFixture; + +using netczicompress.ViewModels; + +using netczicompressTests.Models.Mocks; + +/// +/// Tests for . +/// +/// Tests for . +public partial class MainViewModelTests +{ + [Fact] + public void StartCommand_WhenInputFolderNotSet_CannotExecute() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + + // ACT + var sut = fixture.Create(); + SetFolders(sut, fs, setInput: false); + + // ASSERT + ICommand command = sut.StartCommand; + command.CanExecute(null).Should().BeFalse(); + } + + [Fact] + public void StartCommand_WhenOutputFolderNotSet_CannotExecute() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + + // ACT + var sut = fixture.Create(); + SetFolders(sut, fs, setOutput: false); + + // ASSERT + ICommand command = sut.StartCommand; + command.CanExecute(null).Should().BeFalse(); + } + + [Fact] + public void StartCommand_WhenBothFoldersSet_CanExecute() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + + bool expectCanExecute = false; + List<(bool Expectation, bool Actual)> data = new(); + + var sut = fixture.Create(); + sut.StartCommand.CanExecute.Subscribe(onNext: + canExec => data.Add((expectCanExecute, canExec))); + + // ACT + SetFolders(sut, fs, setOutput: false); + + expectCanExecute = true; + SetFolders(sut, fs, setInput: false); + + // ASSERT + ICommand start = sut.StartCommand; + start.CanExecute(null).Should().BeTrue(); + + data.Count.Should().Be(2); + foreach (var (expectation, actual) in data) + { + actual.Should().Be(expectation); + } + } + + [Fact] + public async Task StartCommand_WhenProcessing_CanExecuteHasExpectedValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + _ = fixture.Freeze>().WithWaitForCancellation(); + + var sut = fixture.Create(); + ICommand start = sut.StartCommand; + SetFolders(sut, fs); + + Dictionary canStartWhen = new(); + + void AddDataPoint(string timePoint) + { + Thread.MemoryBarrier(); + canStartWhen[timePoint] = start.CanExecute(null); + } + + // ACT + AddDataPoint("ready to run"); + + var startCommandTask = sut.StartCommand.Execute(default).ToTask(); + AddDataPoint("running"); + + var stopCommandTask = sut.StopCommand.Execute(default).ToTask(); + await startCommandTask; + await stopCommandTask; + AddDataPoint("stopped"); + + for (int k = 0; !canStartWhen["stopped"] && k < 100; k++) + { + // canStartWhen["stopped"] has sporadically been false, + // e. g. in https://github.com/m-ringler/netczicompress/actions/runs/6195449563/job/16820188169?pr=47 + // This is probably due to the fact that ReactiveCommand overrides the passed in CanExecute observable + // with false while it is executing. So, CanExecute becomes true again only _after_ the command has + // stopped executing, i. e. _after_ startCommandTask completes. Thus, we have a race condition. + // => Wait a bit and try again. + await Task.Delay(10); + AddDataPoint("stopped"); + } + + // ASSERT + canStartWhen["ready to run"].Should().BeTrue(); + canStartWhen["running"].Should().BeFalse(); + try + { + canStartWhen["stopped"].Should().BeTrue(); + } + catch (Exception ex) + { + throw new Exception(canStartWhen["stopped"].ToString(), ex); + } + } + + [Fact] + public async Task StartCommands_WhenProcessingCompletes_CanExecuteIsTrue() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + _ = fixture.Freeze>().WithAutoData(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs); + + // ACT + var startCommandTask = sut.StartCommand.Execute(default).ToTask(); + await startCommandTask; + + // ASSERT + ICommand start = sut.StartCommand; + start.CanExecute(null).Should().BeTrue(); + } + + [Theory] + [AutoData] + public async Task StartCommands_WhenProcessingStarts_UsesCorrectParameters(OperationMode selectedMode, bool recursive) + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + var folderCompressorMock = fixture.Freeze>().WithWaitForCancellation(); + + var sut = fixture.Create(); + SetFolders(sut, fs); + sut.SelectedMode = selectedMode; + sut.Recursive = recursive; + + // ACT + var startCommandTask = sut.StartCommand.Execute(default).ToTask(); + + // ASSERT + folderCompressorMock.Verify( + x => x.PrepareNewRun( + It.Is( + x => x.InputDir.FullName == sut.InputDirectory && + x.OutputDir.FullName == sut.OutputDirectory && + x.InputDir.FileSystem == fs && + x.OutputDir.FileSystem == fs && + x.Recursive == recursive && + x.Mode == selectedMode.Value), + It.Is(t => !t.IsCancellationRequested)), + Times.Once); + + // CLEANUP + await sut.StopCommand.Execute(default); + await startCommandTask; + folderCompressorMock.VerifyNoOtherCalls(); + } + + [Theory] + [AutoData] + public async Task StartCommands_WhenProcessingStarts_LogsCorrectParameters(OperationMode selectedMode, bool recursive) + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + _ = fixture.Freeze>().WithWaitForCancellation(); + var loggerMock = new LoggerMock().Inject(fixture); + + var sut = fixture.Create(); + SetFolders(sut, fs); + sut.SelectedMode = selectedMode; + sut.Recursive = recursive; + + // ACT + var startCommandTask = sut.StartCommand.Execute(default).ToTask(); + + // ASSERT + loggerMock.VerifySingleEntry( + Microsoft.Extensions.Logging.LogLevel.Information, + $"Starting run: FolderCompressorParameters {{ InputDir = {sut.InputDirectory}, OutputDir = {sut.OutputDirectory}, Recursive = {recursive}, Mode = {selectedMode.Value}, ExecutionOptions = ExecutionOptions {{ ThreadCount = {sut.ThreadCount} }}, ProcessingOptions = ProcessingOptions {{ CompressionLevel = {sut.CompressionLevel}, CopyFailedFiles = {sut.CopyFailedFiles} }} }}"); + + // CLEANUP + await sut.StopCommand.Execute(default); + await startCommandTask; + } +} diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs new file mode 100644 index 0000000..60860f9 --- /dev/null +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs @@ -0,0 +1,96 @@ +// SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH +// +// SPDX-License-Identifier: GPL-3.0-or-later + +namespace netczicompressTests.ViewModels; + +using System.IO.Abstractions; +using System.Reactive.Threading.Tasks; +using System.Windows.Input; + +using AutoFixture; + +using netczicompress.ViewModels; + +using netczicompressTests.Models.Mocks; + +/// +/// Tests for . +/// +/// Tests for . +public partial class MainViewModelTests +{ + [Fact] + public async Task StopCommand_WhenProcessing_CanExecuteHasExpectedValues() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + _ = fixture.Freeze>().WithWaitForCancellation(); + + var sut = fixture.Create(); + ICommand start = sut.StartCommand; + ICommand stop = sut.StopCommand; + SetFolders(sut, fs); + + Dictionary canStopWhen = new(); + + void AddDataPoint(string timePoint) + { + var canStop = stop.CanExecute(null); + canStopWhen[timePoint] = stop.CanExecute(null); + sut.CanStop.Should().Be(canStop); + } + + // ACT + AddDataPoint("ready to run"); + + Task startCommandTask; + using (var monitor = sut.Monitor()) + { + startCommandTask = sut.StartCommand.Execute(default).ToTask(); + monitor.Should().RaisePropertyChangeFor(mvm => mvm.CanStop); + AddDataPoint("running"); + } + + Task stopCommandTask; + using (var monitor = sut.Monitor()) + { + stopCommandTask = sut.StopCommand.Execute(default).ToTask(); + monitor.Should().RaisePropertyChangeFor(mvm => mvm.CanStop); + AddDataPoint("stopping"); + } + + await startCommandTask; + await stopCommandTask; + AddDataPoint("stopped"); + + // ASSERT + canStopWhen["ready to run"].Should().BeFalse(); + canStopWhen["running"].Should().BeTrue(); + canStopWhen["stopping"].Should().BeFalse(); + canStopWhen["stopped"].Should().BeFalse(); + } + + [Fact] + public async Task StartCommands_WhenProcessingCompletes_CanExecuteIsFalse() + { + // ARRANGE + IFixture fixture = CreateFixture(); + IFileSystem fs = NewMockFileSystem(); + fixture.Inject(fs); + _ = fixture.Freeze>().WithAutoData(fixture); + + var sut = fixture.Create(); + ICommand stop = sut.StopCommand; + SetFolders(sut, fs); + + // ACT + var startCommandTask = sut.StartCommand.Execute(default).ToTask(); + await startCommandTask; + + // ASSERT + stop.CanExecute(null).Should().BeFalse(); + } +} diff --git a/czishrink/netczicompressTests/mandelbrot.czi b/czishrink/netczicompressTests/mandelbrot.czi new file mode 100644 index 0000000000000000000000000000000000000000..94600acf1e4bdd4723418b3f17bd3bf4dc90cb35 GIT binary patch literal 101600 zcmeFa1$-S<`aXW%BQy8jBy|d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#UMFYjb)k6&~sS=uG!C~i0PG<-)xH2E<*$_gWt4k9`SVZT* z3w$Svr77oOFsErKQnX;1NnY&>*Fi*|I(h1BbN-yr#91dqUm3wQDrl9a93q;?qE<)H zF#w6ewA1Yld3v1reT&bUkN1{N?w))N`K*SAjZccB<53y1?W~II#bH_5IYw8A7-!d73AXNW`NNab0kF#Nb7 zqfn3p#w%%dOTfCvBS_iC!|0+5{rclG9xhuQ9=b=85D-e;W|bZn{EpGLL|Zrfr`XzM z)uwZCg%EP(y%`N2kJG9iZqU<>W$kqoh#lL=Mpakr(!iv^mL$YaK5wnF#PDz^_2)PK zuYA0SRru7|lH_1XpC!0jQ$S3iLm*;5(L@!b-zW>l1YI}OfUubr2SAK%DOG&Sd{ODA zRn-2iVkZ{_3X`M)=aUWnVXX)6JD zY1bNI#f1d}{Wjm_CxscjG7WU}oi+Np1=o(C2>WJ@r-OFl9p)+)Dn9e`KwNs!AclDp z?&$3yvb-$o62)*s$DJ{}XFC(r7hOV+z$O2FQPOQ+Qg&f@`S{&rluglaa^ZA8V68Kt zH9+mz7=1DaJy|jXXLv2U`am_WQg1V*PTMG{khx;#I(l1LPbOpC?@`pTt;@098Qm*c z2%ks!FD2rgy3iy}(e@%o))S6%fF71l_uu=GSC{FGjBYAy1)L_D$^}zr{^HlmH@{>V zDEO+YGb_$TR@O{BQJIF+j!ICCP}AqzZH=fH*UkRl$8ur zU@#pl4FCDwQi1{l>HKCMKZ*2{3Em0>URE$Z4^6GZt&iffpmmbdr+Di;Y7TD;QN?-! z@}1+%xwYMW+U + + false + true + x64 + + + + + + + + + PreserveNewest + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + diff --git a/czishrink/packages_local/libczicompressc.0.5.1-alpha.0.nupkg b/czishrink/packages_local/libczicompressc.0.5.1-alpha.0.nupkg new file mode 100644 index 0000000..f0ad1f7 --- /dev/null +++ b/czishrink/packages_local/libczicompressc.0.5.1-alpha.0.nupkg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:552d2554704d6964e3900a80bcee3d73b6f688aafda0981d7c1d8110fa7560bc +size 2039939 diff --git a/czishrink/stylecop.json b/czishrink/stylecop.json new file mode 100644 index 0000000..11eedfa --- /dev/null +++ b/czishrink/stylecop.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + + "settings": { + "namingRules": { + "allowedNamespaceComponents": [ + "netczicompress", + "netczicompressTests" + ] + } + } +} \ No newline at end of file diff --git a/czishrink/upgrade-libczicompressc.ps1 b/czishrink/upgrade-libczicompressc.ps1 new file mode 100644 index 0000000..05385a1 --- /dev/null +++ b/czishrink/upgrade-libczicompressc.ps1 @@ -0,0 +1,363 @@ +<# +.SYNOPSIS + +Upgrades libczicompressc.nupkg in CziShrink with the latest cmake build of main of https://github.com/ZEISS/czicompress. + +.DESCRIPTION + +This script should be run in the czishrink directory of a clone of https://github.com/m-ringler/netczicompress. +Make sure that the working directory is clean. Otherwise the script will stash local changes. + +You must have git and dotnet on your path. + +The script needs to have access to both the https://github.com/ZEISS/czicompress and the https://github.com/m-ringler/netczicompress github repo, +you need to + * create a 'classic' personal access token at https://github.com/settings/tokens or with github cli, + * and authorize it for the ZEISS organization via the "Configure SSO" button, + * and store it in a GITHUB_TOKEN environment variable or pass it as the -GithubToken parameter to this script. + +If you specify a -DownloadFolder the script will use the data downloaded to that folder in a previous run. This provides rudimentary resume-on-error functionality. + +.EXAMPLE + +PS> ./upgrade-libczicompressc.ps1 -DownloadFolder "$env:TEMP/libczicompress/cache" -NoPullRequest + +.PARAMETER DownloadFolder + +The folder where downloads are stored and cached. Defaults to "$env:Temp/libczicompressc/$(Get-Date -Format FileDate)". +Downloads in that folder will be reused unless you use -NoCache. +The folder is created if necessary. +The folder will not be deleted or emptied at the end of the script. + +.PARAMETER NugetExePath + +The path to Nuget.exe. If this is not specified and nuget.exe is found on the $env:PATH we use that nuget.exe. +Otherwise defaults to DownloadFolder/nuget.exe. If nuget.exe is not found it is downloaded and stored at this path. + +.PARAMETER GithubToken + +The github personal access token to use. Can be created at https://github.com/settings/tokens or with github cli (gh auth token). +Defaults to the value of $env:GITHUB_TOKEN. + +.PARAMETER NoPR + +This switch prevents a pull request from being created. + +.PARAMETER NoCache + +This switch prevents previous downloads in the DownloadFolder from being reused. + +.PARAMETER OverwriteExistingBranch + +Overwrites an existing upgrade branch. This can be useful if a previous run of the script has failed. Applies to local and remote. + +#> + +param( + [Parameter(Mandatory=$false)] + [AllowNull()] + [string]$DownloadFolder = $null, + + [Parameter(Mandatory=$false)] + [string]$NugetExePath = $null, + + [Parameter(Mandatory=$false)] + [string]$GithubToken = $env:GITHUB_TOKEN, + + [Parameter(Mandatory=$false)] + [switch]$NoPR, + + [Parameter(Mandatory=$false)] + [switch]$NoCache, + + [Parameter(Mandatory=$false)] + [switch]$OverwriteExistingBranch +) + +$CreatePullRequest = !$NoPR +$UseCache = !$NoCache + +Import-Module -Name Microsoft.PowerShell.Utility +Import-Module -Name Microsoft.PowerShell.Archive + +$ErrorActionPreference = "Stop" + +# The name of the CziCompress repo +$CziCompress = "ZEISS/czicompress" +########################################################## +# PART 1: Download latest CmakeBuild artifacts from GitHub +########################################################## + +if ($null -eq $GithubToken) { + throw "You must set the GITHUB_TOKEN environment variable to a personal access token of yours: https://github.com/settings/tokens. See also: https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on" +} + +$GithubApiHeaders = @{ + 'Accept' = 'application/vnd.github+json' + 'X-GitHub-Api-Version' = '2022-11-28' + 'Authorization' = "Bearer $GithubToken" +} + +if (!$DownloadFolder) { + $DownloadFolder = "$env:Temp/libczicompressc/$(Get-Date -Format FileDate)" +} + +Write-Output "INFO: Using DownloadFolder $DownloadFolder" +if (!(Test-Path $DownloadFolder)) { + mkdir $DownloadFolder +} + +# We'll use the following properties +# artifacts_url -> download dll/so +# head_sha -> nuspec git commit +$LatestRunJson = "$DownloadFolder/LatestRunOfCMakeBuild.json" + +if ($UseCache -and (Test-Path -Path $LatestRunJson)) { + Write-Output "INFO: Using previously downloaded build info from $LatestRunJson." + $LatestRunOfCMakeBuild = Get-Content $LatestRunJson | ConvertFrom-Json +} else { + # Get latest run + Write-Output "INFO: Getting build info from github.com/$CziCompress." + $ActionRunsUri = "https://api.github.com/repos/$CziCompress/actions/runs?branch=main&status=success&per_page=10" + $ServerResponse = Invoke-WebRequest -Uri $ActionRunsUri -Headers $GithubApiHeaders | ConvertFrom-Json + $RunsOfCmakeBuild = $ServerResponse.workflow_runs | Where-Object Name -eq 'CMake Build' + + $LatestRunOfCMakeBuild = $RunsOfCmakeBuild | Sort-Object -Property 'run_number' | Select-Object -Last 1 + $LatestRunOfCMakeBuild | ConvertTo-Json | Set-Content -Path $LatestRunJson +} + +$LinuxArtifactZip = "$DownloadFolder/linux.zip" +$WindowsArtifactZip = "$DownloadFolder/win.zip" +$DownloadLinux = $NoCache -or !(Test-Path $LinuxArtifactZip) +$DownloadWindows = $NoCache -or !(Test-Path $WindowsArtifactZip) + +if ($DownloadWindows -or $DownloadLinux) +{ + # Download the artifacts + Write-Output "INFO: Downloading artifacts from $($LatestRunOfCMakeBuild.artifacts_url)" + $ServerResponse = Invoke-WebRequest -Uri $LatestRunOfCMakeBuild.artifacts_url -Headers $GithubApiHeaders | ConvertFrom-Json + + $LinuxArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-ubuntu-release-package-on" + $WindowsArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-windows-64-release-msvc-package-on" + + if ($ServerResponse.total_count -eq 0) { + throw "No artifacts found." + } + + try { + if ($DownloadLinux) + { + Invoke-WebRequest -Uri $LinuxArtifact.archive_download_url -Headers $GithubApiHeaders -OutFile $LinuxArtifactZip + } + + if ($DownloadWindows) + { + Invoke-WebRequest -Uri $WindowsArtifact.archive_download_url -Headers $GithubApiHeaders -OutFile $WindowsArtifactZip + } + } catch { + Write-Output "ERROR: unable to download artifacts." + throw + } +} else { + Write-Output "INFO: Using previously download artifact ZIP files in $DownloadFolder" +} + +# Extract libczicompressc binaries +Expand-Archive -Path $LinuxArtifactZip -Force -DestinationPath "$DownloadFolder" +Expand-Archive -Path $WindowsArtifactZip -Force -DestinationPath "$DownloadFolder" + +############################################# +# Part 2: Build and use the new nuget package +############################################# + +# Get the new library version +$NewLibVersion = (Get-Item "$DownloadFolder/libczicompressc.dll").VersionInfo.ProductVersion.Replace(",", ".") +$NewLibVersion_ = $NewLibVersion.Replace(".", "_") +$NewFileVersion = (Get-Item "$DownloadFolder/libczicompressc.dll").VersionInfo.FileVersionRaw + +$BranchName = "feature/upgrade-libczicompressc-$NewLibVersion_" +Write-Output "INFO: The new library version is $NewLibVersion => Create branch $BranchName and switch to it." + +if (![string]::IsNullOrEmpty($PSScriptRoot)) { + Set-Location "$PSScriptRoot/libczicompressc" +} else { + $current_dir_name = Get-Location | Split-Path -Leaf + if ("czishrink" -eq $current_dir_name) + { + Set-Location "libczicompressc" + } elseif ("libczicompress" -ne $current_dir_name) { + throw "Please CD to the /czishrink directory of a netczicompress clone." + } +} + +# Stash any local changes +$GitStatus = git status --porcelain +if($LASTEXITCODE -ne 0) { + throw "git status failed" +} + +if (![string]::IsNullOrEmpty($GitStatus)) { + Write-Output "INFO: Stashing local changes" + git stash --include-untracked + if($LASTEXITCODE -ne 0) { + throw "git stash failed" + } +} + +# Switch to main and pull +git switch main +if($LASTEXITCODE -ne 0) { + throw "git switch failed" +} + +git pull +if($LASTEXITCODE -ne 0) { + throw "git pull failed" +} + +# Create a new branch +$gitSwitchCreateFlag = "-c" +if ($OverwriteExistingBranch) { + $gitSwitchCreateFlag = "-C" +} + +git switch $gitSwitchCreateFlag $BranchName +if($LASTEXITCODE -ne 0) { + throw "Failed to create branch $BranchName. Please delete the branch if it exists." +} + +# Put the binaries into the nuget folder structure +Write-Output "INFO: Creating the new nuget package..." +$libname="libczicompressc" +$LinuxRuntime="runtimes\linux-x64\native\$libname.so" +$WindowsRuntime="runtimes\win-x64\native\$libname.dll" +Copy-Item -Path "$DownloadFolder/$libname.so" -Destination $LinuxRuntime +Copy-Item -Path "$DownloadFolder/$libname.dll" -Destination $WindowsRuntime + +# Modify the nuspec +$nuspec=Get-Item "libczicompressc.nuspec" +$xml = [xml](Get-Content -Path $nuspec.FullName) +$xml.package.metadata.version = $NewLibVersion +$xml.package.metadata.repository.commit = $LatestRunOfCMakeBuild.head_sha +$xml.Save($nuspec.FullName) + +# Download nuget.exe if necessary and run nuget pack +if (!$NugetExePath) { + try { + $NugetExePath = (Get-Command "nuget.exe").Source + } catch { + $NugetExePath = "$DownloadFolder/nuget.exe" + } +} + +if (!(Test-Path -Path $NugetExePath)) { + Write-Output "INFO: Downloading nuget.exe to $NugetExePath" + Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile $NugetExePath +} else { + Write-Output "INFO: Using nuget.exe at $NugetExePath" +} + +& $NugetExePath pack "libczicompressc.nuspec" +if($LASTEXITCODE -ne 0) { + throw "nuget failed" +} + +# Revert changes to so/dll +git checkout -- $LinuxRuntime +if($LASTEXITCODE -ne 0) { + throw "git checkout failed" +} + +git checkout -- $WindowsRuntime +if($LASTEXITCODE -ne 0) { + throw "git checkout failed" +} + +# Exchange the nupkg and update version in Directory.Packages.props +Remove-Item ../packages_local/*.nupkg +Move-Item -Path "libczicompressc.$NewLibVersion.nupkg" -Destination ../packages_local + +Write-Output "INFO: Updating Directory.Packages.props" +Set-Location .. +$file = Get-Item "Directory.Packages.props" +$xml = [xml](Get-Content -Path $file.FullName) +$versionElement = $xml.SelectSingleNode('//PackageVersion[@Include="libczicompressc"]') +$versionElement.Version = $NewLibVersion +$xml.Save($file.FullName) + +################################################ +# Part 3: Update, build, and test netczicompress +################################################ + +# Update PInvokeFileProcessor.cs +Write-Output "INFO: Updating PInvokeFileProcessor.cs" +$SourceCode = Get-Content -Path netczicompress/Models/PInvokeFileProcessor.cs +$NewVersionTuple="($($NewFileVersion.Major), $($NewFileVersion.Minor))" +$AlteredSourceCode = $SourceCode -replace '^( *\(int Major, int Minor\) expected = ).*?;$',('$1' + $NewVersionTuple + ";") +Set-Content -Path netczicompress/Models/PInvokeFileProcessor.cs -Value $AlteredSourceCode + +# Increment VersionSuffix +Write-Output "INFO: Incrementing VersionSuffix in Directory.Build.props" +$file = Get-Item "Directory.Build.props" +$xml = [xml](Get-Content -Path $file.FullName) +$versionElement = $xml.SelectSingleNode('//VersionSuffix') +$VersionTokens = $versionElement.'#text'.split(".") +$versionElement.'#comment' = $BranchName +$VersionTokens[1] = [string]([int]($VersionTokens.split(".")[1]) + 1) +$versionElement.'#text' = "$($VersionTokens[0]).$($VersionTokens[1])" +$xml.Save($file.FullName) + +# Git commit everything +Write-Output "INFO: Committing all changes" +$CommitMessage = "Upgrade $libname to $NewLibVersion" +git add . +if($LASTEXITCODE -ne 0) { + throw "git add failed" +} +git commit -m $CommitMessage +if($LASTEXITCODE -ne 0) { + throw "git commit failed" +} + +# Run tests +Write-Output "INFO: Run tests" +dotnet test +if($LASTEXITCODE -ne 0) { + throw "dotnet test failed" +} + +# Git Push +Write-Output "INFO: Push changes" + +$gitForceFlag = "" +if ($OverwriteExistingBranch) { + $gitForceFlag = "--force" +} + +git push $gitForceFlag --set-upstream origin $BranchName +if($LASTEXITCODE -ne 0) { + throw "git push failed" +} + +# Create a pull request +if ($CreatePullRequest) { + $remote = git config --get remote.origin.url + if($LASTEXITCODE -ne 0) { + throw "git config failed" + } + + $CziShrinkRepo = $remote.Replace("https://github.com/", "") -replace "\.git$", "" + + Write-Output "INFO: Create a Pull Request" + $postParams = @{ + 'title'=$CommitMessage + 'body'="Automatic upgrade of $libname" + 'head'=$BranchName + 'base'='main' + } | ConvertTo-Json + + $ServerResponse = Invoke-WebRequest -Headers $GithubApiHeaders -Uri https://api.github.com/repos/$CziShrinkRepo/pulls -Method POST -Body $postParams + $PullRequestUrl = ($ServerResponse | ConvertFrom-Json).html_url + Write-Output "Opened a PR at $PullRequestUrl" + Start-Process $PullRequestUrl +} \ No newline at end of file From 2a89b1590d1fa67e0b7ab5be9ba393e077dc3d58 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 14:10:32 +0100 Subject: [PATCH 07/32] Fix REUSE --- .github/workflows/czishrink_codeql.yml | 2 +- .reuse/dep5 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/czishrink_codeql.yml b/.github/workflows/czishrink_codeql.yml index 1004c0f..891e8d2 100644 --- a/.github/workflows/czishrink_codeql.yml +++ b/.github/workflows/czishrink_codeql.yml @@ -1,5 +1,5 @@ --- -name: "CodeQL" +name: "CodeQL (CziShrink)" on: # push: diff --git a/.reuse/dep5 b/.reuse/dep5 index 9c3ee9d..8da6156 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -11,7 +11,7 @@ Files: .github/* .gitignore czicompress/.editorconfig czicompress/.gitignore czi Copyright: 2023 Carl Zeiss Microscopy GmbH License: CC0-1.0 -Files: czishrink/*.axaml czishrink/*.json czishrink/*.nuspec czishrink/*.txt czishrink/*.ico czishrink/*.png czishrink/*.props czishrink/*.targets czishrink/*.sh czishrink/*.svg czishrink/*.csproj czishrink/*.gitattributes czishrink/*.nupkg czishrink/*.md czishrink/*.pdf czishrink/*.config czishrink/*.ruleset czishrink/*.ps1 czishrink/*.czi czishrink/*.xml czishrink/*.sln czishrink/*.manifest README.md +Files: czishrink/*.axaml czishrink/.gitignore czishrink/*/.gitignore czishrink/*.json czishrink/*.nuspec czishrink/*.txt czishrink/*.ico czishrink/*.png czishrink/*.props czishrink/*.targets czishrink/*.sh czishrink/*.svg czishrink/*.csproj czishrink/*.gitattributes czishrink/*.nupkg czishrink/*.md czishrink/*.pdf czishrink/*.config czishrink/*.ruleset czishrink/*.ps1 czishrink/*.czi czishrink/*.xml czishrink/*.sln czishrink/*.manifest README.md Copyright: 2023 Carl Zeiss Microscopy GmbH License: GPL-3.0-or-later From dc9f6bdb258751314733cd7a7c9240aaf5ff2dc4 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 14:38:02 +0100 Subject: [PATCH 08/32] Activate CodeQL for czishrink --- .github/workflows/czishrink_codeql.yml | 54 +++++++++++++++++--------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/.github/workflows/czishrink_codeql.yml b/.github/workflows/czishrink_codeql.yml index 891e8d2..07dab0c 100644 --- a/.github/workflows/czishrink_codeql.yml +++ b/.github/workflows/czishrink_codeql.yml @@ -2,12 +2,23 @@ name: "CodeQL (CziShrink)" on: - # push: - # branches: [main] - # paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] - # pull_request: - # branches: [main] - # paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] + push: + branches: [main] + paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] + pull_request: + branches: [main] + paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # │ │ │ │ │ + # │ │ │ │ │ + # │ │ │ │ │ + # * * * * * + - cron: '30 2 * * 2' workflow_dispatch: {} permissions: read-all @@ -17,28 +28,33 @@ jobs: name: Analyze CziShrink defaults: run: - working-directory: ${{github.workspace}}/czishrink + working-directory: czishrink runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: ['csharp'] + permissions: + security-events: write steps: - name: Checkout repository uses: actions/checkout@v3 + with: + lfs: true + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: - languages: ${{ matrix.language }} + languages: csharp queries: security-and-quality - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - with: - working-directory: czishrink + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore -c Release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 16f92411921c6aa022b402ab49a88e973d36c43f Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 16:28:11 +0100 Subject: [PATCH 09/32] Change workflow name --- .github/workflows/czishrink_dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index bc3b88d..f358fd5 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -5,7 +5,7 @@ permissions: pull-requests: write contents: read -name: .NET +name: .NET Build (CziShrink) on: push: From 7a81d43c12583e9815897722307b2354337538f2 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 16:29:11 +0100 Subject: [PATCH 10/32] Change workflow name --- .github/workflows/czicompress_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 300edd7..0137ef9 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -1,5 +1,5 @@ --- -name: CMake Build +name: CMake Build (czicompress) on: push: From fb34d1fe553dfd773a171d5818878ee1ab54dff5 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 16:44:00 +0100 Subject: [PATCH 11/32] Adapt badges in Readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cead74..914ff5e 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,21 @@ # czicompress -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![REUSE status](https://api.reuse.software/badge/github.com/ZEISS/czicompress)](https://api.reuse.software/info/github.com/ZEISS/czicompress) [![MegaLinter](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml) Reduce the size of existing CZI files by converting them to zstd-compressed CZI files. # Command line tool and C/C++ libraries +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![CMake](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml) [![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml) [czicompress](czicompress/README.md) is a cross-platform command line tool to compress CZIs. czicompress and its source code are provided under the [MIT license](LICENSE). # CziShrink desktop app +[![License: GPL](https://img.shields.io/badge/License-GPL%203+-yellow.svg)](https://spdx.org/licenses/GPL-3.0-or-later.html) +[![Build](https://github.com/ZEISS/czicompress/actions/workflows/czishrink_dotnet.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czishrink_dotnet.yml) +[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/czishrink_codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czishrink_codeql.yml) + [czishrink](czishrink/README.md) is a desktop app to compress CZIs. CziShrink is provided under the [GPLv3 license](czishrink/LICENSE.txt). ## Guidelines From e37e3b890ddde62076e96531ccebbbf0b890cc49 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Tue, 7 Nov 2023 17:22:41 +0100 Subject: [PATCH 12/32] Increment czishrink version --- czishrink/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czishrink/Directory.Build.props b/czishrink/Directory.Build.props index 4066629..d154d14 100644 --- a/czishrink/Directory.Build.props +++ b/czishrink/Directory.Build.props @@ -11,6 +11,6 @@ true 1.0.0 - alpha.45 + alpha.46 From 1e91b9f5d59f2dc1530033668300c846340e0497 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 17:34:02 +0100 Subject: [PATCH 13/32] Fix cmake artifact upload --- .github/workflows/czicompress_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 0137ef9..16c937f 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -111,4 +111,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: czicompress-${{matrix.config.name}} - path: czicompress-${{matrix.config.name}}/ + path: czicompress/czicompress-${{matrix.config.name}}/ From e2a849654a06ef6a1f725275d2baa8d41325a5e9 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 18:10:48 +0100 Subject: [PATCH 14/32] Update build name in upgrade script --- czishrink/upgrade-libczicompressc.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czishrink/upgrade-libczicompressc.ps1 b/czishrink/upgrade-libczicompressc.ps1 index 05385a1..f78fa58 100644 --- a/czishrink/upgrade-libczicompressc.ps1 +++ b/czishrink/upgrade-libczicompressc.ps1 @@ -120,7 +120,7 @@ if ($UseCache -and (Test-Path -Path $LatestRunJson)) { Write-Output "INFO: Getting build info from github.com/$CziCompress." $ActionRunsUri = "https://api.github.com/repos/$CziCompress/actions/runs?branch=main&status=success&per_page=10" $ServerResponse = Invoke-WebRequest -Uri $ActionRunsUri -Headers $GithubApiHeaders | ConvertFrom-Json - $RunsOfCmakeBuild = $ServerResponse.workflow_runs | Where-Object Name -eq 'CMake Build' + $RunsOfCmakeBuild = $ServerResponse.workflow_runs | Where-Object Name -eq 'CMake Build (czicompress)' $LatestRunOfCMakeBuild = $RunsOfCmakeBuild | Sort-Object -Property 'run_number' | Select-Object -Last 1 $LatestRunOfCMakeBuild | ConvertTo-Json | Set-Content -Path $LatestRunJson From 759a643defd3c32225c423edf225b999ff7b6438 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Tue, 7 Nov 2023 18:11:36 +0100 Subject: [PATCH 15/32] Add run ID to VersionSuffix in dotnet build --- .github/workflows/czishrink_dotnet.yml | 24 +++++++++++++------ .../netczicompressTests/AppComposerTests.cs | 2 +- .../Models/ProgramNameAndVersionTests.cs | 4 ++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index f358fd5..0fd9299 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -49,6 +49,23 @@ jobs: with: dotnet-version: 7.0.x + - name: Get Version from Directory.Build.props + id: getversion + uses: m-ringler/get-xpath@v3 + with: + xml-file: czishrink/Directory.Build.props + xpath: 'concat(//VersionPrefix/text(), "-", //VersionSuffix/text())' + + - name: Add build ID to version + run: | + Write-Output "Add build ID ${{ github.run_id }} to VersionSuffix in Directory.Build.props" + $file = Get-Item "Directory.Build.props" + $xml = [xml](Get-Content -Path $file.FullName) + $versionElement = $xml.SelectSingleNode('//VersionSuffix') + $versionElement.'#text' += '+${{ github.run_id }}' + $xml.Save($file.FullName) + shell: pwsh + - name: Restore dependencies run: dotnet restore @@ -111,13 +128,6 @@ jobs: -p:PublishReadyToRunShowWarnings=true -o ${{ github.workspace }}/publish - - name: Get Version from Directory.Build.props - id: getversion - uses: m-ringler/get-xpath@v3 - with: - xml-file: czishrink/Directory.Build.props - xpath: 'concat(//VersionPrefix/text(), "-", //VersionSuffix/text())' - - name: Upload published binaries uses: actions/upload-artifact@v3 if: github.event_name == 'push' diff --git a/czishrink/netczicompressTests/AppComposerTests.cs b/czishrink/netczicompressTests/AppComposerTests.cs index 0b57ec4..cae75d8 100644 --- a/czishrink/netczicompressTests/AppComposerTests.cs +++ b/czishrink/netczicompressTests/AppComposerTests.cs @@ -45,6 +45,6 @@ public void ComposeMainViewModel_WhenCalledDoesNotThrow_AndLogsMessage() actual.OverallStatus.Should().BeEmpty(); } - [GeneratedRegex(@"^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+?[+-]\d\d:\d\d\|netczicompress.App\|INFO\|0\|Starting CZI Shrink 1\.0\.0-alpha\.[1-9]\d* using libczicompressc \d*?\.\d+?\.\d+?.*")] + [GeneratedRegex(@"^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+?[+-]\d\d:\d\d\|netczicompress.App\|INFO\|0\|Starting CZI Shrink \d+\.\d+\.\d+.*? using libczicompressc \d+\.\d+\.\d+.*")] private static partial Regex ExpectedLogMessagePattern(); } \ No newline at end of file diff --git a/czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs b/czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs index 7c395ab..1c15d3f 100644 --- a/czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs +++ b/czishrink/netczicompressTests/Models/ProgramNameAndVersionTests.cs @@ -18,7 +18,7 @@ public void ToString_WhenCalled_ReturnsExpected() var actual = new ProgramNameAndVersion().ToString(); // ASSERT - var re = new Regex(@"^CZI Shrink 1\.0\.0-alpha\.[1-9]\d\d*$"); + var re = new Regex(@"^CZI Shrink 1\.0\.0-alpha\.[1-9]\d\d*(\+\d+)?$"); re.IsMatch(actual).Should().BeTrue(); } @@ -39,7 +39,7 @@ public void Version_WhenCalled_ReturnsExpected() var actual = new ProgramNameAndVersion().Version; // ASSERT - var re = new Regex(@"^1\.0\.0-alpha\.[1-9]\d\d*$"); + var re = new Regex(@"^1\.0\.0-alpha\.[1-9]\d\d*(\+\d+)?$"); re.IsMatch(actual).Should().BeTrue(); } } From a1e577a1766e5e1f4cbd599c1d79d78679e76e39 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Tue, 7 Nov 2023 21:23:55 +0100 Subject: [PATCH 16/32] Fix links in README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 914ff5e..97ac11b 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ Reduce the size of existing CZI files by converting them to zstd-compressed CZI # Command line tool and C/C++ libraries [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![CMake](https://github.com/ZEISS/czicompress/actions/workflows/cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml) -[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml) +[![CMake](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml) +[![CodeQL](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml) -[czicompress](czicompress/README.md) is a cross-platform command line tool to compress CZIs. czicompress and its source code are provided under the [MIT license](LICENSE). +[czicompress](czicompress/README.md) is a cross-platform command line tool to compress CZIs. czicompress and its source code are provided under the [MIT license](czicompress/LICENSE). # CziShrink desktop app [![License: GPL](https://img.shields.io/badge/License-GPL%203+-yellow.svg)](https://spdx.org/licenses/GPL-3.0-or-later.html) @@ -23,4 +23,4 @@ Reduce the size of existing CZI files by converting them to zstd-compressed CZI [Contributing](./CONTRIBUTING.md) ## Disclaimer -ZEISS, ZEISS.com are registered trademarks of Carl Zeiss AG. \ No newline at end of file +ZEISS, ZEISS.com are registered trademarks of Carl Zeiss AG. From dd541b0fed9c9d949b224947f0479aa2ae0e910b Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Tue, 7 Nov 2023 21:47:23 +0100 Subject: [PATCH 17/32] Update upgrade-libczicompressc.ps1 --- czishrink/upgrade-libczicompressc.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/czishrink/upgrade-libczicompressc.ps1 b/czishrink/upgrade-libczicompressc.ps1 index f78fa58..85c9703 100644 --- a/czishrink/upgrade-libczicompressc.ps1 +++ b/czishrink/upgrade-libczicompressc.ps1 @@ -1,22 +1,22 @@ <# .SYNOPSIS -Upgrades libczicompressc.nupkg in CziShrink with the latest cmake build of main of https://github.com/ZEISS/czicompress. +Upgrades libczicompressc.nupkg in CziShrink with the latest cmake build of the main branch of czicompress. .DESCRIPTION -This script should be run in the czishrink directory of a clone of https://github.com/m-ringler/netczicompress. -Make sure that the working directory is clean. Otherwise the script will stash local changes. +This script should be run in the czishrink directory of a clone of https://github.com/ZEISS/czicompress. +Make sure that you do not have any uncommited changes before you run the script. Otherwise the script will stash such changes. You must have git and dotnet on your path. -The script needs to have access to both the https://github.com/ZEISS/czicompress and the https://github.com/m-ringler/netczicompress github repo, +The script needs to have access to the https://github.com/ZEISS/czicompress github repo (or your fork of that repo), you need to * create a 'classic' personal access token at https://github.com/settings/tokens or with github cli, * and authorize it for the ZEISS organization via the "Configure SSO" button, * and store it in a GITHUB_TOKEN environment variable or pass it as the -GithubToken parameter to this script. - -If you specify a -DownloadFolder the script will use the data downloaded to that folder in a previous run. This provides rudimentary resume-on-error functionality. + +If you specify a -DownloadFolder the script will reuse data downloaded to that folder in a previous run. This provides rudimentary resume-on-error functionality. .EXAMPLE @@ -186,7 +186,7 @@ if (![string]::IsNullOrEmpty($PSScriptRoot)) { { Set-Location "libczicompressc" } elseif ("libczicompress" -ne $current_dir_name) { - throw "Please CD to the /czishrink directory of a netczicompress clone." + throw "Please CD to the /czishrink directory of a czicompress clone." } } @@ -360,4 +360,4 @@ if ($CreatePullRequest) { $PullRequestUrl = ($ServerResponse | ConvertFrom-Json).html_url Write-Output "Opened a PR at $PullRequestUrl" Start-Process $PullRequestUrl -} \ No newline at end of file +} From 9d8f3d9b3183b86d1e2657057bd6bb6f543c0091 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Tue, 7 Nov 2023 21:59:44 +0100 Subject: [PATCH 18/32] Update upgrade-libczicompressc.ps1 --- czishrink/upgrade-libczicompressc.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czishrink/upgrade-libczicompressc.ps1 b/czishrink/upgrade-libczicompressc.ps1 index 85c9703..09da8d8 100644 --- a/czishrink/upgrade-libczicompressc.ps1 +++ b/czishrink/upgrade-libczicompressc.ps1 @@ -15,7 +15,7 @@ you need to * create a 'classic' personal access token at https://github.com/settings/tokens or with github cli, * and authorize it for the ZEISS organization via the "Configure SSO" button, * and store it in a GITHUB_TOKEN environment variable or pass it as the -GithubToken parameter to this script. - + If you specify a -DownloadFolder the script will reuse data downloaded to that folder in a previous run. This provides rudimentary resume-on-error functionality. .EXAMPLE From 968743bb033e228d12905a549d74fc7198f2554d Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Tue, 7 Nov 2023 22:09:14 +0100 Subject: [PATCH 19/32] Update README.md --- czishrink/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/czishrink/README.md b/czishrink/README.md index 7ceeaea..60d6f1d 100644 --- a/czishrink/README.md +++ b/czishrink/README.md @@ -136,7 +136,7 @@ There is no guarantee that any items on this list will be added, rather it is ju 2. Open a Powershell terminal and run [./upgrade-libczicompressc.ps1](./upgrade-libczicompressc.ps1). Run `get-help ./upgrade-libczicompressc.ps1` for more info. ## How to upgrade libczicompressc manually -1. Build libczicompressc.so on linux-x64 and libczicompressc.dll on win-x64 in release mode, or (preferred) get them from the [github CI build](https://github.com/zeissmicroscopy/czicompress/actions/workflows/cmake.yml). +1. Build libczicompressc.so on linux-x64 and libczicompressc.dll on win-x64 in release mode, or (preferred) get them from the [github CI build](https://github.com/zeissmicroscopy/czicompress/actions/workflows/czicompress_cmake.yml). 1. Put the binaries into [libczicompressc/runtimes/linux-x64/native](libczicompressc/runtimes/linux-x64/native) and [libczicompressc/runtimes/win-x64/native](libczicompressc/runtimes/win-x64/native) 1. Update the nuspec file [libczicompressc/libczicompressc.nuspec](libczicompressc/libczicompressc.nuspec): * `package/metadata/version` must be the 'ProductVersion' of libczicompressc.dll (explorer: Properties/Details) @@ -145,7 +145,7 @@ There is no guarantee that any items on this list will be added, rather it is ju 1. Open a shell in [libczicompressc](libczicompressc), and run `path/to/nuget pack libczicompressc.nuspec` 1. Move the resulting nupkg into [packages_local](packages_local) and delete the old package from there. 1. Change the version of libczicompressc in [Directory.Packages.props](Directory.Packages.props) -1. If major or minor version has changed, change the expected version number in [PInvokeFileProcessor](https://github.com/m-ringler/netczicompress/blob/a254a4a919120ad61aad707f39749709f0a36e1a/netczicompress/Models/PInvokeFileProcessor.cs#L124). +1. If major or minor version has changed, change the expected version number in [PInvokeFileProcessor](netczicompress/Models/PInvokeFileProcessor.cs). 1. Rebuild netczicompress.sln 1. Run netczicompressTests 1. Undo git changes to the libczicompressc.dll and libczicompressc.so files (no need to commit them, they are in the nupkg). From 968436f288da18d6f975dc8c6c83841975d3ef22 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Tue, 7 Nov 2023 22:09:46 +0100 Subject: [PATCH 20/32] Update README.md --- czishrink/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czishrink/README.md b/czishrink/README.md index 60d6f1d..87dfcf1 100644 --- a/czishrink/README.md +++ b/czishrink/README.md @@ -1,5 +1,5 @@ # CziShrink -An open source and cross-platform GUI for [CziCompress](https://github.com/zeissmicroscopy/czicompress), made with Avalonia UI and .NET. +An open source and cross-platform GUI for [CziCompress](https://github.com/ZEISS/czicompress), made with Avalonia UI and .NET. ## Table of contents From 98531d404198a741b7fb8bb4556901e94e08bc74 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Wed, 8 Nov 2023 09:35:13 +0100 Subject: [PATCH 21/32] Remove path filters from github workflows This is necessary for them to be usable in branch protection rules. --- .github/workflows/czicompress_cmake.yml | 2 -- .github/workflows/czicompress_codeql.yml | 1 - .github/workflows/czishrink_codeql.yml | 2 -- .github/workflows/czishrink_dotnet.yml | 2 -- 4 files changed, 7 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 16c937f..7447d00 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -4,10 +4,8 @@ name: CMake Build (czicompress) on: push: branches: ["main"] # run only when merge with main branch - paths: ["czicompress/**"] pull_request: branches: ["main"] # run only when merge with main branch - paths: ["czicompress/**"] workflow_dispatch: {} permissions: diff --git a/.github/workflows/czicompress_codeql.yml b/.github/workflows/czicompress_codeql.yml index 6dceeb9..8b07149 100644 --- a/.github/workflows/czicompress_codeql.yml +++ b/.github/workflows/czicompress_codeql.yml @@ -5,7 +5,6 @@ on: push: branches: ["main"] pull_request: - # The branches below must be a subset of the branches above branches: ["main"] schedule: - cron: "22 16 * * 4" diff --git a/.github/workflows/czishrink_codeql.yml b/.github/workflows/czishrink_codeql.yml index 07dab0c..28ef76c 100644 --- a/.github/workflows/czishrink_codeql.yml +++ b/.github/workflows/czishrink_codeql.yml @@ -4,10 +4,8 @@ name: "CodeQL (CziShrink)" on: push: branches: [main] - paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] pull_request: branches: [main] - paths: ["czishrink/**", ".github/workflows/czishrink_codeql.yml"] schedule: # ┌───────────── minute (0 - 59) # │ ┌───────────── hour (0 - 23) diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index 0fd9299..98b790d 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -10,10 +10,8 @@ name: .NET Build (CziShrink) on: push: branches: ["main"] - paths: ["czishrink/**"] pull_request: branches: ["main"] - paths: ["czishrink/**"] workflow_dispatch: {} jobs: From 34cdbdfef9803c4e90823f5e79e212738c5be22c Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Wed, 8 Nov 2023 10:11:22 +0100 Subject: [PATCH 22/32] Address CodeQL warnings --- .../netczicompressTests/Models/CompressionLevelTests.cs | 7 ++----- .../Models/PInvokeFileProcessorTests.cs | 1 - .../Models/StatisticsRunObserverTests.cs | 2 +- czishrink/netczicompressTests/Models/ThreadCountTests.cs | 5 +---- .../ViewModels/CompressionTaskViewModelTests.cs | 2 +- .../ViewModels/CurrentTasksViewModelTests.cs | 7 ++++--- czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs | 7 ++++--- .../ViewModels/ErrorListViewModelTests.cs | 3 ++- .../ViewModels/LogFileViewModelTests.cs | 4 ++-- .../ViewModels/MainViewModelTests.OverallStatus.cs | 3 --- .../ViewModels/MainViewModelTests.StartCommand.cs | 4 ++-- .../ViewModels/MainViewModelTests.StopCommand.cs | 1 - 12 files changed, 19 insertions(+), 27 deletions(-) diff --git a/czishrink/netczicompressTests/Models/CompressionLevelTests.cs b/czishrink/netczicompressTests/Models/CompressionLevelTests.cs index 4ff193e..1a0cd70 100644 --- a/czishrink/netczicompressTests/Models/CompressionLevelTests.cs +++ b/czishrink/netczicompressTests/Models/CompressionLevelTests.cs @@ -23,10 +23,7 @@ public void DefaultConstructor_HasDefaultValue() [InlineData(230)] public void OutOfRange_ShouldThrowOutOfRangeException(int value) { - var act = () => - { - var sut = new CompressionLevel() { Value = value }; - }; + var act = () => _ = new CompressionLevel { Value = value }; act.Should().Throw(); } @@ -37,7 +34,7 @@ public void OutOfRange_ShouldThrowOutOfRangeException(int value) [InlineData(0)] public void InRangeValue_ShouldBeEqual(int value) { - var sut = new CompressionLevel() { Value = value }; + var sut = new CompressionLevel { Value = value }; sut.Value.Should().Be(value); } } \ No newline at end of file diff --git a/czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs b/czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs index 2fbea63..c89cc99 100644 --- a/czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs +++ b/czishrink/netczicompressTests/Models/PInvokeFileProcessorTests.cs @@ -143,7 +143,6 @@ public void CompressWithLevel_FilesHaveCorrectSize( var compressedSize = GetLength(compressed); var decompressedSize = GetLength(uncompressed); - var originalSize = GetLength(testFile); // ASSERT compressedSize.Should().Be(expectedCompressedSize); diff --git a/czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs b/czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs index 5488bfa..223bade 100644 --- a/czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs +++ b/czishrink/netczicompressTests/Models/StatisticsRunObserverTests.cs @@ -45,7 +45,7 @@ public void ObserveRun_WhenRunCompletes_CorrectFirstAndFinalResult(int scanTimeM new(fileMock, 10, 1000, null, "Failed"), }; - var observable = new Subject(); + using var observable = new Subject(); var watch = Stopwatch.StartNew(); var sut = new StatisticsRunObserver( diff --git a/czishrink/netczicompressTests/Models/ThreadCountTests.cs b/czishrink/netczicompressTests/Models/ThreadCountTests.cs index d9c3fbc..bb7466e 100644 --- a/czishrink/netczicompressTests/Models/ThreadCountTests.cs +++ b/czishrink/netczicompressTests/Models/ThreadCountTests.cs @@ -22,10 +22,7 @@ public void DefaultConstructor_HasDefaultValue() [InlineData(230)] public void OutOfRange_ShouldThrowOutOfRangeException(int value) { - var act = () => - { - var sut = new ThreadCount() { Value = value }; - }; + var act = () => _ = new ThreadCount { Value = value }; act.Should().Throw(); } diff --git a/czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs index 772f406..24bb369 100644 --- a/czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs +++ b/czishrink/netczicompressTests/ViewModels/CompressionTaskViewModelTests.cs @@ -22,7 +22,7 @@ public void PublicProperties_WhenGot_HaveExpectedValues() { // ARRANGE var fileName = CreateFixture().Create(); - var progress = new BehaviorSubject(0); + using var progress = new BehaviorSubject(0); var sut = new CompressionTaskViewModel( fileName, progress); diff --git a/czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs index aff64a8..424e005 100644 --- a/czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs +++ b/czishrink/netczicompressTests/ViewModels/CurrentTasksViewModelTests.cs @@ -44,7 +44,8 @@ public void OnNext_WhenTaskFinished_DoesNotAddTaskToList() // ARRANGE var sut = new CurrentTasksViewModel(ImmediateScheduler.Instance); - var message = new FileStarting(Mock.Of(), new BehaviorSubject(100)); + using var progress = new BehaviorSubject(100); + var message = new FileStarting(Mock.Of(), progress); // ACT sut.OnNext(message); @@ -93,7 +94,7 @@ public void WhenTaskCompletes_TaskIsRemovedFromListOnGuiScheduler() var sut = new CurrentTasksViewModel(guiScheduler); sut.OnNextAll(CreateFixture().CreateMany(5)); - var progress = new BehaviorSubject(0); + using var progress = new BehaviorSubject(0); var completingTask = new FileStarting( Mock.Of(f => f.FullName == "Foo_Bar_Baz"), progress); @@ -116,7 +117,7 @@ public void WhenTaskCompletes_TaskIsRemovedFromListOnGuiScheduler() beforeSchedulerRun.SequenceEqual(initialTasks).Should().BeTrue(); afterSchedulerRun.Should().HaveCount(10); - afterSchedulerRun.SequenceEqual(initialTasks.Where(t => t != taskViewModel)).Should().BeTrue(); + afterSchedulerRun.SequenceEqual(initialTasks.Where(t => !object.ReferenceEquals(t, taskViewModel))).Should().BeTrue(); } private static IFixture CreateFixture() diff --git a/czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs b/czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs index 65b026b..d0f8e18 100644 --- a/czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs +++ b/czishrink/netczicompressTests/ViewModels/ErrorItemTests.cs @@ -21,10 +21,11 @@ public class ErrorItemTests [Fact] public void WritableProperties_AreInitOnly() { - foreach (var property in WritableProperties()) - { - var setMethod = property.SetMethod; + var writablePropertySetters = from p in WritableProperties() + select p.SetMethod; + foreach (var setMethod in writablePropertySetters) + { // Get the modifiers applied to the return parameter. var setMethodReturnParameterModifiers = setMethod!.ReturnParameter.GetRequiredCustomModifiers(); diff --git a/czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs index c445b88..7a7dbec 100644 --- a/czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs +++ b/czishrink/netczicompressTests/ViewModels/ErrorListViewModelTests.cs @@ -414,7 +414,8 @@ private static IEnumerable GetExpectedErrorItems(IEnumerable ObserveSelectedItemChanges(ErrorListViewModel sut) { var changes = sut.ObservableForProperty(vm => vm.SelectedErrorItem); - return from change in changes select (sut.Errors.ToArray(), sut.SelectedErrorItem); + + return from change in changes select (sut.Errors.ToArray(), change.Value); } private static string ToString(NotifyCollectionChangedEventArgs e) diff --git a/czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs b/czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs index 4c38da5..656c063 100644 --- a/czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs +++ b/czishrink/netczicompressTests/ViewModels/LogFileViewModelTests.cs @@ -85,7 +85,7 @@ void StoreDataPoint(string name) } // ACT - var subject = new Subject(); + using var subject = new Subject(); sut.ObserveRun(p, subject.AsObservable()); var messages = fixture.CreateMany(); subject.OnNextAll(messages); @@ -317,7 +317,7 @@ public void ShowLogFile_WhenOpeningTheLogFileFails_UpdatesCanExecute() var fixture = CreateFixture(); fixture.Inject(ImmediateScheduler.Instance); var loggingStrategyMock = fixture.Freeze>(); - var logFile = Mock.Of(x => x.Exists == true); + var logFile = Mock.Of(x => x.Exists); var sut = fixture.Create(); var p = fixture.Create(); diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs index 37d7763..ecbda7a 100644 --- a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.OverallStatus.cs @@ -8,7 +8,6 @@ namespace netczicompressTests.ViewModels; using System.IO.Abstractions.TestingHelpers; using System.Reactive; using System.Reactive.Threading.Tasks; -using System.Windows.Input; using AutoFixture; @@ -190,8 +189,6 @@ public async Task OverallStatus_WhenProcessing_HasExpectedValues() _ = fixture.Freeze>().WithWaitForCancellation(); var sut = fixture.Create(); - ICommand start = sut.StartCommand; - ICommand stop = sut.StopCommand; SetFolders(sut, fs); Dictionary overallStatusWhen = new(); diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs index f148c54..3ac05ff 100644 --- a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StartCommand.cs @@ -188,8 +188,8 @@ public async Task StartCommands_WhenProcessingStarts_UsesCorrectParameters(Opera It.Is( x => x.InputDir.FullName == sut.InputDirectory && x.OutputDir.FullName == sut.OutputDirectory && - x.InputDir.FileSystem == fs && - x.OutputDir.FileSystem == fs && + object.ReferenceEquals(x.InputDir.FileSystem, fs) && + object.ReferenceEquals(x.OutputDir.FileSystem, fs) && x.Recursive == recursive && x.Mode == selectedMode.Value), It.Is(t => !t.IsCancellationRequested)), diff --git a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs index 60860f9..de8be12 100644 --- a/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs +++ b/czishrink/netczicompressTests/ViewModels/MainViewModelTests.StopCommand.cs @@ -30,7 +30,6 @@ public async Task StopCommand_WhenProcessing_CanExecuteHasExpectedValues() _ = fixture.Freeze>().WithWaitForCancellation(); var sut = fixture.Create(); - ICommand start = sut.StartCommand; ICommand stop = sut.StopCommand; SetFolders(sut, fs); From 530c8fe36f5b788e2225903d00266b008840b963 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Thu, 9 Nov 2023 09:29:03 +0100 Subject: [PATCH 23/32] Add workflow_dispatch trigger to all workflows --- .github/workflows/mega-linter.yml | 1 + .github/workflows/reuse.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 9c21664..cc86c78 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -8,6 +8,7 @@ on: branches: ["main"] # run only when merge with main branch pull_request: branches: ["main"] # run only when merge with main branch + workflow_dispatch: {} concurrency: group: ${{ github.ref }}-${{ github.workflow }} diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index bf0ae35..7cc344e 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -6,6 +6,7 @@ on: branches: ["main"] pull_request: branches: ["main"] + workflow_dispatch: {} permissions: contents: read From be19476356a5bc1395cc57d7eaa90920be9bb843 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:31:10 +0100 Subject: [PATCH 24/32] Update czishrink/README.md Co-authored-by: Felix Scheffler --- czishrink/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czishrink/README.md b/czishrink/README.md index 87dfcf1..4217701 100644 --- a/czishrink/README.md +++ b/czishrink/README.md @@ -136,7 +136,7 @@ There is no guarantee that any items on this list will be added, rather it is ju 2. Open a Powershell terminal and run [./upgrade-libczicompressc.ps1](./upgrade-libczicompressc.ps1). Run `get-help ./upgrade-libczicompressc.ps1` for more info. ## How to upgrade libczicompressc manually -1. Build libczicompressc.so on linux-x64 and libczicompressc.dll on win-x64 in release mode, or (preferred) get them from the [github CI build](https://github.com/zeissmicroscopy/czicompress/actions/workflows/czicompress_cmake.yml). +1. Build libczicompressc.so on linux-x64 and libczicompressc.dll on win-x64 in release mode, or (preferred) get them from the [github CI build](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml). 1. Put the binaries into [libczicompressc/runtimes/linux-x64/native](libczicompressc/runtimes/linux-x64/native) and [libczicompressc/runtimes/win-x64/native](libczicompressc/runtimes/win-x64/native) 1. Update the nuspec file [libczicompressc/libczicompressc.nuspec](libczicompressc/libczicompressc.nuspec): * `package/metadata/version` must be the 'ProductVersion' of libczicompressc.dll (explorer: Properties/Details) From bcdf0ee11203015613799c111146ac863dad22fa Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:31:35 +0100 Subject: [PATCH 25/32] Update czicompress/README.md Co-authored-by: Felix Scheffler --- czicompress/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czicompress/README.md b/czicompress/README.md index 712816c..46df990 100644 --- a/czicompress/README.md +++ b/czicompress/README.md @@ -36,7 +36,7 @@ The tool is based on [libczi](https://github.com/ZEISS/libczi.git). - [Disclaimer](#disclaimer) ## Download -We have not yet published any Releases. Meanwhile, you can download binaries from the artifacts of the latest [Build workflow run](https://github.com/zeissmicroscopy/czicompress/actions/workflows/cmake.yml?query=branch%3Amain). +We have not yet published any Releases. Meanwhile, you can download binaries from the artifacts of the latest [Build workflow run](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml?query=branch%3Amain). Click on the topmost successful run and download the binaries for your platform: * czicompress-windows-64-release-msvc-package-off for Windows * czicompress-ubuntu-release-llvm-package-off for Linux From 72f8334523080acf79db02ba5654288e36d13c9e Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:54:36 +0100 Subject: [PATCH 26/32] Update czishrink/README.md Co-authored-by: Felix Scheffler --- czishrink/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czishrink/README.md b/czishrink/README.md index 4217701..c25d915 100644 --- a/czishrink/README.md +++ b/czishrink/README.md @@ -51,7 +51,7 @@ The intent of the tool is to be a bulk-compression utility. | Operation | Description | |-----------|-------------| | Compress uncompressed data |Compresses only uncompresed subblocks and copies others.| -| Compress uncompressed and Zstd-compressed data|Compresses subblocks that were orginally uncompressed or compressed with zstd. | +| Compress uncompressed and Zstd-compressed data|Compresses subblocks that were originally uncompressed or compressed with zstd. | | Compress all data |Compresses all subblocks regardless of current compression method (if possible). | | Decompress all data |Decompresses all possible subblocks. | | Dry Run |Finds all CZI files in the input folder but does not create any output CZI files. Like the other operations, it creates a CSV report in the output folder.| From deaf34582cc502818dd2c0ac4c9d97de229a1da2 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:55:20 +0100 Subject: [PATCH 27/32] Apply suggestions from code review Co-authored-by: Felix Scheffler --- czishrink/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/czishrink/README.md b/czishrink/README.md index c25d915..d913df3 100644 --- a/czishrink/README.md +++ b/czishrink/README.md @@ -50,7 +50,7 @@ The intent of the tool is to be a bulk-compression utility. | Operation | Description | |-----------|-------------| -| Compress uncompressed data |Compresses only uncompresed subblocks and copies others.| +| Compress uncompressed data |Compresses only uncompressed subblocks and copies others.| | Compress uncompressed and Zstd-compressed data|Compresses subblocks that were originally uncompressed or compressed with zstd. | | Compress all data |Compresses all subblocks regardless of current compression method (if possible). | | Decompress all data |Decompresses all possible subblocks. | From 7b37bb9250aac3f3544f1180ae8ae42bb927d861 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Thu, 9 Nov 2023 10:10:38 +0100 Subject: [PATCH 28/32] One .gitignore and one .gitattributes --- czishrink/.gitattributes => .gitattributes | 2 + czishrink/.gitignore => .gitignore | 147 +++++++++------------ czishrink/.images/.gitattributes | 2 - 3 files changed, 64 insertions(+), 87 deletions(-) rename czishrink/.gitattributes => .gitattributes (50%) rename czishrink/.gitignore => .gitignore (83%) delete mode 100644 czishrink/.images/.gitattributes diff --git a/czishrink/.gitattributes b/.gitattributes similarity index 50% rename from czishrink/.gitattributes rename to .gitattributes index 9f77107..8caee0f 100644 --- a/czishrink/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ +*.gif filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text *.nupkg filter=lfs diff=lfs merge=lfs -text *.pdf filter=lfs diff=lfs merge=lfs -text diff --git a/czishrink/.gitignore b/.gitignore similarity index 83% rename from czishrink/.gitignore rename to .gitignore index 5777b2a..ef0b4bf 100644 --- a/czishrink/.gitignore +++ b/.gitignore @@ -1,7 +1,39 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +out/ +build/ + +megalinter-reports/ + +#################################### +### BEGIN VisualStudio.gitignore ### +#################################### ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore # User-specific files *.rsuser @@ -43,7 +75,6 @@ Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -coverage/ # NUnit *.VisualState.xml @@ -63,9 +94,6 @@ project.lock.json project.fragment.lock.json artifacts/ -# Tye -.tye/ - # ASP.NET Scaffolding ScaffoldingReadMe.txt @@ -94,6 +122,7 @@ StyleCopReport.xml *.tmp_proj *_wpftmp.csproj *.log +*.tlog *.vspscc *.vssscc .builds @@ -196,9 +225,7 @@ publish/ PublishScripts/ # NuGet Packages -# *.nupkg -!packages_local/libczicompress.*.*.*.nupkg - +*.nupkg # NuGet Symbol Packages *.snupkg # The packages folder can be ignored because of Package Restore @@ -299,6 +326,17 @@ node_modules/ # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -355,6 +393,9 @@ ASALocalRun/ # Local History for Visual Studio .localhistory/ +# Visual Studio History (VSHistory) files +.vshistory/ + # BeatPulse healthcheck temp database healthchecksdb @@ -367,91 +408,27 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd -## -## Visual studio for Mac -## - - -# globs -Makefile.in -*.userprefs -*.usertasks -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.tar.gz -tarballs/ -test-results/ - -# Mac bundle stuff -*.dmg -*.app - -# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace -# Recycle Bin used on file shares -$RECYCLE.BIN/ +# Local History for Visual Studio Code +.history/ -# Windows Installer files +# Windows Installer files from build outputs *.cab *.msi *.msix *.msm *.msp -# Windows shortcuts -*.lnk - # JetBrains Rider -.idea/ *.sln.iml -## -## Visual Studio Code -## -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json +################################## +### END VisualStudio.gitignore ### +################################## \ No newline at end of file diff --git a/czishrink/.images/.gitattributes b/czishrink/.images/.gitattributes deleted file mode 100644 index 5f9b1ec..0000000 --- a/czishrink/.images/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.gif filter=lfs diff=lfs merge=lfs -text -*.png filter=lfs diff=lfs merge=lfs -text From 42a03d1e1b09b978ed38bc6713bcabec12f46fca Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Thu, 9 Nov 2023 10:48:57 +0100 Subject: [PATCH 29/32] Get rid of custom xpath action --- .github/workflows/czishrink_dotnet.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index 98b790d..67f43d7 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -49,12 +49,13 @@ jobs: - name: Get Version from Directory.Build.props id: getversion - uses: m-ringler/get-xpath@v3 - with: - xml-file: czishrink/Directory.Build.props - xpath: 'concat(//VersionPrefix/text(), "-", //VersionSuffix/text())' + run: | + $xml = [xml](Get-Content -Path "Directory.Build.props") + $version = $xml.SelectSingleNode('//VersionPrefix').'#text' + "-" + $xml.SelectSingleNode('//VersionSuffix').'#text' + "version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + shell: pwsh - - name: Add build ID to version + - name: Add build ID to version in Directory.Build.props run: | Write-Output "Add build ID ${{ github.run_id }} to VersionSuffix in Directory.Build.props" $file = Get-Item "Directory.Build.props" @@ -130,5 +131,5 @@ jobs: uses: actions/upload-artifact@v3 if: github.event_name == 'push' with: - name: CziShrink_${{ steps.getversion.outputs.info }}_${{ matrix.config.osfamily}}-x64 + name: CziShrink_${{ steps.getversion.outputs.version }}_${{ matrix.config.osfamily}}-x64 path: publish From 87143a013d1434358ad5b6ce0114585d252ce035 Mon Sep 17 00:00:00 2001 From: "Ringler, Moritz" Date: Thu, 9 Nov 2023 11:18:22 +0100 Subject: [PATCH 30/32] Fix REUSE --- .github/workflows/czicompress_codeql.yml | 1 + .reuse/dep5 | 4 +-- czicompress/.gitignore | 38 ------------------------ 3 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 czicompress/.gitignore diff --git a/.github/workflows/czicompress_codeql.yml b/.github/workflows/czicompress_codeql.yml index 8b07149..00bfad7 100644 --- a/.github/workflows/czicompress_codeql.yml +++ b/.github/workflows/czicompress_codeql.yml @@ -8,6 +8,7 @@ on: branches: ["main"] schedule: - cron: "22 16 * * 4" + workflow_dispatch: {} permissions: actions: read diff --git a/.reuse/dep5 b/.reuse/dep5 index 8da6156..793be8c 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -7,11 +7,11 @@ Files: cla_*.txt czicompress/CMakeSettings.json CODE_OF_CONDUCT.md CONTRIBUTING. Copyright: 2023 Carl Zeiss Microscopy GmbH License: MIT -Files: .github/* .gitignore czicompress/.editorconfig czicompress/.gitignore czicompress/.runsettings czicompress/CPPLINT.cfg czicompress/.clang-format +Files: .github/* .gitignore .gitattributes czicompress/.editorconfig czicompress/.runsettings czicompress/CPPLINT.cfg czicompress/.clang-format Copyright: 2023 Carl Zeiss Microscopy GmbH License: CC0-1.0 -Files: czishrink/*.axaml czishrink/.gitignore czishrink/*/.gitignore czishrink/*.json czishrink/*.nuspec czishrink/*.txt czishrink/*.ico czishrink/*.png czishrink/*.props czishrink/*.targets czishrink/*.sh czishrink/*.svg czishrink/*.csproj czishrink/*.gitattributes czishrink/*.nupkg czishrink/*.md czishrink/*.pdf czishrink/*.config czishrink/*.ruleset czishrink/*.ps1 czishrink/*.czi czishrink/*.xml czishrink/*.sln czishrink/*.manifest README.md +Files: czishrink/*.axaml czishrink/*.json czishrink/*.nuspec czishrink/*.txt czishrink/*.ico czishrink/*.png czishrink/*.props czishrink/*.targets czishrink/*.sh czishrink/*.svg czishrink/*.csproj czishrink/*.gitattributes czishrink/*.nupkg czishrink/*.md czishrink/*.pdf czishrink/*.config czishrink/*.ruleset czishrink/*.ps1 czishrink/*.czi czishrink/*.xml czishrink/*.sln czishrink/*.manifest README.md Copyright: 2023 Carl Zeiss Microscopy GmbH License: GPL-3.0-or-later diff --git a/czicompress/.gitignore b/czicompress/.gitignore deleted file mode 100644 index 930b51f..0000000 --- a/czicompress/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -.vs/ -out/ -build/ - -megalinter-reports/ From 6c7dc76095a9238621e1daed3870414e36034b57 Mon Sep 17 00:00:00 2001 From: DaveyJonesBitPail <119518234+DaveyJonesBitPail@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:39:21 +0100 Subject: [PATCH 31/32] Added czishrink specific artifact distributions --- ...D_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt | 1900 +++++------------ 1 file changed, 586 insertions(+), 1314 deletions(-) diff --git a/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt b/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt index 6686074..dd10674 100644 --- a/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt +++ b/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt @@ -1,6 +1,6 @@ ============= Free and Open Source Software Disclosure Statement ============== -For czicompress +For czishrink This product includes copyrighted software from third parties that may be distributed under different licenses than this product as given below. @@ -29,1496 +29,768 @@ List of third-party software: =============================================================================== ------------------------------------------------------------------------------- -| Catch2 3.4.0 (used under Boost Software License 1.0) https://discord.gg/4CWS9zD -------------------------------------------------------------------------------- - ---- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -Boost Software License - Version 1.0 -==================================== - - -August 17th, 2003 ------------------ - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by this -license (the "Software") to use, reproduce, display, distribute, execute, and -transmit the Software, and to prepare derivative works of the Software, and to -permit third-parties to whom the Software is furnished to do so, all subject to -the following: -The copyright notices in the Software and this entire statement, including the -above license grant, this restriction and the following disclaimer, must be -included in all copies of the Software, in whole or in part, and all derivative -works of the Software, unless such copies or derivative works are solely in the -form of machine-executable object code generated by a source language processor. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE -COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES -OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -------------------------------------------------------------------------------- -| CLIUtils/CLI11 v2.3.2 (used under BSD 3-clause "New" or "Revised" License) https://cliutils.gitlab.io/CLI11Tutorial +| Avalonia (used under MIT License) https://github.com/AvaloniaUI/Avalonia ------------------------------------------------------------------------------- --- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- -Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner under NSF AWARD 1414736. All Rights Reserved. -Copyright (c) 2012 - 2017, Lars Bilke. All Rights Reserved. -Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner. +Copyright (c) .NET Foundation and Contributors All Rights Reserved --- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -Copyright (c) , -All rights reserved. +The MIT License (MIT) -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +Copyright (c) .NET Foundation and Contributors All Rights Reserved - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of the nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -| D3.js 3.5.17 (used under BSD 3-clause "New" or "Revised" License) http://d3js.org/ +| Splat (used under MIT License) https://github.com/reactiveui/splat ------------------------------------------------------------------------------- --- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- -Copyright (c) 2010 Stanford Visualization Group. All Rights Reserved. -Copyright (c) 2011 Jason Davies. All Rights Reserved. -Copyright 2001 Robert Penner. All Rights Reserved. -Copyright (c) 2008-2012 Charles Karney. -Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State. -Copyright (c) 2010 SimpleGeo and Stamen Design. All Rights Reserved. -Copyright (c) 2010-2016 Michael Bostock. All Rights Reserved. -Copyright (C) 2010-2013 Raymond Hill. +Copyright (c) .NET Foundation and Contributors --- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -Copyright (c) 2010, Stanford Visualization Group -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Stanford University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE +The MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -| gmdh 1.0 (used under MIT License) https://github.com/bauman-team/GMDH +| System.IO.Abstractions (used under MIT License) https://github.com/TestableIO/System.IO.Abstractions ------------------------------------------------------------------------------- --- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- -Copyright 2001-2009 Kitware, Inc. -Copyright (C) 2018 David Hyde. -Copyright (C) 2009 Benjamin Schindler. -Copyright 2012 Continuum Analytics, Inc. All Rights Reserved. -Copyright (C) 2002-2007 Yves Renard This file is a part of GETFEM++. -Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). -Copyright (C) 2011 Timothy E. Holy. -Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. -Copyright (C) 2020 Jens Wehner. -Copyright 2017 The TensorFlow Authors. All Rights Reserved. -Copyright 2013-2016 Florent Pruvost. -Copyright (C) EDF R. -Copyright (C) 2012 Desire Nuentsa Wakam. -Copyright (C) 2009-2013 Jitse Niesen. -Copyright (C) 2009 Ilya Baran. -(C) William Swanson, Paul Fultz define PYBIND11_EVAL0(...) __VA_ARGS__ define PYBIND11_EVAL1(...) PYBIND11_EVAL0(PYBIND11_EVAL0(PYBIND11_EVAL0(__VA_ARGS__))) define PYBIND11_EVAL2( -Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. -Copyright (C) 2013 Pavel Holoborodko. -Copyright (c) 2016-2017, 2020 Wenzel Jakob. All Rights Reserved. -Copyright : EDF 2001 $Header$. -Copyright (C) 2014 yoco. -Copyright (C) 2013 Jean Ceccato. -Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. -Copyright (C) 2011-2013 Chen-Pang He. -Copyright (C) 2006-2011, 2015 Benoit Jacob. -copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. -Copyright (c) 2019 Dawid Pilarski. -Copyright (C) 2013 Pierre Zoppitelli. -Copyright (C) 2020 Everton Constantino. -Copyright (C) 2019 David Tellenbach. -(C) Desire NUENTSA WAKAM, INRIA include include include include include include include -Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. -Copyright (c) 2016 Sergey Lyskov and Wenzel Jakob. -(C) Desire NUENTSA WAKAM, INRIA include include include include include include ifd -Copyright (c) Fabian Giesen, 2016. All Rights Reserved. -Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. -Copyright (C) 2012 Alexey Korepanov. -Copyright (C) 1998-2010, 2015-2016. -Copyright (c) 2020 Wenzel Jakob and Henry Schreiner. -Copyright (C) 2015-2016 Eugene Brevdo. -Copyright (C) 2011 Andreas Platen. -Copyright (C) 2017 Viktor Csomor. -Copyright (C) 2020 Antonio Sanchez. -Copyright (c) 2017 Henry F. Schreiner. -Copyright (C) 2017 Kyle Macfarlan. -Copyright (C) 2012-2013 D. -Copyright (C) 2009 Thomas Capricelli This code initially comes from MINPACK whose original authors are:. -Copyright (C) 2008 Daniel Gomez Ferro. -Copyright (C) 2013 Nicolas Carre. -Copyright (C) 2012 David Harmon. -Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. -Copyright (c) 2021 Laramie Leavitt (Google LLC). -Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). -Copyright (c) 2019 Roland Dreier. -copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. -Copyright (C) 2016 Dmitry Vyukov. -Copyright (c) 2007 Allen Winter. -Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. -Copyright (c) 2006-2007 Montel Laurent. -Copyright (C) 2009 Mark Borgerding mark a borgerding net. -Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). -Copyright (C) 2009 Ricard Marxer. -Copyright (c) 2016 Sergey Lyskov. -Copyright 2003-2009 Mark Borgerding template struct kiss_cpx_fft. -Copyright 2012-2013 Mathieu Faverge. -Copyright (C) 2016 Igor Babuschkin. -Copyright (C) 2009 Kenneth Riddile. -Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. -Copyright (C) 2005 the Regents of the University of Minnesota. -Copyright (c) 2007 Alexander Neundorf. -Copyright 2018-2019, 2022 Google LLC. All Rights Reserved. -Copyright (C) 2019 Joel Holdsworth. -Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. -Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. Permition is granted to use, copy, distribute and prepare derivative works of this library for any purpose and without fee, provided, that the above. -Copyright (C) 2020 Jan van Dijk. -Copyright (C) 2009 Rohit Garg. -Copyright (c) 2017 Borja Zarco (Google LLC). -Copyright (C) 2009-2010 Thomas Capricelli. -Copyright (C) 2020 Arm Limited and Contributors. -Copyright (C) 2015 Vijay Vasudevan. -Copyright (C) 2009 Claire Maurice. -Copyright (C) 2017 Codeplay Software Limited. -Copyright (C) 2014-2015 Jianwei Cui. -Copyright (C) 2009-2013 Hauke Heibel. -Copyright (C) 2010 Vincent Lejeune. -Copyright (C) 2008-2009 Guillaume Saupin. -Copyright (C) 2020 Sebastien Boisvert. -Copyright (C) 2009 Mathieu Gautier. -Copyright (C) 2013 Christoph Hertzberg. -Copyright (C) 2008 Gael Guennebaud NOTE The functions of this file have been adapted from the GMM++ library. -Copyright (C) 2012-2013 Desire Nuentsa. -Copyright (C) 2017 Gagan Goel. -Copyright (C) 2014-2017 Benoit Steiner. -Copyright (C) 2020-2021 C. Antonio Sanchez. -Copyright (c) 2018 Hudson River Trading LLC. -Copyright (C) 2014-2015 Navdeep Jaitly. -Copyright (C) 2009 Thomas Capricelli include. -Copyright (c) 2016-2017 Jason Rhinelander. -Copyright (c) 2016 Pim Schellart. -Copyright (C) 2012 The Android Open Source Project. -Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. -Copyright (c) 2016 Ivan Smirnov. -Copyright (C) 2007 Michael Olbrich. -Copyright (c) 2020 The Eigen Authors. -Copyright (c) 2009 Boudewijn Rempt. -Copyright (C) 2012 desire Nuentsa. -(C) Copyright .. -Copyright 2012 Cedric Castagnede. -Copyright (C) 2012 Desire Nuentsa This code initially comes from MINPACK whose original authors are:. -Copyright (C) 2008-2019 Gael Guennebaud. -Copyright (C) 2012 Giacomo Po. -Copyright (c) 2016 Ben North. -copyright: (c) 2013 by Ihor Kalnytskyi -Copyright (C) 2018 Andy Davis. -Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = Moshier Permission has been kindly provided by the original author to incorporate the Cephes software into the Eigen codebase: Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140. -Copyright 2012-2016 Inria. All Rights Reserved. -Copyright (C) 2008-2009 Gael Guennebaud NOTE The class IterationController has been adapted from the iteration. -Copyright (C) 2013 Christian Seiler. -Copyright (C) 2009, 2012 Keir Mierle. -Copyright (c) 2016 Klemens D. Morgenstern. -Copyright (c) 2010 Intel Corp. All Rights Reserved. -Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditio. -Copyright (C) 2008-2016 Konstantinos Margaritis. -Copyright (c) 2006 Timothy A. Davis. -Copyright (c) 2011-2014 Willow Garage, Inc. -Copyright (C) 2016 Tobias Wood. -Copyright (C) 2011-2012, 2014 Kolja Brix. -Copyright (C) 2010 Manuel Yguel. -Copyright (C) 2015 Tal Hadad. -Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee This file is part of the Iterative Template Library. -Copyright (C) 2015 Ke Yang. -Copyright 2005-2010, 2013, 2015, 2018-2021 Google Inc. All Rights Reserved. -Copyright (C) 2018 Eugene Zhulenev. -Copyright (C) 2007 Julien Pommier. -Copyright (C) 2018 Wave Computing, Inc. Written by:. -Copyright 2016-2018 Codeplay Software Ltd. -Copyright (C) 2012 Desire Nuentsa The algorithm of this. -Copyright (c) 2016 Klemens Morgenstern and. -Copyright (C) 2012 Desire NUENTSA WAKAM. -Copyright (c) 2012 Erik Edlund Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a. -Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). -Copyright (C) 2018 Deven Desai. -Copyright (C) 2020 Chris Schoutrop. -Copyright (C) 2010 Daniel Lowengrub. -Copyright 2012-2013 Emmanuel Agullo. -Copyright (C) 2014 Eric Martin. -Copyright (c) 2016 Trent Houliston and. -Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). -Copyright (c) 2019 Pranav. -Copyright (C) 2013 Gauthier Brun. -Copyright (c) 2021 The Pybind Development Team. +Copyright (c) Tatham Oddie and Contributors --- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -The MIT License -=============== - -Copyright (c) +The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -| libeigen/eigen 3.4.0 (used under (GNU Lesser General Public License v2.1 or later AND BSD 3-clause "New" or "Revised" License AND Mozilla Public License 2.0)) https://gitlab.com/libeigen/eigen.git +| MicroCom (used under MIT License) https://github.com/kekekeks/MicroCom ------------------------------------------------------------------------------- --- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- -Copyright (C) 2018 David Hyde. -Copyright (C) 2009 Benjamin Schindler. -Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). -Copyright (C) 2011 Timothy E. Holy. -Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. -Copyright (C) 2020 Jens Wehner. -Copyright 2017 The TensorFlow Authors. All Rights Reserved. -Copyright 2013-2016 Florent Pruvost. -Copyright (C) EDF R. -Copyright (C) 2012 Desire Nuentsa Wakam. -Copyright (C) 2009-2013 Jitse Niesen. -Copyright (C) 2009 Ilya Baran. -Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. -Copyright (C) 2013 Pavel Holoborodko. -Copyright : EDF 2001 $Header$. -Copyright (C) 2014 yoco. -Copyright (C) 2013 Jean Ceccato. -Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. -Copyright (C) 2011-2013 Chen-Pang He. -Copyright (C) 2006-2011, 2015 Benoit Jacob. -copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. -Copyright (C) 2013 Pierre Zoppitelli. -Copyright (C) 2020 Everton Constantino. -Copyright (C) 2019 David Tellenbach. -Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. -Copyright (c) Fabian Giesen, 2016. All Rights Reserved. -Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. -Copyright (C) 2012 Alexey Korepanov. -Copyright (C) 1998-2010, 2015-2016. -Copyright (C) 2015-2016 Eugene Brevdo. -Copyright (C) 2011 Andreas Platen. -Copyright (C) 2017 Viktor Csomor. -Copyright (C) 2020 Antonio Sanchez. -Copyright 2003-2009 Mark Borgerding. -Copyright (C) 2017 Kyle Macfarlan. -Copyright (C) 2012-2013 D. -Copyright (C) 2008 Daniel Gomez Ferro. -Copyright (C) 2013 Nicolas Carre. -Copyright (C) 2012 David Harmon. -Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. -Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). -Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions. -copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. -Copyright (C) 2016 Dmitry Vyukov. -Copyright (c) 2007 Allen Winter. -Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. -Copyright (c) 2006-2007 Montel Laurent. -Copyright (C) 2009 Mark Borgerding mark a borgerding net. -Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). -Copyright (C) 2009 Ricard Marxer. -Copyright 2012-2013 Mathieu Faverge. -Copyright (C) 2016 Igor Babuschkin. -Copyright (C) 2009 Kenneth Riddile. -Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. -Copyright (C) 2005 the Regents of the University of Minnesota. -Copyright (c) 2007 Alexander Neundorf. -Copyright (C) 2019 Joel Holdsworth. -Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. -Copyright (C) 2002-2007 Yves Renard. -Copyright (C) 2020 Jan van Dijk. -Copyright (C) 2008-2019, 20013, 20015 Gael Guennebaud. -Copyright (C) 2009 Rohit Garg. -Copyright (C) 2009-2010 Thomas Capricelli. -Copyright (C) 2020 Arm Limited and Contributors. -Copyright (C) 2015 Vijay Vasudevan. -Copyright (C) 2009 Claire Maurice. -Copyright (C) 2017 Codeplay Software Limited. -Copyright (C) 2014-2015 Jianwei Cui. -Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = NumTr Moshier. -Copyright (C) 2009-2013 Hauke Heibel. -Copyright (C) 2010 Vincent Lejeune. -Copyright (C) 2008-2009 Guillaume Saupin. -Copyright (C) 2020 Sebastien Boisvert. -Copyright (C) 2009 Mathieu Gautier. -Copyright (C) 2013 Christoph Hertzberg. -Copyright (C) 2012-2013 Desire Nuentsa. -Copyright (C) 2017 Gagan Goel. -Copyright (C) 2014-2017 Benoit Steiner. -Copyright (C) 2020-2021 C. Antonio Sanchez. -Copyright (C) 2014-2015 Navdeep Jaitly. -Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee. -Copyright (C) 2012 The Android Open Source Project. -Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. -Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. -Copyright (C) 2007 Michael Olbrich. -Copyright (c) 2020 The Eigen Authors. -Copyright (c) 2009 Boudewijn Rempt. -Copyright (C) 2012 desire Nuentsa. -Copyright 2012 Cedric Castagnede. -Copyright (C) 2012 Giacomo Po. -Copyright (C) 2018 Andy Davis. -Copyright 2012-2016 Inria. All Rights Reserved. -Copyright (C) 2013 Christian Seiler. -Copyright (C) 2009, 2012 Keir Mierle. -Copyright 2007-2009 Kitware, Inc. -Copyright (C) 2008-2016 Konstantinos Margaritis. -Copyright (c) 2006 Timothy A. Davis. -Copyright (c) 2011-2014 Willow Garage, Inc. -Copyright (C) 2016 Tobias Wood. -Copyright (C) 2011-2012, 2014 Kolja Brix. -Copyright (C) 2010 Manuel Yguel. -Copyright (C) 2015 Tal Hadad. -Copyright (C) 2015 Ke Yang. -Copyright (C) 2018 Eugene Zhulenev. -Copyright (C) 2007 Julien Pommier. -Copyright (C) 2018 Wave Computing, Inc. Written by:. -Copyright 2016-2018 Codeplay Software Ltd. -Copyright (C) 2012 Desire NUENTSA WAKAM. -Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). -Copyright (C) 2018 Deven Desai. -Copyright (C) 2020 Chris Schoutrop. -(C) Desire NUENTSA WAKAM, INRIA -Copyright (C) 2010 Daniel Lowengrub. -Copyright 2012-2013 Emmanuel Agullo. -Copyright (C) 2014 Eric Martin. -Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). -Copyright (C) 2013 Gauthier Brun. +Copyright (c) 2021 Nikita Tsukanov --- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -GNU Lesser General Public License -================================= - -Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Everyone is permitted to copy and distribute verbatim copies - - of this license document, but changing it is not allowed. - - [This is the first released version of the Lesser GPL. It also counts - - as the successor of the GNU Library Public License, version 2, hence - - the version number 2.1.] - - -Preamble --------- - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public Licenses are intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. - -This license, the Lesser General Public License, applies to some specially -designated software packages--typically libraries--of the Free Software -Foundation and other authors who decide to use it. You can use it too, but we -suggest you first think carefully about whether this license or the ordinary -General Public License is the better strategy to use in any particular case, -based on the explanations below. - -When we speak of free software, we are referring to freedom of use, not price. -Our General Public Licenses are designed to make sure that you have the freedom -to distribute copies of free software (and charge for this service if you wish); -that you receive source code or can get it if you want it; that you can change -the software and use pieces of it in new free programs; and that you are informed -that you can do these things. - -To protect your rights, we need to make restrictions that forbid distributors to -deny you these rights or to ask you to surrender these rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the -library or if you modify it. - -For example, if you distribute copies of the library, whether gratis or for a -fee, you must give the recipients all the rights that we gave you. You must make -sure that they, too, receive or can get the source code. If you link other code -with the library, you must provide complete object files to the recipients, so -that they can relink them with the library after making changes to the library -and recompiling it. And you must show them these terms so they know their rights. - -We protect your rights with a two-step method: (1) we copyright the library, and -(2) we offer you this license, which gives you legal permission to copy, -distribute and/or modify the library. - -To protect each distributor, we want to make it very clear that there is no -warranty for the free library. Also, if the library is modified by someone else -and passed on, the recipients should know that what they have is not the original -version, so that the original author's reputation will not be affected by -problems that might be introduced by others. - -Finally, software patents pose a constant threat to the existence of any free -program. We wish to make sure that a company cannot effectively restrict the -users of a free program by obtaining a restrictive license from a patent holder. -Therefore, we insist that any patent license obtained for a version of the -library must be consistent with the full freedom of use specified in this -license. - -Most GNU software, including some libraries, is covered by the ordinary GNU -General Public License. This license, the GNU Lesser General Public License, -applies to certain designated libraries, and is quite different from the ordinary -General Public License. We use this license for certain libraries in order to -permit linking those libraries into non-free programs. - -When a program is linked with a library, whether statically or using a shared -library, the combination of the two is legally speaking a combined work, a -derivative of the original library. The ordinary General Public License therefore -permits such linking only if the entire combination fits its criteria of freedom. -The Lesser General Public License permits more lax criteria for linking other -code with the library. - -We call this license the "Lesser" General Public License because it does Less to -protect the user's freedom than the ordinary General Public License. It also -provides other free software developers Less of an advantage over competing -non-free programs. These disadvantages are the reason we use the ordinary General -Public License for many libraries. However, the Lesser license provides -advantages in certain special circumstances. - -For example, on rare occasions, there may be a special need to encourage the -widest possible use of a certain library, so that it becomes a de-facto standard. -To achieve this, non-free programs must be allowed to use the library. A more -frequent case is that a free library does the same job as widely used non-free -libraries. In this case, there is little to gain by limiting the free library to -free software only, so we use the Lesser General Public License. - -In other cases, permission to use a particular library in non-free programs -enables a greater number of people to use a large body of free software. For -example, permission to use the GNU C Library in non-free programs enables many -more people to use the whole GNU operating system, as well as its variant, the -GNU/Linux operating system. - -Although the Lesser General Public License is Less protective of the users' -freedom, it does ensure that the user of a program that is linked with the -Library has the freedom and the wherewithal to run that program using a modified -version of the Library. - -The precise terms and conditions for copying, distribution and modification -follow. Pay close attention to the difference between a "work based on the -library" and a "work that uses the library". The former contains code derived -from the library, whereas the latter must be combined with the library in order -to run. - - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ---------------------------------------------------------------- - -0. This License Agreement applies to any software library or other program which -contains a notice placed by the copyright holder or other authorized party saying -it may be distributed under the terms of this Lesser General Public License (also -called "this License"). Each licensee is addressed as "you". - -A "library" means a collection of software functions and/or data prepared so as -to be conveniently linked with application programs (which use some of those -functions and data) to form executables. - -The "Library", below, refers to any such software library or work which has been -distributed under these terms. A "work based on the Library" means either the -Library or any derivative work under copyright law: that is to say, a work -containing the Library or a portion of it, either verbatim or with modifications -and/or translated straightforwardly into another language. (Hereinafter, -translation is included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for making -modifications to it. For a library, complete source code means all the source -code for all modules it contains, plus any associated interface definition files, -plus the scripts used to control compilation and installation of the library. - -Activities other than copying, distribution and modification are not covered by -this License; they are outside its scope. The act of running a program using the -Library is not restricted, and output from such a program is covered only if its -contents constitute a work based on the Library (independent of the use of the -Library in a tool for writing it). Whether that is true depends on what the -Library does and what the program that uses the Library does. - -1. You may copy and distribute verbatim copies of the Library's complete source -code as you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and disclaimer -of warranty; keep intact all the notices that refer to this License and to the -absence of any warranty; and distribute a copy of this License along with the -Library. - -You may charge a fee for the physical act of transferring a copy, and you may at -your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Library or any portion of it, thus -forming a work based on the Library, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all of -these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices stating - that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no charge to all - third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a table of - data to be supplied by an application program that uses the facility, other - than as an argument passed when the facility is invoked, then you must make - a good faith effort to ensure that, in the event an application does not - supply such function or table, the facility still operates, and performs - whatever part of its purpose remains meaningful. - - (For example, a function in a library to compute square roots has a purpose - that is entirely well-defined independent of the application. Therefore, - Subsection 2d requires that any application-supplied function or table used - by this function must be optional: if the application does not supply it, - the square root function must still compute square roots.) - - These requirements apply to the modified work as a whole. If identifiable - sections of that work are not derived from the Library, and can be - reasonably considered independent and separate works in themselves, then - this License, and its terms, do not apply to those sections when you - distribute them as separate works. But when you distribute the same - sections as part of a whole which is a work based on the Library, the - distribution of the whole must be on the terms of this License, whose - permissions for other licensees extend to the entire whole, and thus to - each and every part regardless of who wrote it. - - Thus, it is not the intent of this section to claim rights or contest your - rights to work written entirely by you; rather, the intent is to exercise - the right to control the distribution of derivative or collective works - based on the Library. - - In addition, mere aggregation of another work not based on the Library with - the Library (or with a work based on the Library) on a volume of a storage - or distribution medium does not bring the other work under the scope of - this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License -instead of this License to a given copy of the Library. To do this, you must -alter all the notices that refer to this License, so that they refer to the -ordinary GNU General Public License, version 2, instead of to this License. (If a -newer version than version 2 of the ordinary GNU General Public License has -appeared, then you can specify that version instead if you wish.) Do not make any -other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so -the ordinary GNU General Public License applies to all subsequent copies and -derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into -a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, -under Section 2) in object code or executable form under the terms of Sections 1 -and 2 above provided that you accompany it with the complete corresponding -machine-readable source code, which must be distributed under the terms of -Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a -designated place, then offering equivalent access to copy the source code from -the same place satisfies the requirement to distribute the source code, even -though third parties are not compelled to copy the source along with the object -code. - -5. A program that contains no derivative of any portion of the Library, but is -designed to work with the Library by being compiled or linked with it, is called -a "work that uses the Library". Such a work, in isolation, is not a derivative -work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an -executable that is a derivative of the Library (because it contains portions of -the Library), rather than a "work that uses the library". The executable is -therefore covered by this License. Section 6 states terms for distribution of -such executables. - -When a "work that uses the Library" uses material from a header file that is part -of the Library, the object code for the work may be a derivative work of the -Library even though the source code is not. Whether this is true is especially -significant if the work can be linked without the Library, or if the work is -itself a library. The threshold for this to be true is not precisely defined by -law. - -If such an object file uses only numerical parameters, data structure layouts and -accessors, and small macros and small inline functions (ten lines or less in -length), then the use of the object file is unrestricted, regardless of whether -it is legally a derivative work. (Executables containing this object code plus -portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the -object code for the work under the terms of Section 6. Any executables containing -that work also fall under Section 6, whether or not they are linked directly with -the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work -that uses the Library" with the Library to produce a work containing portions of -the Library, and distribute that work under terms of your choice, provided that -the terms permit modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is -used in it and that the Library and its use are covered by this License. You must -supply a copy of this License. If the work during execution displays copyright -notices, you must include the copyright notice for the Library among them, as -well as a reference directing the user to the copy of this License. Also, you -must do one of these things: - - a) Accompany the work with the complete corresponding machine-readable - source code for the Library including whatever changes were used in the - work (which must be distributed under Sections 1 and 2 above); and, if the - work is an executable linked with the Library, with the complete - machine-readable "work that uses the Library", as object code and/or source - code, so that the user can modify the Library and then relink to produce a - modified executable containing the modified Library. (It is understood that - the user who changes the contents of definitions files in the Library will - not necessarily be able to recompile the application to use the modified - definitions.) - - b) Use a suitable shared library mechanism for linking with the Library. A - suitable mechanism is one that (1) uses at run time a copy of the library - already present on the user's computer system, rather than copying library - functions into the executable, and (2) will operate properly with a - modified version of the library, if the user installs one, as long as the - modified version is interface-compatible with the version that the work was - made with. - - c) Accompany the work with a written offer, valid for at least three years, - to give the same user the materials specified in Subsection 6a, above, for - a charge no more than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy from a - designated place, offer equivalent access to copy the above specified - materials from the same place. - - e) Verify that the user has already received a copy of these materials or - that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the Library" must -include any data and utility programs needed for reproducing the executable from -it. However, as a special exception, the materials to be distributed need not -include anything that is normally distributed (in either source or binary form) -with the major components (compiler, kernel, and so on) of the operating system -on which the executable runs, unless that component itself accompanies the -executable. - -It may happen that this requirement contradicts the license restrictions of other -proprietary libraries that do not normally accompany the operating system. Such a -contradiction means you cannot use both them and the Library together in an -executable that you distribute. - -7. You may place library facilities that are a work based on the Library -side-by-side in a single library together with other library facilities not -covered by this License, and distribute such a combined library, provided that -the separate distribution of the work based on the Library and of the other -library facilities is otherwise permitted, and provided that you do these two -things: - - a) Accompany the combined library with a copy of the same work based on the - Library, uncombined with any other library facilities. This must be - distributed under the terms of the Sections above. - - b) Give prominent notice with the combined library of the fact that part of - it is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - -8. You may not copy, modify, sublicense, link with, or distribute the Library -except as expressly provided under this License. Any attempt otherwise to copy, -modify, sublicense, link with, or distribute the Library is void, and will -automatically terminate your rights under this License. However, parties who have -received copies, or rights, from you under this License will not have their -licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. -However, nothing else grants you permission to modify or distribute the Library -or its derivative works. These actions are prohibited by law if you do not accept -this License. Therefore, by modifying or distributing the Library (or any work -based on the Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying the Library -or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), -the recipient automatically receives a license from the original licensor to -copy, distribute, link with or modify the Library subject to these terms and -conditions. You may not impose any further restrictions on the recipients' -exercise of the rights granted herein. You are not responsible for enforcing -compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement -or for any other reason (not limited to patent issues), conditions are imposed on -you (whether by court order, agreement or otherwise) that contradict the -conditions of this License, they do not excuse you from the conditions of this -License. If you cannot distribute so as to satisfy simultaneously your -obligations under this License and any other pertinent obligations, then as a -consequence you may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by all those -who receive copies directly or indirectly through you, then the only way you -could satisfy both it and this License would be to refrain entirely from -distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, and the -section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or -other property right claims or to contest validity of any such claims; this -section has the sole purpose of protecting the integrity of the free software -distribution system which is implemented by public license practices. Many people -have made generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that system; it is -up to the author/donor to decide if he or she is willing to distribute software -through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain -countries either by patents or by copyrighted interfaces, the original copyright -holder who places the Library under this License may add an explicit geographical -distribution limitation excluding those countries, so that distribution is -permitted only in or among countries not thus excluded. In such case, this -License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the -Lesser General Public License from time to time. Such new versions will be -similar in spirit to the present version, but may differ in detail to address new -problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a -version number of this License which applies to it and "any later version", you -have the option of following the terms and conditions either of that version or -of any later version published by the Free Software Foundation. If the Library -does not specify a license version number, you may choose any version ever -published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs -whose distribution conditions are incompatible with these, write to the author to -ask for permission. For software which is copyrighted by the Free Software -Foundation, write to the Free Software Foundation; we sometimes make exceptions -for this. Our decision will be guided by the two goals of preserving the free -status of all derivatives of our free software and of promoting the sharing and -reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE -LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED -IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE -LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, -SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY -TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF -THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - -END OF TERMS AND CONDITIONS - - -How to Apply These Terms to Your New Libraries ----------------------------------------------- - -If you develop a new library, and you want it to be of the greatest possible use -to the public, we recommend making it free software that everyone can -redistribute and change. You can do so by permitting redistribution under these -terms (or, alternatively, under the terms of the ordinary General Public -License). - -To apply these terms, attach the following notices to the library. It is safest -to attach them to the start of each source file to most effectively convey the -exclusion of warranty; and each file should have at least the "copyright" line -and a pointer to where the full notice is found. - - one line to give the library's name and an idea of what it does. - - Copyright (C) year name of author - - This library is free software; you can redistribute it and/or - - modify it under the terms of the GNU Lesser General Public - - License as published by the Free Software Foundation; either - - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - - but WITHOUT ANY WARRANTY; without even the implied warranty of - - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - - License along with this library; if not, write to the Free Software - - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a -sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in - - the library `Frob' (a library for tweaking knobs) written - - by James Random Hacker. - - signature of Ty Coon, 1 April 1990 - - Ty Coon, President of Vice - -That's all there is to it! - - -Copyright (c) , -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of the nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -Mozilla Public License -Version 2.0 -====================== - +The MIT License (MIT) -1. Definitions --------------- - - 1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the creation - of, or owns Covered Software. - - 1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - - 1.3. "Contribution" - - means Covered Software of a particular Contributor. - - 1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the notice - in Exhibit A, the Executable Form of such Source Code Form, and Modifications - of such Source Code Form, in each case including portions thereof. - - 1.5. "Incompatible With Secondary Licenses" - - means - - a. - - that the initial Contributor has attached the notice described in Exhibit B - to the Covered Software; or - - b. - - that the Covered Software was made available under the terms of version 1.1 - or earlier of the License, but not also under the terms of a Secondary - License. - - 1.6. "Executable Form" - - means any form of the work other than Source Code Form. - - 1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - - 1.8. "License" - - means this document. - - 1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed - by this License. - - 1.10. "Modifications" - - means any of the following: - - a. - - any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. - - any new file in Source Code Form that contains any Covered Software. - - 1.11. "Patent Claims" of a Contributor +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - means any patent claim(s), including without limitation, method, process, and - apparatus claims, in any patent Licensable by such Contributor that would be - infringed, but for the grant of the License, by the making, using, selling, - offering for sale, having made, import, or transfer of either its Contributions - or its Contributor Version. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - 1.12. "Secondary License" +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public License, - Version 3.0, or any later versions of those licenses. +------------------------------------------------------------------------------- +| Markdown.Avalonia (used under MIT License) https://github.com/whistyun/Markdown.Avalonia +------------------------------------------------------------------------------- - 1.13. "Source Code Form" +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2010 Bevan Arps, 2020 Whistyun - means the form of the work preferred for making modifications. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - 1.14. "You" (or "Your") +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - means an individual or a legal entity exercising rights under this License. For - legal entities, "You" includes any entity that controls, is controlled by, or - is under common control with You. For purposes of this definition, "control" - means (a) the power, direct or indirect, to cause the direction or management - of such entity, whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial ownership of such - entity. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -2. License Grants and Conditions --------------------------------- +------------------------------------------------------------------------------- +| Icons.Avalonia (used under MIT License) https://github.com/Projektanker/Icons.Avalonia +------------------------------------------------------------------------------- +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2020 Projektanker - 2.1. Grants +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive - license: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - a. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, modify, - display, perform, distribute, and otherwise exploit its Contributions, - either on an unmodified basis, with Modifications, or as part of a Larger - Work; and +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - b. +------------------------------------------------------------------------------- +| MessageBox.Avalonia (used under MIT License) https://github.com/AvaloniaCommunity/MessageBox.Avalonia +------------------------------------------------------------------------------- - under Patent Claims of such Contributor to make, use, sell, offer for sale, - have made, import, and otherwise transfer either its Contributions or its - Contributor Version. +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2019 CreateLab +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - 2.2. Effective Date +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - 2.3. Limitations on Grant Scope +------------------------------------------------------------------------------- +| Reactive.UI (used under MIT License) https://github.com/reactiveui/reactiveui +------------------------------------------------------------------------------- - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding - Section 2.1(b) above, no patent license is granted by a Contributor: +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) .NET Foundation and Contributors - a. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - for any code that a Contributor has removed from Covered Software; or +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - b. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - c. +------------------------------------------------------------------------------- +| Fody (used under MIT License) https://github.com/Fody/Fody +------------------------------------------------------------------------------- - under Patent Claims infringed by Covered Software in the absence of its - Contributions. +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Simon Cropp - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the notice - requirements in Section 3.4). +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - 2.4. Subsequent Licenses +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - No Contributor makes additional grants as a result of Your choice to distribute - the Covered Software under a subsequent version of this License (see - Section 10.2) or under the terms of a Secondary License (if permitted under the - terms of Section 3.3). +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------- +| InlineIL.Fody (used under MIT License) https://github.com/ltrzesniewski/InlineIL.Fody +------------------------------------------------------------------------------- - 2.5. Representation +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2018 Lucas Trzesniewski - Each Contributor represents that the Contributor believes its Contributions are - its original creation(s) or it has sufficient rights to grant the rights to its - Contributions conveyed by this License. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - 2.6. Fair Use +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------- +| SkiaSharp (used under MIT License) https://github.com/mono/SkiaSharp +------------------------------------------------------------------------------- - 2.7. Conditions +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2015-2016 Xamarin, Inc. +Copyright (c) 2017-2018 Microsoft Corporation. - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: -3. Responsibilities -------------------- +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - 3.1. Distribution of Source Form +------------------------------------------------------------------------------- +| Tmds.DBus (used under MIT License) https://github.com/tmds/Tmds.DBus +------------------------------------------------------------------------------- - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form of - the Covered Software is governed by the terms of this License, and how they can - obtain a copy of this License. You may not attempt to alter or restrict the - recipients' rights in the Source Code Form. +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright 2006 Alp Toker +Copyright 2010 Other Contributors +Copyright 2016 Tom Deseyn +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - 3.2. Distribution of Executable Form +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - If You distribute Covered Software in Executable Form then: +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - a. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - such Covered Software must also be made available in Source Code Form, as - described in Section 3.1, and You must inform recipients of the Executable - Form how they can obtain a copy of such Source Code Form by reasonable - means in a timely manner, at a charge no more than the cost of distribution - to the recipient; and +------------------------------------------------------------------------------- +| Newtonsoft.Json (used under MIT License) https://github.com/JamesNK/Newtonsoft.Json +------------------------------------------------------------------------------- - b. +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2007 James Newton-King - You may distribute such Executable Form under the terms of this License, or - sublicense it under different terms, provided that the license for the - Executable Form does not attempt to limit or alter the recipients' rights - in the Source Code Form under this License. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - 3.3. Distribution of a Larger Work +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software with - a work governed by one or more Secondary Licenses, and the Covered Software is - not Incompatible With Secondary Licenses, this License permits You to - additionally distribute such Covered Software under the terms of such Secondary - License(s), so that the recipient of the Larger Work may, at their option, - further distribute the Covered Software under the terms of either this License - or such Secondary License(s). +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - 3.4. Notices +------------------------------------------------------------------------------- +| WPF (used under MIT License) https://github.com/dotnet/wpf +------------------------------------------------------------------------------- - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations of - liability) contained within the Source Code Form of the Covered Software, - except that You may alter any license notices to the extent required to remedy - known factual inaccuracies. +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) .NET Foundation and Contributors All Rights Reserved +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - 3.5. Application of Additional Terms +Copyright (c) .NET Foundation and Contributors All Rights Reserved - You may choose to offer, and to charge a fee for, warranty, support, indemnity - or liability obligations to one or more recipients of Covered Software. - However, You may do so only on Your own behalf, and not on behalf of any - Contributor. You must make it absolutely clear that any such warranty, support, - indemnity, or liability obligation is offered by You alone, and You hereby - agree to indemnify every Contributor for any liability incurred by such - Contributor as a result of warranty, support, indemnity or liability terms You - offer. You may include additional disclaimers of warranty and limitations of - liability specific to any jurisdiction. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -If it is impossible for You to comply with any of the terms of this License with -respect to some or all of the Covered Software due to statute, judicial order, or -regulation then You must: (a) comply with the terms of this License to the -maximum extent possible; and (b) describe the limitations and the code they -affect. Such description must be placed in a text file included with all -distributions of the Covered Software under this License. Except to the extent -prohibited by statute or regulation, such description must be sufficiently -detailed for a recipient of ordinary skill to be able to understand it. +------------------------------------------------------------------------------- +| SharpDX (used under MIT License) https://github.com/sharpdx/SharpDX +------------------------------------------------------------------------------- +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2010-2014 SharpDX - Alexandre Mutel -5. Termination --------------- +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - 5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, then - the rights granted under this License from a particular Contributor are - reinstated (a) provisionally, unless and until such Contributor explicitly and - finally terminates Your grants, and (b) on an ongoing basis, if such - Contributor fails to notify You of the non-compliance by some reasonable means - prior to 60 days after You have come back into compliance. Moreover, Your - grants from a particular Contributor are reinstated on an ongoing basis if such - Contributor notifies You of the non-compliance by some reasonable means, this - is the first time You have received notice of non-compliance with this License - from such Contributor, and You become compliant prior to 30 days after Your - receipt of the notice. +Copyright (c) 2010-2014 SharpDX - Alexandre Mutel - 5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, and - cross-claims) alleging that a Contributor Version directly or indirectly - infringes any patent, then the rights granted to You by any and all - Contributors for the Covered Software under Section 2.1 of this License shall - terminate. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: - 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -6. Disclaimer of Warranty -------------------------- +------------------------------------------------------------------------------- +| Silverlight Toolkit (used under Microsoft Public License) https://github.com/microsoftarchive/SilverlightToolkit +------------------------------------------------------------------------------- -Covered Software is provided under this License on an "as is" basis, without -warranty of any kind, either expressed, implied, or statutory, including, without -limitation, warranties that the Covered Software is free of defects, -merchantable, fit for a particular purpose or non-infringing. The entire risk as -to the quality and performance of the Covered Software is with You. Should any -Covered Software prove defective in any respect, You (not any Contributor) assume -the cost of any necessary servicing, repair, or correction. This disclaimer of -warranty constitutes an essential part of this License. No use of any Covered -Software is authorized under this License except under this disclaimer. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Microsoft Public License (MS-PL) + +This license governs use of the accompanying software. If you use the software, +you accept this license. If you do not accept the license, do not use the software. + +Definitions The terms "reproduce," "reproduction," "derivative works," and +"distribution" have the same meaning here as under U.S. copyright law. A +"contribution" is the original software, or any additions or changes to the +software. A "contributor" is any person that distributes its contribution under +this license. "Licensed patents" are a contributor's patent claims that read +directly on its contribution. + +Grant of Rights (A) Copyright Grant- Subject to the terms of this license, +including the license conditions and limitations in section 3, each contributor +grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce +its contribution, prepare derivative works of its contribution, and distribute its +contribution or any derivative works that you create. (B) Patent Grant- Subject +to the terms of this license, including the license conditions and limitations in +section 3, each contributor grants you a non-exclusive, worldwide, royalty-free +license under its licensed patents to make, have made, use, sell, offer for sale, +import, and/or otherwise dispose of its contribution in the software or derivative +works of the contribution in the software. + +Conditions and Limitations (A) No Trademark License- This license does not grant +you rights to use any contributors' name, logo, or trademarks. (B) If you bring a +patent claim against any contributor over patents that you claim are infringed by +the software, your patent license from such contributor to the software ends +automatically. (C) If you distribute any portion of the software, you must retain +all copyright, patent, trademark, and attribution notices that are present in the +software. (D) If you distribute any portion of the software in source code form, +you may do so only under this license by including a complete copy of this license +with your distribution. If you distribute any portion of the software in compiled +or object code form, you may only do so under a license that complies with this +license. (E) The software is licensed "as-is." You bear the risk of using it. +The contributors give no express warranties, guarantees or conditions. You may +have additional consumer rights under your local laws which this license cannot +change. To the extent permitted under your local laws, the contributors exclude +the implied warranties of merchantability, fitness for a particular purpose +and non-infringement. +------------------------------------------------------------------------------- +| wayland-protocols (used under MIT License) https://github.com/wayland-project/wayland-protocols +------------------------------------------------------------------------------- -7. Limitation of Liability --------------------------- +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright © 2008-2013 Kristian Høgsberg +Copyright © 2010-2013 Intel Corporation +Copyright © 2013 Rafael Antognolli +Copyright © 2013 Jasper St. Pierre +Copyright © 2014 Jonas Ådahl +Copyright © 2014 Jason Ekstrand +Copyright © 2014-2015 Collabora, Ltd. +Copyright © 2015 Red Hat Inc.l -Under no circumstances and under no legal theory, whether tort (including -negligence), contract, or otherwise, shall any Contributor, or anyone who -distributes Covered Software as permitted above, be liable to You for any direct, -indirect, special, incidental, or consequential damages of any character -including, without limitation, damages for lost profits, loss of goodwill, work -stoppage, computer failure or malfunction, or any and all other commercial -damages or losses, even if such party shall have been informed of the possibility -of such damages. This limitation of liability shall not apply to liability for -death or personal injury resulting from such party's negligence to the extent -applicable law prohibits such limitation. Some jurisdictions do not allow the -exclusion or limitation of incidental or consequential damages, so this exclusion -and limitation may not apply to You. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. -8. Litigation -------------- +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Any litigation relating to this License may be brought only in the courts of a -jurisdiction where the defendant maintains its principal place of business and -such litigation shall be governed by laws of that jurisdiction, without reference -to its conflict-of-law provisions. Nothing in this Section shall prevent a -party's ability to bring cross-claims or counter-claims. +------------------------------------------------------------------------------- +| Metsys.Bson +------------------------------------------------------------------------------- +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2010, Karl Seguin - https://www.openmymind.net/ All rights reserved. -9. Miscellaneous ----------------- +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions +of source code must retain the above copyright notice, this list of conditions +and the following disclaimer. * Redistributions in binary form must reproduce +the above copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the distribution. +* Neither the name of the nor the names of its contributors may be used to +endorse or promote products derived from this software without specific prior +written permission. -This License represents the complete agreement concerning the subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it enforceable. -Any law or regulation which provides that the language of a contract shall be -construed against the drafter shall not be used to construe this License against -a Contributor. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------- +| RichTextKit (used under Apache License, Version 2.0) https://github.com/toptensoftware/RichTextKit +------------------------------------------------------------------------------- -10. Versions of the License ---------------------------- +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright © 2019 Topten Software. All Rights Reserved. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this product except in compliance with the License. You may obtain a copy of the +License at - 10.1. New Versions +http://www.apache.org/licenses/LICENSE-2.0 - Mozilla Foundation is the license steward. Except as provided in Section 10.3, - no one other than the license steward has the right to modify or publish new - versions of this License. Each version will be given a distinguishing version - number. +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +------------------------------------------------------------------------------- +| Mono (used under MIT License) https://github.com/mono/mono +------------------------------------------------------------------------------- - 10.2. Effect of New Versions +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - You may distribute the Covered Software under the terms of the version of the - License under which You originally received the Covered Software, or under the - terms of any subsequent version published by the license steward. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - 10.3. Modified Versions +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - If you create software not governed by this License, and you want to create a - new license for such software, you may create and use a modified version of - this License if you rename the license and remove any references to the name of - the license steward (except to note that such modified license differs from - this License). +------------------------------------------------------------------------------- +| Collections.Pooled (used under MIT License) https://github.com/jtmueller/Collections.Pooled +------------------------------------------------------------------------------- +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Joel Mueller - 10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the notice - described in Exhibit B of this License must be attached. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. -Exhibit A - Source Code Form License Notice -------------------------------------------- +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - This Source Code Form is subject to the terms of the Mozilla Public License, - v. 2.0. If a copy of the MPL was not distributed with this file, You can - obtain one at http://mozilla.org/MPL/2.0/. +------------------------------------------------------------------------------- +| EllipticalArc.java (used under MIT License) http://www.spaceroots.org/documents/ellipse/EllipticalArc.java +------------------------------------------------------------------------------- -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2003-2004, Luc Maisonobe All rights reserved. -You may add additional accurate notices of copyright ownership. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. - This Source Code Form is "Incompatible With Secondary Licenses", as defined - by the Mozilla Public License, v. 2.0. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -| libzstd-dev 1.5.4 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +| WinUI (used under MIT License) https://github.com/microsoft/microsoft-ui-xaml ------------------------------------------------------------------------------- --- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- -Copyright (c) Meta Platforms, Inc. and affiliates. +Copyright (c) Microsoft Corporation. All rights reserved. --- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -Copyright (c) , -All rights reserved. +The MIT License (MIT) -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of the nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -| libzstd-dev 1.5.5 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +| Chromium (used under BSD 3-Clause) https://github.com/chromium/chromium ------------------------------------------------------------------------------- ---- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -Copyright (c) , -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright 2015 The Chromium Authors. All rights reserved. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * Neither the name of the nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. +------------------------------------------------------------------------------- +| Flutter (used under BSD 3-Clause) https://github.com/flutter/flutter +------------------------------------------------------------------------------- +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright 2014 The Flutter Authors. All rights reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- -| roboticstoolbox-python 1.0.2 (used under MIT License) https://github.com/petercorke/robotics-toolbox-python +| Reactive Extensions (used under MIT License) https://github.com/dotnet/reactive ------------------------------------------------------------------------------- ---- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -The MIT License -=============== +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) .NET Foundation and Contributors -Copyright (c) +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the -Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -| zstd 1.5.5 (used under BSD 3-clause "New" or "Revised" License) http://www.zstd.net +| CziCompress (used under MIT License) https://github.com/ZEISS/czicompress ------------------------------------------------------------------------------- --- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- -Copyright (c) Martin Liska, SUSE, Meta Platforms, Inc. and affiliates. -Copyright (C) 2012-2016 Yann Collet. -Copyright (c) Yann Collet, Meta Platforms, Inc. and affiliates. -Copyright 2020 Jan Tojnar. -Copyright (c) 1995-2006, 2010-2011 Jean-loup Gailly. -Copyright (c) 2018-present lzutao -Copyright (C) 2004-2017 Mark Adler. -Copyright (c) 2003-2008 Yuta Mori. All Rights Reserved. -Copyright (c) Meta Platforms, Inc. and affiliates. You can contact the author at : and affiliates and affiliates. All Rights Reserved. -Copyright (C) 1989, 1991, 2000-2016 Free Software Foundation, Inc. -Copyright (c) 2016 Tino Reichardt. All Rights Reserved. +Copyright (c) 2023 Carl Zeiss Microscopy GmbH --- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- -Copyright (c) , -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +The MIT License (MIT) - * Neither the name of the nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ---- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -Generated on Fri, 28 Jul 2023 15:38:21 +0200 using Black Duck 2023.4.2. \ No newline at end of file +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, subject +to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file From ced0e015b4f0aa329b4b10f106529a2258acde6f Mon Sep 17 00:00:00 2001 From: DaveyJonesBitPail <119518234+DaveyJonesBitPail@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:41:49 +0100 Subject: [PATCH 32/32] Add transitive czishrink notices --- ...D_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt | 1495 ++++++++++++++++- 1 file changed, 1494 insertions(+), 1 deletion(-) diff --git a/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt b/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt index dd10674..5c2321b 100644 --- a/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt +++ b/czishrink/THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt @@ -793,4 +793,1497 @@ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| Catch2 3.4.0 (used under Boost Software License 1.0) https://discord.gg/4CWS9zD +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Boost Software License - Version 1.0 +==================================== + + +August 17th, 2003 +----------------- + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by this +license (the "Software") to use, reproduce, display, distribute, execute, and +transmit the Software, and to prepare derivative works of the Software, and to +permit third-parties to whom the Software is furnished to do so, all subject to +the following: +The copyright notices in the Software and this entire statement, including the +above license grant, this restriction and the following disclaimer, must be +included in all copies of the Software, in whole or in part, and all derivative +works of the Software, unless such copies or derivative works are solely in the +form of machine-executable object code generated by a source language processor. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES +OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| CLIUtils/CLI11 v2.3.2 (used under BSD 3-clause "New" or "Revised" License) https://cliutils.gitlab.io/CLI11Tutorial +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner under NSF AWARD 1414736. All Rights Reserved. +Copyright (c) 2012 - 2017, Lars Bilke. All Rights Reserved. +Copyright (c) 2017-2023 University of Cincinnati, developed by Henry Schreiner. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| D3.js 3.5.17 (used under BSD 3-clause "New" or "Revised" License) http://d3js.org/ +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) 2010 Stanford Visualization Group. All Rights Reserved. +Copyright (c) 2011 Jason Davies. All Rights Reserved. +Copyright 2001 Robert Penner. All Rights Reserved. +Copyright (c) 2008-2012 Charles Karney. +Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State. +Copyright (c) 2010 SimpleGeo and Stamen Design. All Rights Reserved. +Copyright (c) 2010-2016 Michael Bostock. All Rights Reserved. +Copyright (C) 2010-2013 Raymond Hill. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) 2010, Stanford Visualization Group +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Stanford University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + +------------------------------------------------------------------------------- +| gmdh 1.0 (used under MIT License) https://github.com/bauman-team/GMDH +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright 2001-2009 Kitware, Inc. +Copyright (C) 2018 David Hyde. +Copyright (C) 2009 Benjamin Schindler. +Copyright 2012 Continuum Analytics, Inc. All Rights Reserved. +Copyright (C) 2002-2007 Yves Renard This file is a part of GETFEM++. +Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). +Copyright (C) 2011 Timothy E. Holy. +Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. +Copyright (C) 2020 Jens Wehner. +Copyright 2017 The TensorFlow Authors. All Rights Reserved. +Copyright 2013-2016 Florent Pruvost. +Copyright (C) EDF R. +Copyright (C) 2012 Desire Nuentsa Wakam. +Copyright (C) 2009-2013 Jitse Niesen. +Copyright (C) 2009 Ilya Baran. +(C) William Swanson, Paul Fultz define PYBIND11_EVAL0(...) __VA_ARGS__ define PYBIND11_EVAL1(...) PYBIND11_EVAL0(PYBIND11_EVAL0(PYBIND11_EVAL0(__VA_ARGS__))) define PYBIND11_EVAL2( +Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. +Copyright (C) 2013 Pavel Holoborodko. +Copyright (c) 2016-2017, 2020 Wenzel Jakob. All Rights Reserved. +Copyright : EDF 2001 $Header$. +Copyright (C) 2014 yoco. +Copyright (C) 2013 Jean Ceccato. +Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. +Copyright (C) 2011-2013 Chen-Pang He. +Copyright (C) 2006-2011, 2015 Benoit Jacob. +copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. +Copyright (c) 2019 Dawid Pilarski. +Copyright (C) 2013 Pierre Zoppitelli. +Copyright (C) 2020 Everton Constantino. +Copyright (C) 2019 David Tellenbach. +(C) Desire NUENTSA WAKAM, INRIA include include include include include include include +Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. +Copyright (c) 2016 Sergey Lyskov and Wenzel Jakob. +(C) Desire NUENTSA WAKAM, INRIA include include include include include include ifd +Copyright (c) Fabian Giesen, 2016. All Rights Reserved. +Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. +Copyright (C) 2012 Alexey Korepanov. +Copyright (C) 1998-2010, 2015-2016. +Copyright (c) 2020 Wenzel Jakob and Henry Schreiner. +Copyright (C) 2015-2016 Eugene Brevdo. +Copyright (C) 2011 Andreas Platen. +Copyright (C) 2017 Viktor Csomor. +Copyright (C) 2020 Antonio Sanchez. +Copyright (c) 2017 Henry F. Schreiner. +Copyright (C) 2017 Kyle Macfarlan. +Copyright (C) 2012-2013 D. +Copyright (C) 2009 Thomas Capricelli This code initially comes from MINPACK whose original authors are:. +Copyright (C) 2008 Daniel Gomez Ferro. +Copyright (C) 2013 Nicolas Carre. +Copyright (C) 2012 David Harmon. +Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. +Copyright (c) 2021 Laramie Leavitt (Google LLC). +Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). +Copyright (c) 2019 Roland Dreier. +copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. +Copyright (C) 2016 Dmitry Vyukov. +Copyright (c) 2007 Allen Winter. +Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. +Copyright (c) 2006-2007 Montel Laurent. +Copyright (C) 2009 Mark Borgerding mark a borgerding net. +Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). +Copyright (C) 2009 Ricard Marxer. +Copyright (c) 2016 Sergey Lyskov. +Copyright 2003-2009 Mark Borgerding template struct kiss_cpx_fft. +Copyright 2012-2013 Mathieu Faverge. +Copyright (C) 2016 Igor Babuschkin. +Copyright (C) 2009 Kenneth Riddile. +Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. +Copyright (C) 2005 the Regents of the University of Minnesota. +Copyright (c) 2007 Alexander Neundorf. +Copyright 2018-2019, 2022 Google LLC. All Rights Reserved. +Copyright (C) 2019 Joel Holdsworth. +Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. +Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. Permition is granted to use, copy, distribute and prepare derivative works of this library for any purpose and without fee, provided, that the above. +Copyright (C) 2020 Jan van Dijk. +Copyright (C) 2009 Rohit Garg. +Copyright (c) 2017 Borja Zarco (Google LLC). +Copyright (C) 2009-2010 Thomas Capricelli. +Copyright (C) 2020 Arm Limited and Contributors. +Copyright (C) 2015 Vijay Vasudevan. +Copyright (C) 2009 Claire Maurice. +Copyright (C) 2017 Codeplay Software Limited. +Copyright (C) 2014-2015 Jianwei Cui. +Copyright (C) 2009-2013 Hauke Heibel. +Copyright (C) 2010 Vincent Lejeune. +Copyright (C) 2008-2009 Guillaume Saupin. +Copyright (C) 2020 Sebastien Boisvert. +Copyright (C) 2009 Mathieu Gautier. +Copyright (C) 2013 Christoph Hertzberg. +Copyright (C) 2008 Gael Guennebaud NOTE The functions of this file have been adapted from the GMM++ library. +Copyright (C) 2012-2013 Desire Nuentsa. +Copyright (C) 2017 Gagan Goel. +Copyright (C) 2014-2017 Benoit Steiner. +Copyright (C) 2020-2021 C. Antonio Sanchez. +Copyright (c) 2018 Hudson River Trading LLC. +Copyright (C) 2014-2015 Navdeep Jaitly. +Copyright (C) 2009 Thomas Capricelli include. +Copyright (c) 2016-2017 Jason Rhinelander. +Copyright (c) 2016 Pim Schellart. +Copyright (C) 2012 The Android Open Source Project. +Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. +Copyright (c) 2016 Ivan Smirnov. +Copyright (C) 2007 Michael Olbrich. +Copyright (c) 2020 The Eigen Authors. +Copyright (c) 2009 Boudewijn Rempt. +Copyright (C) 2012 desire Nuentsa. +(C) Copyright .. +Copyright 2012 Cedric Castagnede. +Copyright (C) 2012 Desire Nuentsa This code initially comes from MINPACK whose original authors are:. +Copyright (C) 2008-2019 Gael Guennebaud. +Copyright (C) 2012 Giacomo Po. +Copyright (c) 2016 Ben North. +copyright: (c) 2013 by Ihor Kalnytskyi +Copyright (C) 2018 Andy Davis. +Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = Moshier Permission has been kindly provided by the original author to incorporate the Cephes software into the Eigen codebase: Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140. +Copyright 2012-2016 Inria. All Rights Reserved. +Copyright (C) 2008-2009 Gael Guennebaud NOTE The class IterationController has been adapted from the iteration. +Copyright (C) 2013 Christian Seiler. +Copyright (C) 2009, 2012 Keir Mierle. +Copyright (c) 2016 Klemens D. Morgenstern. +Copyright (c) 2010 Intel Corp. All Rights Reserved. +Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditio. +Copyright (C) 2008-2016 Konstantinos Margaritis. +Copyright (c) 2006 Timothy A. Davis. +Copyright (c) 2011-2014 Willow Garage, Inc. +Copyright (C) 2016 Tobias Wood. +Copyright (C) 2011-2012, 2014 Kolja Brix. +Copyright (C) 2010 Manuel Yguel. +Copyright (C) 2015 Tal Hadad. +Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee This file is part of the Iterative Template Library. +Copyright (C) 2015 Ke Yang. +Copyright 2005-2010, 2013, 2015, 2018-2021 Google Inc. All Rights Reserved. +Copyright (C) 2018 Eugene Zhulenev. +Copyright (C) 2007 Julien Pommier. +Copyright (C) 2018 Wave Computing, Inc. Written by:. +Copyright 2016-2018 Codeplay Software Ltd. +Copyright (C) 2012 Desire Nuentsa The algorithm of this. +Copyright (c) 2016 Klemens Morgenstern and. +Copyright (C) 2012 Desire NUENTSA WAKAM. +Copyright (c) 2012 Erik Edlund Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a. +Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). +Copyright (C) 2018 Deven Desai. +Copyright (C) 2020 Chris Schoutrop. +Copyright (C) 2010 Daniel Lowengrub. +Copyright 2012-2013 Emmanuel Agullo. +Copyright (C) 2014 Eric Martin. +Copyright (c) 2016 Trent Houliston and. +Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). +Copyright (c) 2019 Pranav. +Copyright (C) 2013 Gauthier Brun. +Copyright (c) 2021 The Pybind Development Team. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License +=============== + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| libeigen/eigen 3.4.0 (used under (GNU Lesser General Public License v2.1 or later AND BSD 3-clause "New" or "Revised" License AND Mozilla Public License 2.0)) https://gitlab.com/libeigen/eigen.git +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (C) 2018 David Hyde. +Copyright (C) 2009 Benjamin Schindler. +Copyright (C) 2021 Chip Kerchner (chip. kerchner@ibm.com). +Copyright (C) 2011 Timothy E. Holy. +Copyright (c) 2021 NVIDIA CORPORATION. All Rights Reserved. +Copyright (C) 2020 Jens Wehner. +Copyright 2017 The TensorFlow Authors. All Rights Reserved. +Copyright 2013-2016 Florent Pruvost. +Copyright (C) EDF R. +Copyright (C) 2012 Desire Nuentsa Wakam. +Copyright (C) 2009-2013 Jitse Niesen. +Copyright (C) 2009 Ilya Baran. +Copyright (C) 2018 Mehdi Goli Codeplay Software Ltd. +Copyright (C) 2013 Pavel Holoborodko. +Copyright : EDF 2001 $Header$. +Copyright (C) 2014 yoco. +Copyright (C) 2013 Jean Ceccato. +Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. +Copyright (C) 2011-2013 Chen-Pang He. +Copyright (C) 2006-2011, 2015 Benoit Jacob. +copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All Rights Reserved. +Copyright (C) 2013 Pierre Zoppitelli. +Copyright (C) 2020 Everton Constantino. +Copyright (C) 2019 David Tellenbach. +Copyright (C) 2008 Gael Guennebaud Adapted from FindEigen. cmake:. +Copyright (c) Fabian Giesen, 2016. All Rights Reserved. +Copyright (c) 1994 by Xerox Corporation. All Rights Reserved. +Copyright (C) 2012 Alexey Korepanov. +Copyright (C) 1998-2010, 2015-2016. +Copyright (C) 2015-2016 Eugene Brevdo. +Copyright (C) 2011 Andreas Platen. +Copyright (C) 2017 Viktor Csomor. +Copyright (C) 2020 Antonio Sanchez. +Copyright 2003-2009 Mark Borgerding. +Copyright (C) 2017 Kyle Macfarlan. +Copyright (C) 2012-2013 D. +Copyright (C) 2008 Daniel Gomez Ferro. +Copyright (C) 2013 Nicolas Carre. +Copyright (C) 2012 David Harmon. +Copyright (c) 2014-2015 Open Source Robotics Foundation. All Rights Reserved. +Copyright (C) 2014, 2016 Benoit Steiner (benoit. steiner.goog@gmail.com). +Copyright (C) 2015 Gael Guennebaud Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions. +copyright (c) 2009-2014 The University of Tennessee and The University of Tennessee Research Foundation. All Rights Reserved. +Copyright (C) 2016 Dmitry Vyukov. +Copyright (c) 2007 Allen Winter. +Copyright (C) 2016 Mehdi Goli, Codeplay Software Ltd. +Copyright (c) 2006-2007 Montel Laurent. +Copyright (C) 2009 Mark Borgerding mark a borgerding net. +Copyright (C) 2014, 2016 Pedro Gonnet (pedro. gonnet@gmail.com). +Copyright (C) 2009 Ricard Marxer. +Copyright 2012-2013 Mathieu Faverge. +Copyright (C) 2016 Igor Babuschkin. +Copyright (C) 2009 Kenneth Riddile. +Copyright (C) 1989, 1991, 1999, 2007 Free Software Foundation, Inc. +Copyright (C) 2005 the Regents of the University of Minnesota. +Copyright (c) 2007 Alexander Neundorf. +Copyright (C) 2019 Joel Holdsworth. +Copyright (c) 1998-2003 by the University of Florida. All Rights Reserved. +Copyright (C) 2002-2007 Yves Renard. +Copyright (C) 2020 Jan van Dijk. +Copyright (C) 2008-2019, 20013, 20015 Gael Guennebaud. +Copyright (C) 2009 Rohit Garg. +Copyright (C) 2009-2010 Thomas Capricelli. +Copyright (C) 2020 Arm Limited and Contributors. +Copyright (C) 2015 Vijay Vasudevan. +Copyright (C) 2009 Claire Maurice. +Copyright (C) 2017 Codeplay Software Limited. +Copyright (C) 2014-2015 Jianwei Cui. +Copyright 1984-1985, 1987, 1992, 2000 by Stephen L. Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 Moshier Direct inquiries to 30 Frost Street, Cambridge, MA 02140 const Scalar zero = 0; const Scalar one = 1; const Scalar nan = NumTr Moshier. +Copyright (C) 2009-2013 Hauke Heibel. +Copyright (C) 2010 Vincent Lejeune. +Copyright (C) 2008-2009 Guillaume Saupin. +Copyright (C) 2020 Sebastien Boisvert. +Copyright (C) 2009 Mathieu Gautier. +Copyright (C) 2013 Christoph Hertzberg. +Copyright (C) 2012-2013 Desire Nuentsa. +Copyright (C) 2017 Gagan Goel. +Copyright (C) 2014-2017 Benoit Steiner. +Copyright (C) 2020-2021 C. Antonio Sanchez. +Copyright (C) 2014-2015 Navdeep Jaitly. +Copyright (C) 1997-2001 Authors: Andrew Lumsdaine Lie-Quan Lee. +Copyright (C) 2012 The Android Open Source Project. +Copyright (C) 2016, 2018-2019 Rasmus Munk Larsen. +Copyright (c) 2001, 2011 Intel Corporation. All Rights Reserved. +Copyright (C) 2007 Michael Olbrich. +Copyright (c) 2020 The Eigen Authors. +Copyright (c) 2009 Boudewijn Rempt. +Copyright (C) 2012 desire Nuentsa. +Copyright 2012 Cedric Castagnede. +Copyright (C) 2012 Giacomo Po. +Copyright (C) 2018 Andy Davis. +Copyright 2012-2016 Inria. All Rights Reserved. +Copyright (C) 2013 Christian Seiler. +Copyright (C) 2009, 2012 Keir Mierle. +Copyright 2007-2009 Kitware, Inc. +Copyright (C) 2008-2016 Konstantinos Margaritis. +Copyright (c) 2006 Timothy A. Davis. +Copyright (c) 2011-2014 Willow Garage, Inc. +Copyright (C) 2016 Tobias Wood. +Copyright (C) 2011-2012, 2014 Kolja Brix. +Copyright (C) 2010 Manuel Yguel. +Copyright (C) 2015 Tal Hadad. +Copyright (C) 2015 Ke Yang. +Copyright (C) 2018 Eugene Zhulenev. +Copyright (C) 2007 Julien Pommier. +Copyright (C) 2018 Wave Computing, Inc. Written by:. +Copyright 2016-2018 Codeplay Software Ltd. +Copyright (C) 2012 Desire NUENTSA WAKAM. +Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google. com). +Copyright (C) 2018 Deven Desai. +Copyright (C) 2020 Chris Schoutrop. +(C) Desire NUENTSA WAKAM, INRIA +Copyright (C) 2010 Daniel Lowengrub. +Copyright 2012-2013 Emmanuel Agullo. +Copyright (C) 2014 Eric Martin. +Copyright (C) 2020 Everton Constantino (everton. constantino@ibm.com). +Copyright (C) 2013 Gauthier Brun. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +GNU Lesser General Public License +================================= + +Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + + of this license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also counts + + as the successor of the GNU Library Public License, version 2, hence + + the version number 2.1.] + + +Preamble +-------- + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public Licenses are intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, but we +suggest you first think carefully about whether this license or the ordinary +General Public License is the better strategy to use in any particular case, +based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. +Our General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for this service if you wish); +that you receive source code or can get it if you want it; that you can change +the software and use pieces of it in new free programs; and that you are informed +that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to +deny you these rights or to ask you to surrender these rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a +fee, you must give the recipients all the rights that we gave you. You must make +sure that they, too, receive or can get the source code. If you link other code +with the library, you must provide complete object files to the recipients, so +that they can relink them with the library after making changes to the library +and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and +(2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone else +and passed on, the recipients should know that what they have is not the original +version, so that the original author's reputation will not be affected by +problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent holder. +Therefore, we insist that any patent license obtained for a version of the +library must be consistent with the full freedom of use specified in this +license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the ordinary +General Public License. We use this license for certain libraries in order to +permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License therefore +permits such linking only if the entire combination fits its criteria of freedom. +The Lesser General Public License permits more lax criteria for linking other +code with the library. + +We call this license the "Lesser" General Public License because it does Less to +protect the user's freedom than the ordinary General Public License. It also +provides other free software developers Less of an advantage over competing +non-free programs. These disadvantages are the reason we use the ordinary General +Public License for many libraries. However, the Lesser license provides +advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto standard. +To achieve this, non-free programs must be allowed to use the library. A more +frequent case is that a free library does the same job as widely used non-free +libraries. In this case, there is little to gain by limiting the free library to +free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables many +more people to use the whole GNU operating system, as well as its variant, the +GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a modified +version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code derived +from the library, whereas the latter must be combined with the library in order +to run. + + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +--------------------------------------------------------------- + +0. This License Agreement applies to any software library or other program which +contains a notice placed by the copyright holder or other authorized party saying +it may be distributed under the terms of this Lesser General Public License (also +called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as +to be conveniently linked with application programs (which use some of those +functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been +distributed under these terms. A "work based on the Library" means either the +Library or any derivative work under copyright law: that is to say, a work +containing the Library or a portion of it, either verbatim or with modifications +and/or translated straightforwardly into another language. (Hereinafter, +translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the source +code for all modules it contains, plus any associated interface definition files, +plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running a program using the +Library is not restricted, and output from such a program is covered only if its +contents constitute a work based on the Library (independent of the use of the +Library in a tool for writing it). Whether that is true depends on what the +Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and disclaimer +of warranty; keep intact all the notices that refer to this License and to the +absence of any warranty; and distribute a copy of this License along with the +Library. + +You may charge a fee for the physical act of transferring a copy, and you may at +your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus +forming a work based on the Library, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all of +these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating + that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all + third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of + data to be supplied by an application program that uses the facility, other + than as an argument passed when the facility is invoked, then you must make + a good faith effort to ensure that, in the event an application does not + supply such function or table, the facility still operates, and performs + whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose + that is entirely well-defined independent of the application. Therefore, + Subsection 2d requires that any application-supplied function or table used + by this function must be optional: if the application does not supply it, + the square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If identifiable + sections of that work are not derived from the Library, and can be + reasonably considered independent and separate works in themselves, then + this License, and its terms, do not apply to those sections when you + distribute them as separate works. But when you distribute the same + sections as part of a whole which is a work based on the Library, the + distribution of the whole must be on the terms of this License, whose + permissions for other licensees extend to the entire whole, and thus to + each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest your + rights to work written entirely by you; rather, the intent is to exercise + the right to control the distribution of derivative or collective works + based on the Library. + + In addition, mere aggregation of another work not based on the Library with + the Library (or with a work based on the Library) on a volume of a storage + or distribution medium does not bring the other work under the scope of + this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. (If a +newer version than version 2 of the ordinary GNU General Public License has +appeared, then you can specify that version instead if you wish.) Do not make any +other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so +the ordinary GNU General Public License applies to all subsequent copies and +derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into +a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, +under Section 2) in object code or executable form under the terms of Sections 1 +and 2 above provided that you accompany it with the complete corresponding +machine-readable source code, which must be distributed under the terms of +Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code from +the same place satisfies the requirement to distribute the source code, even +though third parties are not compelled to copy the source along with the object +code. + +5. A program that contains no derivative of any portion of the Library, but is +designed to work with the Library by being compiled or linked with it, is called +a "work that uses the Library". Such a work, in isolation, is not a derivative +work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions of +the Library), rather than a "work that uses the library". The executable is +therefore covered by this License. Section 6 states terms for distribution of +such executables. + +When a "work that uses the Library" uses material from a header file that is part +of the Library, the object code for the work may be a derivative work of the +Library even though the source code is not. Whether this is true is especially +significant if the work can be linked without the Library, or if the work is +itself a library. The threshold for this to be true is not precisely defined by +law. + +If such an object file uses only numerical parameters, data structure layouts and +accessors, and small macros and small inline functions (ten lines or less in +length), then the use of the object file is unrestricted, regardless of whether +it is legally a derivative work. (Executables containing this object code plus +portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the +object code for the work under the terms of Section 6. Any executables containing +that work also fall under Section 6, whether or not they are linked directly with +the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work +that uses the Library" with the Library to produce a work containing portions of +the Library, and distribute that work under terms of your choice, provided that +the terms permit modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is +used in it and that the Library and its use are covered by this License. You must +supply a copy of this License. If the work during execution displays copyright +notices, you must include the copyright notice for the Library among them, as +well as a reference directing the user to the copy of this License. Also, you +must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable + source code for the Library including whatever changes were used in the + work (which must be distributed under Sections 1 and 2 above); and, if the + work is an executable linked with the Library, with the complete + machine-readable "work that uses the Library", as object code and/or source + code, so that the user can modify the Library and then relink to produce a + modified executable containing the modified Library. (It is understood that + the user who changes the contents of definitions files in the Library will + not necessarily be able to recompile the application to use the modified + definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A + suitable mechanism is one that (1) uses at run time a copy of the library + already present on the user's computer system, rather than copying library + functions into the executable, and (2) will operate properly with a + modified version of the library, if the user installs one, as long as the + modified version is interface-compatible with the version that the work was + made with. + + c) Accompany the work with a written offer, valid for at least three years, + to give the same user the materials specified in Subsection 6a, above, for + a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a + designated place, offer equivalent access to copy the above specified + materials from the same place. + + e) Verify that the user has already received a copy of these materials or + that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable from +it. However, as a special exception, the materials to be distributed need not +include anything that is normally distributed (in either source or binary form) +with the major components (compiler, kernel, and so on) of the operating system +on which the executable runs, unless that component itself accompanies the +executable. + +It may happen that this requirement contradicts the license restrictions of other +proprietary libraries that do not normally accompany the operating system. Such a +contradiction means you cannot use both them and the Library together in an +executable that you distribute. + +7. You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities not +covered by this License, and distribute such a combined library, provided that +the separate distribution of the work based on the Library and of the other +library facilities is otherwise permitted, and provided that you do these two +things: + + a) Accompany the combined library with a copy of the same work based on the + Library, uncombined with any other library facilities. This must be + distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of + it is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense, link with, or distribute the Library is void, and will +automatically terminate your rights under this License. However, parties who have +received copies, or rights, from you under this License will not have their +licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the Library +or its derivative works. These actions are prohibited by law if you do not accept +this License. Therefore, by modifying or distributing the Library (or any work +based on the Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying the Library +or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), +the recipient automatically receives a license from the original licensor to +copy, distribute, link with or modify the Library subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement +or for any other reason (not limited to patent issues), conditions are imposed on +you (whether by court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the conditions of this +License. If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, then as a +consequence you may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by all those +who receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, and the +section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system which is implemented by public license practices. Many people +have made generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that system; it is +up to the author/donor to decide if he or she is willing to distribute software +through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Library under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is +permitted only in or among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the +Lesser General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a +version number of this License which applies to it and "any later version", you +have the option of following the terms and conditions either of that version or +of any later version published by the Free Software Foundation. If the Library +does not specify a license version number, you may choose any version ever +published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the author to +ask for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make exceptions +for this. Our decision will be guided by the two goals of preserving the free +status of all derivatives of our free software and of promoting the sharing and +reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE +LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED +IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY +TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + +END OF TERMS AND CONDITIONS + + +How to Apply These Terms to Your New Libraries +---------------------------------------------- + +If you develop a new library, and you want it to be of the greatest possible use +to the public, we recommend making it free software that everyone can +redistribute and change. You can do so by permitting redistribution under these +terms (or, alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the library. It is safest +to attach them to the start of each source file to most effectively convey the +exclusion of warranty; and each file should have at least the "copyright" line +and a pointer to where the full notice is found. + + one line to give the library's name and an idea of what it does. + + Copyright (C) year name of author + + This library is free software; you can redistribute it and/or + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + + License along with this library; if not, write to the Free Software + + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a +sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in + + the library `Frob' (a library for tweaking knobs) written + + by James Random Hacker. + + signature of Ty Coon, 1 April 1990 + + Ty Coon, President of Vice + +That's all there is to it! + + +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Mozilla Public License +Version 2.0 +====================== + + +1. Definitions +-------------- + + 1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the creation + of, or owns Covered Software. + + 1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + + 1.3. "Contribution" + + means Covered Software of a particular Contributor. + + 1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the notice + in Exhibit A, the Executable Form of such Source Code Form, and Modifications + of such Source Code Form, in each case including portions thereof. + + 1.5. "Incompatible With Secondary Licenses" + + means + + a. + + that the initial Contributor has attached the notice described in Exhibit B + to the Covered Software; or + + b. + + that the Covered Software was made available under the terms of version 1.1 + or earlier of the License, but not also under the terms of a Secondary + License. + + 1.6. "Executable Form" + + means any form of the work other than Source Code Form. + + 1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + + 1.8. "License" + + means this document. + + 1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed + by this License. + + 1.10. "Modifications" + + means any of the following: + + a. + + any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. + + any new file in Source Code Form that contains any Covered Software. + + 1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, process, and + apparatus claims, in any patent Licensable by such Contributor that would be + infringed, but for the grant of the License, by the making, using, selling, + offering for sale, having made, import, or transfer of either its Contributions + or its Contributor Version. + + 1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public License, + Version 3.0, or any later versions of those licenses. + + 1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + + 1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this License. For + legal entities, "You" includes any entity that controls, is controlled by, or + is under common control with You. For purposes of this definition, "control" + means (a) the power, direct or indirect, to cause the direction or management + of such entity, whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial ownership of such + entity. + + +2. License Grants and Conditions +-------------------------------- + + + 2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive + license: + + a. + + under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, modify, + display, perform, distribute, and otherwise exploit its Contributions, + either on an unmodified basis, with Modifications, or as part of a Larger + Work; and + + b. + + under Patent Claims of such Contributor to make, use, sell, offer for sale, + have made, import, and otherwise transfer either its Contributions or its + Contributor Version. + + + 2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + + + 2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding + Section 2.1(b) above, no patent license is granted by a Contributor: + + a. + + for any code that a Contributor has removed from Covered Software; or + + b. + + for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. + + under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the notice + requirements in Section 3.4). + + + 2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to distribute + the Covered Software under a subsequent version of this License (see + Section 10.2) or under the terms of a Secondary License (if permitted under the + terms of Section 3.3). + + + 2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions are + its original creation(s) or it has sufficient rights to grant the rights to its + Contributions conveyed by this License. + + + 2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + + + 2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities +------------------- + + + 3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form of + the Covered Software is governed by the terms of this License, and how they can + obtain a copy of this License. You may not attempt to alter or restrict the + recipients' rights in the Source Code Form. + + + 3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. + + such Covered Software must also be made available in Source Code Form, as + described in Section 3.1, and You must inform recipients of the Executable + Form how they can obtain a copy of such Source Code Form by reasonable + means in a timely manner, at a charge no more than the cost of distribution + to the recipient; and + + b. + + You may distribute such Executable Form under the terms of this License, or + sublicense it under different terms, provided that the license for the + Executable Form does not attempt to limit or alter the recipients' rights + in the Source Code Form under this License. + + + 3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software with + a work governed by one or more Secondary Licenses, and the Covered Software is + not Incompatible With Secondary Licenses, this License permits You to + additionally distribute such Covered Software under the terms of such Secondary + License(s), so that the recipient of the Larger Work may, at their option, + further distribute the Covered Software under the terms of either this License + or such Secondary License(s). + + + 3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations of + liability) contained within the Source Code Form of the Covered Software, + except that You may alter any license notices to the extent required to remedy + known factual inaccuracies. + + + 3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, indemnity + or liability obligations to one or more recipients of Covered Software. + However, You may do so only on Your own behalf, and not on behalf of any + Contributor. You must make it absolutely clear that any such warranty, support, + indemnity, or liability obligation is offered by You alone, and You hereby + agree to indemnify every Contributor for any liability incurred by such + Contributor as a result of warranty, support, indemnity or liability terms You + offer. You may include additional disclaimers of warranty and limitations of + liability specific to any jurisdiction. + + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this License with +respect to some or all of the Covered Software due to statute, judicial order, or +regulation then You must: (a) comply with the terms of this License to the +maximum extent possible; and (b) describe the limitations and the code they +affect. Such description must be placed in a text file included with all +distributions of the Covered Software under this License. Except to the extent +prohibited by statute or regulation, such description must be sufficiently +detailed for a recipient of ordinary skill to be able to understand it. + + +5. Termination +-------------- + + 5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, then + the rights granted under this License from a particular Contributor are + reinstated (a) provisionally, unless and until such Contributor explicitly and + finally terminates Your grants, and (b) on an ongoing basis, if such + Contributor fails to notify You of the non-compliance by some reasonable means + prior to 60 days after You have come back into compliance. Moreover, Your + grants from a particular Contributor are reinstated on an ongoing basis if such + Contributor notifies You of the non-compliance by some reasonable means, this + is the first time You have received notice of non-compliance with this License + from such Contributor, and You become compliant prior to 30 days after Your + receipt of the notice. + + 5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, and + cross-claims) alleging that a Contributor Version directly or indirectly + infringes any patent, then the rights granted to You by any and all + Contributors for the Covered Software under Section 2.1 of this License shall + terminate. + + 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + + +6. Disclaimer of Warranty +------------------------- + +Covered Software is provided under this License on an "as is" basis, without +warranty of any kind, either expressed, implied, or statutory, including, without +limitation, warranties that the Covered Software is free of defects, +merchantable, fit for a particular purpose or non-infringing. The entire risk as +to the quality and performance of the Covered Software is with You. Should any +Covered Software prove defective in any respect, You (not any Contributor) assume +the cost of any necessary servicing, repair, or correction. This disclaimer of +warranty constitutes an essential part of this License. No use of any Covered +Software is authorized under this License except under this disclaimer. + + +7. Limitation of Liability +-------------------------- + +Under no circumstances and under no legal theory, whether tort (including +negligence), contract, or otherwise, shall any Contributor, or anyone who +distributes Covered Software as permitted above, be liable to You for any direct, +indirect, special, incidental, or consequential damages of any character +including, without limitation, damages for lost profits, loss of goodwill, work +stoppage, computer failure or malfunction, or any and all other commercial +damages or losses, even if such party shall have been informed of the possibility +of such damages. This limitation of liability shall not apply to liability for +death or personal injury resulting from such party's negligence to the extent +applicable law prohibits such limitation. Some jurisdictions do not allow the +exclusion or limitation of incidental or consequential damages, so this exclusion +and limitation may not apply to You. + + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the courts of a +jurisdiction where the defendant maintains its principal place of business and +such litigation shall be governed by laws of that jurisdiction, without reference +to its conflict-of-law provisions. Nothing in this Section shall prevent a +party's ability to bring cross-claims or counter-claims. + + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject matter +hereof. If any provision of this License is held to be unenforceable, such +provision shall be reformed only to the extent necessary to make it enforceable. +Any law or regulation which provides that the language of a contract shall be +construed against the drafter shall not be used to construe this License against +a Contributor. + + +10. Versions of the License +--------------------------- + + + 10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section 10.3, + no one other than the license steward has the right to modify or publish new + versions of this License. Each version will be given a distinguishing version + number. + + + 10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of the + License under which You originally received the Covered Software, or under the + terms of any subsequent version published by the license steward. + + + 10.3. Modified Versions + + If you create software not governed by this License, and you want to create a + new license for such software, you may create and use a modified version of + this License if you rename the license and remove any references to the name of + the license steward (except to note that such modified license differs from + this License). + + + 10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses + + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the notice + described in Exhibit B of this License must be attached. + + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public License, + v. 2.0. If a copy of the MPL was not distributed with this file, You can + obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as defined + by the Mozilla Public License, v. 2.0. + +------------------------------------------------------------------------------- +| libzstd-dev 1.5.4 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Meta Platforms, Inc. and affiliates. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| libzstd-dev 1.5.5 (used under BSD 3-clause "New" or "Revised" License) https://github.com/Cyan4973/zstd +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------- +| roboticstoolbox-python 1.0.2 (used under MIT License) https://github.com/petercorke/robotics-toolbox-python +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +The MIT License +=============== + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------- +| zstd 1.5.5 (used under BSD 3-clause "New" or "Revised" License) http://www.zstd.net +------------------------------------------------------------------------------- + +--- --- --- --- --- --- --- Copyright notice(s) --- --- --- --- --- --- --- --- +Copyright (c) Martin Liska, SUSE, Meta Platforms, Inc. and affiliates. +Copyright (C) 2012-2016 Yann Collet. +Copyright (c) Yann Collet, Meta Platforms, Inc. and affiliates. +Copyright 2020 Jan Tojnar. +Copyright (c) 1995-2006, 2010-2011 Jean-loup Gailly. +Copyright (c) 2018-present lzutao +Copyright (C) 2004-2017 Mark Adler. +Copyright (c) 2003-2008 Yuta Mori. All Rights Reserved. +Copyright (c) Meta Platforms, Inc. and affiliates. You can contact the author at : and affiliates and affiliates. All Rights Reserved. +Copyright (C) 1989, 1991, 2000-2016 Free Software Foundation, Inc. +Copyright (c) 2016 Tino Reichardt. All Rights Reserved. + +--- --- --- --- --- --- --- License text(s) --- --- --- --- --- --- --- --- --- +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- \ No newline at end of file