Skip to content

Commit

Permalink
Reimplement image input handling for toktx. (#702)
Browse files Browse the repository at this point in the history
* Add imageio library.
* Rework toktx to use the imageio library and break up the
   gigantic main loop.
* Add git subrepo of {fmt} library 9.1.0 used by imageio
* Remove VS2017 builds from CI as fmt needs a more recent version.

The output plugins are empty shells.

All toktx tests pass. Some golden images are modified due to
toktx now doing a transfer function conversion from BT709
to sRGB when reading npbm files. Some tests are modified because
toktx no longer chooses sRGB or Linear when the gamma is
somewhere between them.

fmt was previously added to another branch via PR #662.

* Adopt fmt 9.1.0 for formatting (#662)

* git subrepo clone --branch=9.1.0 https://github.com/fmtlib/fmt.git other_projects/fmt

subrepo:
  subdir:   "other_projects/fmt"
  merged:   "a3370119"
upstream:
  origin:   "https://github.com/fmtlib/fmt.git"
  branch:   "9.1.0"
  commit:   "a3370119"
git-subrepo:
  version:  "0.4.5"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "dbb99be"

The parent in other_projects/fmt/.gitrepo has been updated to account for this current PR.


Co-authored-by: Császár Mátyás <VaderY@users.noreply.github.com>
  • Loading branch information
MarkCallow and Császár Mátyás authored May 17, 2023
1 parent f81330b commit 1646c4d
Show file tree
Hide file tree
Showing 251 changed files with 94,795 additions and 3,525 deletions.
199 changes: 0 additions & 199 deletions .appveyor.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Files: lib/basisu/basisu_astc_decomp.*
Copyright: 2016 The Android Open Source Project
License: Apache-2.0

Files: tools/toktx/lodepng.*
Files: tools/imageio/png.imageio/lodepng.*
Copyright: 2005-2019 Lode Vandevenne
License: Zlib

Expand Down Expand Up @@ -200,3 +200,7 @@ License: MIT
Files: the_khronos_group_inc.p12.enc
Copyright: 2022 The Khronos Group Inc.
License: Apache-2.0

Files: other_projects/fmt/*
Copyright: 2012 - present Victor Zverovich
License: MIT
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ else()
target_link_libraries(ktx PRIVATE ${ASTC_LIB_TARGET})
endif()

# FMT
add_subdirectory(other_projects/fmt)

# Tools
if(KTX_FEATURE_TOOLS)
add_subdirectory(tools)
Expand Down
8 changes: 8 additions & 0 deletions other_projects/fmt/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Run manually to reformat a file:
# clang-format -i --style=file <file>
Language: Cpp
BasedOnStyle: Google
IndentPPDirectives: AfterHash
IndentCaseLabels: false
AlwaysBreakTemplateDeclarations: false
DerivePointerAlignment: false
6 changes: 6 additions & 0 deletions other_projects/fmt/.github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
Please make sure that the problem reproduces on the current master before
submitting an issue.
If possible please provide a repro on Compiler Explorer:
https://godbolt.org/z/fxccbh53W.
-->
6 changes: 6 additions & 0 deletions other_projects/fmt/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
Please read the contribution guidelines before submitting a pull request:
https://github.com/fmtlib/fmt/blob/master/CONTRIBUTING.md.
By submitting this pull request, you agree that your contributions are licensed
under the {fmt} license, and agree to future changes to the licensing.
-->
27 changes: 27 additions & 0 deletions other_projects/fmt/.github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: doc

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
# Use Ubuntu 20.04 because doxygen 1.8.13 from Ubuntu 18.04 is broken.
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Create Build Environment
run: |
sudo apt update
sudo apt install doxygen python3-virtualenv
sudo npm install -g less clean-css
cmake -E make_directory ${{runner.workspace}}/build
- name: Build
working-directory: ${{runner.workspace}}/build
env:
KEY: ${{secrets.KEY}}
run: $GITHUB_WORKSPACE/support/build-docs.py
94 changes: 94 additions & 0 deletions other_projects/fmt/.github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: linux

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
cxx: [g++-4.8, g++-10, clang++-9]
build_type: [Debug, Release]
std: [11]
os: [ubuntu-18.04]
include:
- cxx: g++-4.8
install: sudo apt install g++-4.8
os: ubuntu-18.04
- cxx: g++-8
build_type: Debug
std: 14
install: sudo apt install g++-8
os: ubuntu-18.04
- cxx: g++-8
build_type: Debug
std: 17
install: sudo apt install g++-8
os: ubuntu-18.04
- cxx: g++-10
build_type: Debug
std: 17
os: ubuntu-18.04
- cxx: g++-11
build_type: Debug
std: 20
os: ubuntu-20.04
install: sudo apt install g++-11
- cxx: clang++-8
build_type: Debug
std: 17
cxxflags: -stdlib=libc++
os: ubuntu-18.04
install: sudo apt install clang-8 libc++-8-dev libc++abi-8-dev
- cxx: clang++-9
build_type: Debug
fuzz: -DFMT_FUZZ=ON -DFMT_FUZZ_LINKMAIN=ON
std: 17
os: ubuntu-18.04
- cxx: clang++-11
build_type: Debug
std: 20
os: ubuntu-20.04
- cxx: clang++-11
build_type: Debug
std: 20
cxxflags: -stdlib=libc++
os: ubuntu-20.04
install: sudo apt install libc++-11-dev libc++abi-11-dev
- shared: -DBUILD_SHARED_LIBS=ON

steps:
- uses: actions/checkout@v2

- name: Create Build Environment
run: |
${{matrix.install}}
sudo apt update
sudo apt install locales-all
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure
working-directory: ${{runner.workspace}}/build
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
run: |
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.fuzz}} ${{matrix.shared}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} -DFMT_DOC=OFF \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE
- name: Build
working-directory: ${{runner.workspace}}/build
run: |
threads=`nproc`
cmake --build . --config ${{matrix.build_type}} --parallel $threads
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}}
env:
CTEST_OUTPUT_ON_FAILURE: True
Loading

0 comments on commit 1646c4d

Please sign in to comment.