Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5001ec5070 |
@@ -1 +0,0 @@
|
||||
6.3.2
|
||||
-123
@@ -1,123 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: true
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
# AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
# AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
# AllowShortLambdasOnASingleLine: true
|
||||
# ArrayInitializerAlignmentStyle: Left
|
||||
AlwaysBreakAfterDefinitionReturnType: TopLevel
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: false
|
||||
ColumnLimit: 80
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '(Test|_test)?$'
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 4
|
||||
ObjCSpaceAfterProperty: true
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 4
|
||||
PenaltyBreakBeforeFirstCallParameter: 8
|
||||
PenaltyBreakComment: 1000
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 20
|
||||
PointerAlignment: Left
|
||||
ReflowComments: false
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: Always
|
||||
SpaceBeforeRangeBasedForLoopColon: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 8
|
||||
#UseTab: ForIndentation
|
||||
UseTab: Never
|
||||
...
|
||||
@@ -1,8 +0,0 @@
|
||||
# if you have git newer than 2.23, you can either
|
||||
# specify this on the command line
|
||||
# git blame foo.cpp --ignore-revs-file path/to/this/file
|
||||
# or add this file to your config
|
||||
# git config --global blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
# initial clang-format run
|
||||
2a24ae77ab94f4c06b102eba73feb52e2f90cb46
|
||||
@@ -1,224 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: Analysis
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Weekly Sunday build
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# SonarCloud static analysis
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
linux_sonarcloud:
|
||||
name: 'SonarCloud Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
|
||||
if: github.repository == 'AcademySoftwareFoundation/openexr'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:2022
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
steps:
|
||||
# TODO: Remove this workaround following resolution of:
|
||||
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
|
||||
- name: Setup container
|
||||
run: sudo rm -rf /usr/local/lib64/cmake/glew
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 50
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
|
||||
-DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
|
||||
-DCMAKE_C_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
|
||||
-DCMAKE_C_OUTPUT_EXTENSION_REPLACE=ON \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-lgcov" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS='OFF' \
|
||||
-DOPENEXR_BUILD_TOOLS='ON' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
|
||||
-DOPENEXR_ENABLE_THREADING='ON'
|
||||
working-directory: _build
|
||||
- name: Build OpenEXR with build-wrapper
|
||||
shell: bash
|
||||
run: |
|
||||
build-wrapper-linux-x86-64 --out-dir bw_output \
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test \
|
||||
-C Release \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
working-directory: _build
|
||||
- name: Coverage
|
||||
run: share/ci/scripts/linux/run_gcov.sh
|
||||
shell: bash
|
||||
- name: Sonar-scanner
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: sonar-scanner -X -Dsonar.login=$SONAR_TOKEN
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Valgrind memcheck test
|
||||
# ------------------------------------------------------------------------------
|
||||
linux_valgrind:
|
||||
name: 'Valgrind Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
|
||||
if: github.repository == 'AcademySoftwareFoundation/openexr'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:2022
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
steps:
|
||||
# TODO: Remove this workaround following resolution of:
|
||||
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
|
||||
- name: Setup container
|
||||
run: sudo rm -rf /usr/local/lib64/cmake/glew
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 50
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
shell: bash
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
share/ci/scripts/linux/install_valgrind.sh
|
||||
shell: bash
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS='OFF' \
|
||||
-DOPENEXR_BUILD_TOOLS='ON' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
|
||||
-DOPENEXR_ENABLE_THREADING='ON'
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release
|
||||
working-directory: _build
|
||||
- name: Valgrind memcheck tests
|
||||
run: |
|
||||
ctest -C Release \
|
||||
--timeout 50000 \
|
||||
--force-new-ctest-process \
|
||||
--test-action memcheck \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
working-directory: _build
|
||||
- name: Valgrind memcheck test results
|
||||
run: |
|
||||
share/ci/scripts/linux/log_valgrind.sh _build
|
||||
shell: bash
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Fuzz test
|
||||
# ------------------------------------------------------------------------------
|
||||
linux_fuzz:
|
||||
name: 'Fuzz Test ${{ matrix.build-descrip }} Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
|
||||
if: github.repository == 'AcademySoftwareFoundation/openexr'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:2022
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
include:
|
||||
# Fuzz test
|
||||
- build: 1
|
||||
build-descrip:
|
||||
cflags:
|
||||
cxxflags:
|
||||
# Fuzz with sanitizer
|
||||
- build: 2
|
||||
build-descrip: With Sanitizer
|
||||
cflags: -DCFLAGS='-fsanitize=address'
|
||||
cxxflags: -DCXXFLAGS='-fsanitize=address'
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
steps:
|
||||
# TODO: Remove this workaround following resolution of:
|
||||
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
|
||||
- name: Setup container
|
||||
run: sudo rm -rf /usr/local/lib64/cmake/glew
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 50
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
shell: bash
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS='OFF' \
|
||||
-DOPENEXR_BUILD_TOOLS='ON' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='ON' \
|
||||
-DOPENEXR_ENABLE_THREADING='ON' \
|
||||
${{ matrix.cxxflags }} \
|
||||
${{ matrix.cflags }}
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release
|
||||
working-directory: _build
|
||||
- name: Fuzz test
|
||||
run: |
|
||||
bin/OpenEXRFuzzTest
|
||||
working-directory: _build
|
||||
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: Bazel
|
||||
|
||||
# Skip the run on *.md changes and on changes to the website, *except*
|
||||
# for "website/src", since that code needs validation. There's a
|
||||
# separate workflow for with website.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build_and_test_ubuntu:
|
||||
name: Linux Ubuntu 22.04 Bazel build <GCC 11.4.0>
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Mount Bazel cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel-ubuntu-22
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazelisk build //...
|
||||
bazelisk test //...
|
||||
# Test bzlmod
|
||||
bazelisk build --enable_bzlmod -- //...
|
||||
bazelisk test --enable_bzlmod -- //...
|
||||
|
||||
build_and_test_windows:
|
||||
name: Windows Server 2022 build <Visual Studio 2022>
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Mount Bazel cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel-windows-2022
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazelisk build //...
|
||||
bazelisk test //...
|
||||
# Test bzlmod
|
||||
bazelisk build --enable_bzlmod -- //...
|
||||
bazelisk test --enable_bzlmod -- //...
|
||||
|
||||
build_and_test_macos:
|
||||
name: macOS 13 Bazel build <Apple Clang14>
|
||||
runs-on: macos-13
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Mount Bazel cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel-macos-13
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazelisk build //...
|
||||
bazelisk test //...
|
||||
# Test bzlmod
|
||||
bazelisk build --enable_bzlmod -- //...
|
||||
bazelisk test --enable_bzlmod -- //...
|
||||
@@ -1,552 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: CI
|
||||
|
||||
# Skip the run on *.md changes and on changes to the website, *except*
|
||||
# for "website/src", since that code needs validation. There's a
|
||||
# separate workflow for with website. Also, no need to run on changes
|
||||
# to the bazel setup.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# Linux jobs run in Docker containers, so the latest OS version is OK. macOS
|
||||
# and Windows jobs need to be locked to specific virtual environment
|
||||
# versions to mitigate issues from OS updates, and will require maintenance
|
||||
# as OS versions are retired.
|
||||
#
|
||||
# GH Actions (Free plan) supports 20 concurrent jobs, with 5 concurrent macOS
|
||||
# jobs. This workflow tries to utilize (but not exceed) that budget to
|
||||
# promote timely CI.
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Linux
|
||||
# ---------------------------------------------------------------------------
|
||||
# TODO: Add ARM build. Add sanitize build.
|
||||
|
||||
linux:
|
||||
name: 'Linux ${{ matrix.label }}VFXP-${{ matrix.vfx-cy }} centos7
|
||||
<${{ matrix.compiler-desc }},
|
||||
C++${{ matrix.cxx-standard }},
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
threads=${{ matrix.threads-enabled }}>'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:${{ matrix.vfx-cy }}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
include:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - GCC
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# Shared, Release, Threads OFF
|
||||
- build: 2
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'OFF'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# Shared, Debug
|
||||
- build: 3
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# Static, Release
|
||||
- build: 4
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# Shared, Release, C++14
|
||||
- build: 5
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - Clang 15.0
|
||||
# -------------------------------------------------------------------
|
||||
# Release
|
||||
- build: 6
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: clang15.0
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - Clang 14.0
|
||||
# -------------------------------------------------------------------
|
||||
# Release
|
||||
- build: 7
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: clang14.0
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2022 - GCC, Release
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 8
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc9.3.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2022
|
||||
exclude-tests:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2021 - GCC, Release
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 9
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc9.3.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2021
|
||||
exclude-tests:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2020 - GCC, Release
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 10
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc6.3.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2020
|
||||
exclude-tests:
|
||||
|
||||
env:
|
||||
CXX: ${{ matrix.cxx-compiler }}
|
||||
CC: ${{ matrix.cc-compiler }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
mkdir _examples
|
||||
- name: Install help2man
|
||||
run: yum install -y help2man
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOPENEXR_INSTALL_TOOLS='ON' \
|
||||
-DOPENEXR_INSTALL_DOCS='ON' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
|
||||
-DOPENEXR_ENABLE_THREADING=${{ matrix.threads-enabled }}
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Validate
|
||||
run: |
|
||||
share/ci/scripts/linux/validate_openexr_libs.sh _install
|
||||
- name: Examples
|
||||
run: |
|
||||
# Make sure we can build the examples when configured as a
|
||||
# standalone application linking against the just-installed
|
||||
# OpenEXR library.
|
||||
cmake ../src/examples \
|
||||
-DCMAKE_PREFIX_PATH=../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
# Confirm the examples program runs
|
||||
./bin/OpenEXRExamples
|
||||
working-directory: _examples
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test ${{ matrix.exclude-tests }} \
|
||||
-C ${{ matrix.build-type }} \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
working-directory: _build
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# macOS
|
||||
# ---------------------------------------------------------------------------
|
||||
# TODO: Add ARM64/x86_64 (universal 2) build
|
||||
|
||||
macos:
|
||||
name: 'Mac VFXP-${{ matrix.vfx-cy }} macos-${{ matrix.osver }}
|
||||
<${{ matrix.compiler-desc }},
|
||||
C++${{ matrix.cxx-standard }},
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
threads=${{ matrix.threads-enabled }}>'
|
||||
runs-on: macos-${{ matrix.osver }}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - C++17 - MacOS 11.0
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
# Shared, Release, Threads OFF
|
||||
- build: 2
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'OFF'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
# Static, Release
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
# Shared, Debug
|
||||
- build: 4
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - C++17 - MacOS 12
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 5
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 12.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
mkdir _examples
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOPENEXR_INSTALL_TOOLS='ON' \
|
||||
-DOPENEXR_INSTALL_DOCS='OFF' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF'
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Examples
|
||||
run: |
|
||||
# Make sure we can build the examples when configured as a
|
||||
# standalone application linking against the just-installed
|
||||
# OpenEXR library.
|
||||
cmake ../src/examples \
|
||||
-DCMAKE_PREFIX_PATH=../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
# Confirm the examples program runs
|
||||
./bin/OpenEXRExamples
|
||||
working-directory: _examples
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test ${{matrix.exclude-tests }} \
|
||||
-C ${{matrix.build-type}} \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
working-directory: _build
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Windows
|
||||
# ---------------------------------------------------------------------------
|
||||
# TODO: Debug mode is catatonically slow under windows
|
||||
windows:
|
||||
name: 'Windows VFXP-${{ matrix.vfx-cy }}
|
||||
<${{ matrix.compiler-desc }},
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
threads=${{ matrix.threads-enabled }}>'
|
||||
runs-on: windows-${{ matrix.osver }}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - C++17 - Windows 2022 runner - MSVC 2022 (17.5)
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc17.5
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2023
|
||||
exclude-tests: ''
|
||||
osver: 2022
|
||||
|
||||
# Shared, Release, Threads OFF
|
||||
- build: 2
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'OFF'
|
||||
compiler-desc: msvc17.5
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2023
|
||||
exclude-tests: ''
|
||||
osver: 2022
|
||||
|
||||
# Static, Release
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc17.5
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2023
|
||||
exclude-tests: ''
|
||||
osver: 2022
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2022 - C++17 - Windows 2019 runner - MSVC 2019 (16.11)
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 4
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc16.11
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2022
|
||||
exclude-tests: ''
|
||||
osver: 2019
|
||||
|
||||
# Static, Release
|
||||
- build: 5
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc16.11
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2022
|
||||
exclude-tests: ''
|
||||
osver: 2019
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
mkdir _examples
|
||||
shell: bash
|
||||
## - name: Install Dependences
|
||||
## run: |
|
||||
## share/ci/scripts/windows/install_python.ps1 ${{ matrix.python-version }} $HOME
|
||||
## share/ci/scripts/windows/install_boost.ps1 ${{ matrix.boost-version }} $HOME 3.8
|
||||
## share/ci/scripts/windows/install_zlib.ps1 ${{ matrix.zlib-version }} $HOME
|
||||
## shell: powershell
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOPENEXR_INSTALL_TOOLS='ON' \
|
||||
-DOPENEXR_INSTALL_DOCS='OFF' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF'
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
## - name: Examples
|
||||
## run: |
|
||||
## # Make sure we can build the examples when configured as a
|
||||
## # standalone application linking against the just-installed
|
||||
## # OpenEXR library.
|
||||
## cmake ../src/examples \
|
||||
## -DCMAKE_PREFIX_PATH=../../_install \
|
||||
## -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
## -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
## -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
|
||||
## cmake --build . \
|
||||
## --config ${{ matrix.build-type }}
|
||||
## # Confirm the examples program runs
|
||||
## ./bin/OpenEXRExamples
|
||||
## shell: bash
|
||||
## working-directory: _examples
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test ${{ matrix.exclude-tests }} \
|
||||
-C ${{ matrix.build-type }} \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
name: OSS-Fuzz
|
||||
|
||||
# Skip the run on *.md changes and on changes to the website.
|
||||
# Also, no need to run on changes to the bazel setup.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- '!bazel/**'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- '!bazel/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
id: build
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'openexr'
|
||||
dry-run: false
|
||||
language: c++
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'openexr'
|
||||
fuzz-seconds: 300
|
||||
dry-run: false
|
||||
language: c++
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: artifacts
|
||||
path: ./out/artifacts
|
||||
@@ -1,82 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
|
||||
name: Python wheels
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
name: Build Python wheels
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-22.04, windows-latest, macOS-latest]
|
||||
env:
|
||||
# Skip 32-bit wheels builds.
|
||||
# Also skip the PyPy builds, since they fail the unittests
|
||||
CIBW_SKIP: "*-win32 *_i686 pp*"
|
||||
CIBW_BEFORE_BUILD: >
|
||||
echo "Installing OpenEXR..." &&
|
||||
cd openexr.build &&
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../openexr.install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_PREFIX_PATH=../openexr.install -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -DOPENEXR_INSTALL_EXAMPLES=OFF -DOPENEXR_BUILD_TOOLS=OFF -DBUILD_SHARED_LIBS=OFF -DOPENEXR_FORCE_INTERNAL_DEFLATE=ON -DOPENEXR_FORCE_INTERNAL_IMATH=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON ../ &&
|
||||
cmake --build ./ --config Release --clean-first &&
|
||||
cmake --install ./ --config Release &&
|
||||
cd ..
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: pytest {project}/src/wrappers/python/tests/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Used to host cibuildwheel
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install cibuildwheel
|
||||
run: python -m pip install cibuildwheel==2.8.1
|
||||
|
||||
- name: Create setup.py
|
||||
run: |
|
||||
mv ${{github.workspace}}/src/wrappers/python/setup.py ${{github.workspace}}/setup.py
|
||||
mv ${{github.workspace}}/src/wrappers/python/Imath.py ${{github.workspace}}/Imath.py
|
||||
mv ${{github.workspace}}/src/wrappers/python/OpenEXR.cpp ${{github.workspace}}/OpenEXR.cpp
|
||||
|
||||
- name: Create folders
|
||||
run: |
|
||||
mkdir -p ${{github.workspace}}/openexr.build
|
||||
mkdir -p ${{github.workspace}}/openexr.install
|
||||
|
||||
- name: Build wheels
|
||||
run: python -m cibuildwheel --output-dir wheelhouse
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "Python wheels"
|
||||
path: ./wheelhouse/*.whl
|
||||
@@ -1,64 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: Website
|
||||
|
||||
# Run only on changes in the "website" directory.
|
||||
# Skip the release branches, since the website is built from main.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:-ignore:
|
||||
- RB-2.*
|
||||
- RB-3.*
|
||||
paths:
|
||||
- 'website/**'
|
||||
|
||||
pull_request:
|
||||
branches:-ignore:
|
||||
- RB-2.*
|
||||
- RB-3.*
|
||||
paths:
|
||||
- 'website/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
Website:
|
||||
|
||||
# Build the website, using a process that mimics the readthedoc build.
|
||||
#
|
||||
# Note that this job does not actually build OpenEXR libraries or
|
||||
# programs, it just runs doxygen, sphinx, and the
|
||||
# website/script/test_images.py script to generate the "Test Images"
|
||||
# page.
|
||||
|
||||
name: 'Website'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directory
|
||||
run: mkdir _build
|
||||
- name: Install doxygen & imagemagick
|
||||
# Need imagemagick for convert, to convert "Test Image" exrs to jpgs
|
||||
# Need openexr for exrheader
|
||||
run: sudo apt-get install -y doxygen imagemagick openexr
|
||||
- name: Install sphinx requirements
|
||||
run: pip3 install -r website/requirements.txt
|
||||
- name: Configure
|
||||
run: cmake .. -DBUILD_WEBSITE='ON'
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target website \
|
||||
--config Release
|
||||
working-directory: _build
|
||||
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
Makefile
|
||||
Makefile.in
|
||||
autom4te.cache
|
||||
config.guess
|
||||
config.sub
|
||||
config.status
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
ltmain.sh
|
||||
missing
|
||||
test-driver
|
||||
libtool
|
||||
compile
|
||||
stamp-h1
|
||||
stamp-h2
|
||||
IlmBase/config/IlmBaseConfigInternal.h
|
||||
IlmBase/HalfTest/HalfTest
|
||||
IlmBase/IexTest/IexTest
|
||||
IlmBase/ImathTest/ImathTest
|
||||
PyIlmBase/config/PyIlmBaseConfigInternal.h
|
||||
PyIlmBase/config/PyIlmBaseConfig.h
|
||||
PyIlmBase/PyIlmBase.pc
|
||||
PyIlmBase/PyIexTest/pyIexTest
|
||||
PyIlmBase/PyImathNumpyTest/pyImathNumpyTest
|
||||
PyIlmBase/PyImathTest/pyImathTest
|
||||
OpenEXR/config/OpenEXRConfigInternal.h
|
||||
OpenEXR/IlmImfTest/IlmImfTest
|
||||
OpenEXR/IlmImfUtilTest/IlmImfUtilTest
|
||||
OpenEXR/IlmImfFuzzTest/IlmImfFuzzTest
|
||||
Contrib/DtexToExr/DtexToExr
|
||||
.deps
|
||||
*.o
|
||||
*.lo
|
||||
*.deps
|
||||
*.libs
|
||||
*.Plo
|
||||
*.Po
|
||||
*.la
|
||||
*.so
|
||||
*.dylib
|
||||
*.m4
|
||||
*.log
|
||||
*.trs
|
||||
*.project
|
||||
*.cproject
|
||||
.DS_Store
|
||||
abi_check
|
||||
build/
|
||||
build-win/
|
||||
build-nuget/
|
||||
*~
|
||||
.vscode
|
||||
docs/_test_images/
|
||||
|
||||
# Ignore Bazel generated files
|
||||
bazel-*
|
||||
@@ -1,28 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
# .readthedocs.yml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: "ubuntu-22.04"
|
||||
tools:
|
||||
python: "3.9"
|
||||
apt_packages:
|
||||
- wget # for test images
|
||||
- imagemagick # for convert, for test images
|
||||
- openexr # for exrheader, for test images
|
||||
jobs:
|
||||
pre_build:
|
||||
- python website/scripts/test_images.py
|
||||
|
||||
sphinx:
|
||||
configuration: website/conf.py
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: website/requirements.txt
|
||||
@@ -1,282 +0,0 @@
|
||||
|
||||
# Technical Charter (the “Charter”) for OpenEXR a Series of LF Projects, LLC
|
||||
|
||||
### Adopted May 1, 2019
|
||||
|
||||
This charter (the “Charter”) sets forth the responsibilities and
|
||||
procedures for technical contribution to, and oversight of, the
|
||||
**OpenEXR Project**, which has been established as **OpenEXR a Series
|
||||
of LF Projects, LLC** (the “Project”). LF Projects, LLC (“LF Projects”)
|
||||
is a Delaware series limited liability company. All Contributors to
|
||||
the Project must comply with the terms of this Charter.
|
||||
|
||||
### 1. Mission and Scope of the Project
|
||||
|
||||
* **a.** The mission of the Project is to continue maintenance and
|
||||
development of an open source project with the goals indicated in
|
||||
the “README” file within the Project’s code repository.
|
||||
|
||||
* **b.** The scope of the Project includes using existing OpenEXR
|
||||
repositories to seed the Project, and software development under
|
||||
an OSI-approved open source license supporting the mission,
|
||||
including documentation, testing, integration and the creation of
|
||||
other artifacts that aid the development, deployment, operation or
|
||||
adoption of the open source software project.
|
||||
|
||||
### 2. Technical Steering Committee
|
||||
|
||||
* **a.** The Technical Steering Committee (the “TSC”) will be
|
||||
responsible for all technical oversight of the open source
|
||||
Project.
|
||||
|
||||
* **b.** The TSC voting members shall be as set forth within the
|
||||
“CONTRIBUTING” file within the Project’s code repository. A voting
|
||||
member of the TSC may nominate a successor in the event that such
|
||||
voting member decides to leave the TSC, and the TSC, including the
|
||||
departing member, shall confirm or reject such nomination by a
|
||||
vote. In the event that the departing member’s nomination for
|
||||
successor is rejected by vote of the TSC, the departing member
|
||||
shall be entitled to continue nominating successors until one such
|
||||
successor is confirmed by vote of the TSC. If the departing
|
||||
member fails or is unable to nominate a successor, the TSC may
|
||||
nominate one on the departing member’s behalf. The TSC may also
|
||||
determine if and how additional voting members of the TSC are
|
||||
chosen, and any such approach will be documented in the
|
||||
CONTRIBUTING file, provided that such approach does not conflict
|
||||
with this Charter. Any meetings of the TSC are intended to be open
|
||||
to the public, except where there is a reasonable need for
|
||||
privacy, and can be conducted electronically, via teleconference,
|
||||
or in person.
|
||||
|
||||
* **c.** TSC projects generally will involve Contributors and
|
||||
Committers. The TSC may adopt or modify roles so long as the roles
|
||||
are documented in the CONTRIBUTING file. Unless otherwise
|
||||
documented:
|
||||
|
||||
- **i.** Contributors include anyone in the technical community
|
||||
that contributes code, documentation, or other technical
|
||||
artifacts to the Project;
|
||||
|
||||
- **ii.** Committers are Contributors who have earned the ability
|
||||
to modify (“commit”) source code, documentation or other
|
||||
technical artifacts in a project’s repository; and
|
||||
|
||||
- **iii.** A Contributor may become a Committer by a majority
|
||||
approval of the existing Committers or at the discretion of the
|
||||
TSC. A Committer may be removed by a majority approval of the
|
||||
other existing Committers, or at the discretion of the TSC.
|
||||
|
||||
* **d.** Participation in the Project through becoming a Contributor
|
||||
and Committer is open to anyone so long as they abide by the terms
|
||||
of this Charter.
|
||||
|
||||
* **e.** The TSC may (1) establish workflow procedures for the
|
||||
submission, approval, and closure/archiving of projects, (2) set
|
||||
requirements for the promotion of Contributors to Committer
|
||||
status, as applicable, and (3) amend, adjust, refine and/or
|
||||
eliminate the roles of Contributors, and Committers, and create
|
||||
new roles, and publicly document any TSC roles, as it sees fit.
|
||||
|
||||
* **f.** The TSC may elect a TSC Chair, who will preside over
|
||||
meetings of the TSC and will serve until his or her resignation or
|
||||
replacement by the TSC. The TSC Chair, or any other TSC member so
|
||||
designated by the TSC, will serve as the primary communication
|
||||
contact between the Project and the Academy Software Foundation
|
||||
Fund of The Linux Foundation.
|
||||
|
||||
* **g.** Responsibilities: The TSC will be responsible for all
|
||||
aspects of oversight relating to the Project, which may include:
|
||||
|
||||
- **i.** coordinating the technical direction of the Project;
|
||||
|
||||
- **ii.** approving project or system proposals (including, but
|
||||
not limited to, incubation, deprecation, and changes to a
|
||||
sub-project’s scope);
|
||||
|
||||
- **iii.** organizing sub-projects and removing projects;
|
||||
|
||||
- **iv.** creating sub-committees or working groups to focus on
|
||||
cross-project technical issues and requirements;
|
||||
|
||||
- **v.** appointing representatives to work with other open source
|
||||
or open standards communities;
|
||||
|
||||
- **vi.** establishing community norms, workflows, issuing
|
||||
releases, and security issue reporting policies;
|
||||
|
||||
- **vii.** approving and implementing policies and processes for
|
||||
contributing (to be published in the CONTRIBUTING file) and
|
||||
coordinating with the Series Manager to resolve matters or
|
||||
concerns that may arise as set forth in Section 7 of this
|
||||
Charter;
|
||||
|
||||
- **viii.** discussions, seeking consensus, and where necessary,
|
||||
voting on technical matters relating to the code base that
|
||||
affect multiple projects; and
|
||||
|
||||
- **ix.** coordinating any marketing, events, or communications
|
||||
regarding the Project with the LF Projects Manager or their
|
||||
designee.
|
||||
|
||||
### 3. TSC Voting
|
||||
|
||||
* **a.** While the Project aims to operate as a consensus based
|
||||
community, if any TSC decision requires a vote to move the Project
|
||||
forward, the voting members of the TSC will vote on a one vote per
|
||||
voting member basis.
|
||||
|
||||
* **b.** At least fifty percent of all voting members of the TSC
|
||||
must be present at a TSC meeting in order to establish a
|
||||
quorum. The TSC may continue to meet if a quorum is not met, but
|
||||
will be prevented from making any decisions at such meeting.
|
||||
|
||||
* **c.** Except as provided in Section 7.c. and 8.a, decisions by
|
||||
vote at a meeting require a majority vote of those in attendance,
|
||||
provided quorum is met. Decisions made by electronic vote without
|
||||
a meeting require a majority vote of all voting members of the
|
||||
TSC.
|
||||
|
||||
* **d.** In the event a vote cannot be resolved by the TSC, any
|
||||
voting member of the TSC may refer the matter to the Series
|
||||
Manager or its designee for assistance in reaching a resolution.
|
||||
|
||||
### 4. Compliance with Policies
|
||||
|
||||
* **a.** This Charter is subject to the Series Agreement for the
|
||||
Project and the Operating Agreement of LF Projects. Contributors
|
||||
will comply with the policies of LF Projects as may be adopted and
|
||||
amended by LF Projects, including, without limitation the policies
|
||||
listed at https://lfprojects.org/policies/.
|
||||
|
||||
* **b.** The TSC may adopt a code of conduct (“CoC”) for the
|
||||
Project, which is subject to approval by the Series Manager.
|
||||
Contributors to the Project will comply with the CoC or, in the
|
||||
event that a Project-specific CoC has not been approved, the LF
|
||||
Projects Code of Conduct listed at
|
||||
https://lfprojects.org/policies/.
|
||||
|
||||
* **c.** When amending or adopting any policy applicable to the
|
||||
Project, LF Projects will publish such policy, as to be amended or
|
||||
adopted, on its web site at least 30 days prior to such policy
|
||||
taking effect; provided, however, that in the case of any
|
||||
amendment of the Trademark Policy or Terms of Use of LF Projects,
|
||||
any such amendment is effective upon publication on LF Project’s
|
||||
web site.
|
||||
|
||||
* **d.** All participants must allow open participation from any
|
||||
individual or organization meeting the requirements for
|
||||
contributing under this Charter and any policies adopted for all
|
||||
participants by the TSC, regardless of competitive interests. Put
|
||||
another way, the Project community must not seek to exclude any
|
||||
participant based on any criteria, requirement, or reason other
|
||||
than those that are reasonable and applied on a non-discriminatory
|
||||
basis to all participants in the Project community.
|
||||
|
||||
* **e.** The Project will operate in a transparent, open,
|
||||
collaborative, and ethical manner at all times. The output of all
|
||||
Project discussions, proposals, timelines, decisions, and status
|
||||
should be made open and easily visible to all. Any potential
|
||||
violations of this requirement should be reported immediately to
|
||||
the LF Projects Manager.
|
||||
|
||||
### 5. Community Assets
|
||||
|
||||
* **a.** LF Projects will hold title to all trade or service marks
|
||||
used by the Project (“Project Trademarks”), whether based on
|
||||
common law or registered rights. Project Trademarks will be
|
||||
transferred and assigned to LF Projects to hold on behalf of the
|
||||
Project. Any use of any Project Trademarks by participants in the
|
||||
Project will be in accordance with the license from LF Projects
|
||||
and inure to the benefit of LF Projects.
|
||||
|
||||
* **b.** The Project shall, as permitted and in accordance with such
|
||||
license from LF Projects, develop and own all Project GitHub and
|
||||
social media accounts, and domain name registrations created by
|
||||
the Project community.
|
||||
|
||||
* **c.** Under no circumstances will LF Projects be expected or
|
||||
required to undertake any action on behalf of the Project that is
|
||||
inconsistent with the tax-exempt status or purpose, as applicable,
|
||||
of LFP, Inc. or LF Projects, LLC.
|
||||
|
||||
### 6. General Rules and Operations.
|
||||
|
||||
* **a.** The Project will:
|
||||
|
||||
- **i.** engage in the work of the project in a professional
|
||||
manner consistent with maintaining a cohesive community, while
|
||||
also maintaining the goodwill and esteem of LF Projects, LFP,
|
||||
Inc. and other partner organizations in the open source software
|
||||
community; and
|
||||
|
||||
- **ii.** respect the rights of all trademark owners, including
|
||||
any branding and trademark usage guidelines.
|
||||
|
||||
### 7. Intellectual Property Policy
|
||||
|
||||
* **a.** Participants acknowledge that the copyright in all new
|
||||
contributions shall be retained by the copyright holder as
|
||||
independent works of authorship and that no contributor or
|
||||
copyright holder will be required to assign copyrights to the
|
||||
Project.
|
||||
|
||||
* **b.** Except as described in Section 7.c., all code contributions
|
||||
to the Project are subject to the following:
|
||||
|
||||
- **i.** All new inbound code contributions to the Project must be
|
||||
made using an OSI-approved open source license specified for the
|
||||
Project within the “LICENSE” file within the Project’s code
|
||||
repository (the “Project License”).
|
||||
|
||||
- **ii.** All new inbound code contributions must:
|
||||
|
||||
o **1.** Be made pursuant to a binding Project Contribution License
|
||||
Agreement (the “CLA”) available on the Project’s web site; and
|
||||
|
||||
o **2.** be accompanied by a Developer Certificate of Origin
|
||||
([http://developercertificate.org](http://developercertificate.org))
|
||||
sign-off in the source code system that is submitted through a
|
||||
TSC-approved contribution process which will bind the
|
||||
authorized contributor and, if not self-employed, their
|
||||
employer to the applicable license;
|
||||
|
||||
- **iii.** All outbound code will be made available under the
|
||||
Project License.
|
||||
|
||||
- **iv.** Documentation will be received and made available by the
|
||||
Project under the Creative Commons Attribution 4.0 International
|
||||
License (available at
|
||||
[http://creativecommons.org/licenses/by/4.0/](http://creativecommons.org/licenses/by/4.0/)).
|
||||
|
||||
- **v.** The Project may seek to integrate and contribute back to
|
||||
other open source projects (“Upstream Projects”). In such cases,
|
||||
the Project will conform to all license requirements of the
|
||||
Upstream Projects, including dependencies, leveraged by the
|
||||
Project. Upstream Project code contributions not stored within
|
||||
the Project’s main code repository shall comply with the
|
||||
contribution process and license terms for the applicable
|
||||
Upstream Project.
|
||||
|
||||
* **c.** If an alternative inbound or outbound license is required
|
||||
for compliance with the license for a leveraged open source
|
||||
project or is otherwise required to achieve the Project’s mission,
|
||||
the Governing Board of the Academy Software Foundation Fund of the
|
||||
Linux Foundation (“Governing Board”), or the Governing Board’s
|
||||
representatives designated for such purpose, may approve the use
|
||||
of an alternative license for specific inbound or outbound
|
||||
contributions on an exception basis. Any exceptions must be
|
||||
approved by a vote of the Governing Board and must be limited in
|
||||
scope to what is required for such a purpose. To request an
|
||||
exception, please describe the contribution, the alternative open
|
||||
source license(s), and the justification for using an alternative
|
||||
open source license for the Project.
|
||||
|
||||
* **d.** Contributed files should contain license information, such
|
||||
as SPDX short form identifiers, indicating the open source license
|
||||
or licenses pertaining to the file.
|
||||
|
||||
### 8. Amendments
|
||||
|
||||
* **a.** This charter may be amended by a two-thirds vote of the
|
||||
entire TSC, subject to reasonable approval by LF Projects.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,141 +0,0 @@
|
||||
# OpenEXR Adoption Proposal
|
||||
|
||||
|
||||
## ASWF TAC Meeting - April 10th, 2019
|
||||
|
||||
|
||||
# Overview
|
||||
|
||||
|
||||
|
||||
1. Project Contribution Proposal
|
||||
2. Incubation Stage Requirements
|
||||
3. Adopted Stage Requirements
|
||||
4. Additional Discussion Topics
|
||||
1. Near-Term Development Roadmap
|
||||
2. Community Discussion at SIGGRAPH 2018
|
||||
3. Technical Steering Committee
|
||||
|
||||
|
||||
# Project Contribution Proposal
|
||||
|
||||
The following is an overview of the Project Contribution Proposal for OpenEXR:
|
||||
|
||||
|
||||
|
||||
* Name of the project:
|
||||
* OpenEXR
|
||||
* Requested project maturity level:
|
||||
* Incubation (initially proposed as Adopted)
|
||||
* Project description:
|
||||
* OpenEXR is a high dynamic-range image file format developed by Industrial Light & Magic (ILM) for use in computer imaging applications. OpenEXR was created by ILM in 1999 and released to the public in 2003 as an open-source library.
|
||||
* Please explain how this project is aligned with the mission of ASWF?
|
||||
* OpenEXR is one of the foundational technologies in computer imaging, and it remains a standard HDR image format in computer graphics for linear and interactive media. OpenEXR was honored with an Academy Award for Technical Achievement in 2007.
|
||||
* What is the project’s license for code contributions?
|
||||
* OpenEXR is shared under a modified BSD license (http://www.openexr.com/license.html), and its license agreements for individual and corporate code contributions may be found at [http://www.openexr.com/documentation.html](http://www.openexr.com/documentation.html).
|
||||
* What tool or platform is utilized for source control, and what is the location?
|
||||
* OpenEXR uses GitHub for source control, and its repository is currently located at [https://github.com/openexr/openexr](https://github.com/openexr/openexr).
|
||||
* What are the external dependencies of the project, and what are the licenses of those dependencies?
|
||||
* The mandatory dependency of OpenEXR and its license is:
|
||||
* Zlib ([http://zlib.net/zlib_license.html](http://zlib.net/zlib_license.html))
|
||||
* The optional dependencies of OpenEXR and their licenses are:
|
||||
* Boost ([https://www.boost.org/users/license.html](https://www.boost.org/users/license.html))
|
||||
* NumPy ([http://www.numpy.org/license.html](http://www.numpy.org/license.html))
|
||||
* Fltk ([https://www.fltk.org/COPYING.php](https://www.fltk.org/COPYING.php))
|
||||
* Cg ([http://developer.download.nvidia.com/cg/Cg_2.2/license.pdf](http://developer.download.nvidia.com/cg/Cg_2.2/license.pdf))
|
||||
* What roles does the project have (e.g. maintainers, committers?) Who are the current core committers of the project, or where can a list of committers be found?
|
||||
* Recent contributors to the OpenEXR project include Cary Phillips, Nick Rasmussen, Kimball Thurston and Nick Porcino, and a complete list of current maintainers can be found at [https://github.com/orgs/openexr/people](https://github.com/orgs/openexr/people).
|
||||
* What mailing lists are currently used by the project?
|
||||
* OpenEXR has three mailing lists: openexr-announce, openexr-user, and openexr-devel.
|
||||
* [https://lists.nongnu.org/mailman/listinfo/openexr-announce](https://lists.nongnu.org/mailman/listinfo/openexr-announce)
|
||||
* [https://lists.nongnu.org/mailman/listinfo/openexr-user](https://lists.nongnu.org/mailman/listinfo/openexr-user)
|
||||
* [https://lists.nongnu.org/mailman/listinfo/openexr-devel](https://lists.nongnu.org/mailman/listinfo/openexr-devel)
|
||||
* What tool or platform is leveraged by the project for issue tracking?
|
||||
* Issue tracking for OpenEXR is handled through its GitHub repository:
|
||||
|
||||
[https://github.com/openexr/openexr](https://github.com/openexr/openexr)
|
||||
|
||||
* Does the project have a Core Infrastructure Initiative security best practices badge? Do you foresee any challenges obtaining one?
|
||||
* OpenEXR does not yet have a CII badge, but it should be straightforward for it to meet the criteria of this program in the future.
|
||||
* What is the project’s website? Is there a wiki?
|
||||
* The website for OpenEXR is [http://www.openexr.com](http://www.openexr.com), and there is no official wiki.
|
||||
* What social media accounts are used by the project?
|
||||
* OpenEXR does not have any official social media accounts.
|
||||
* What is the project’s release methodology and cadence?
|
||||
* New releases of OpenEXR are organized on an as-needed basis, and do not currently follow a regular cadence.
|
||||
* Are any trademarks, registered or unregistered, leveraged by the project? Have any trademark registrations been filed by the project or any third party anywhere in the world?
|
||||
* OpenEXR is an unregistered trademark of Lucasfilm Ltd.
|
||||
|
||||
|
||||
# Incubation Stage Requirements
|
||||
|
||||
The following are the entry requirements for an Incubation stage project of the ASWF, which we believe are currently met by the OpenEXR project:
|
||||
|
||||
|
||||
|
||||
* Submit a completed Project Contribution Proposal Template to the TAC, or the TAC’s designated recipient for contribution proposals.
|
||||
* Provide such additional information as the TAC may reasonably request.
|
||||
* Be available to present to the TAC with respect to the project’s proposal and inclusion in ASWF. Project teams should be prepared to present a detailed (20-30 minutes in length) overview on the project in addition to speaking to the information contained in the project contribution proposal.
|
||||
* Be deemed by the TAC to add value to the mission of ASWF.
|
||||
* Have a technical charter that provides for inbound and outbound licensing of code under an OSI-approved license approved by the Governing Board of ASWF for projects. The ASWF maintains a template for projects to use.
|
||||
* Agree to transfer any relevant trademarks to an LF entity to hold for the project. In the case of projects with established trademarks where a trademark transfer is commercially difficult, we generally recommend the project use a new name upon incubation.
|
||||
|
||||
|
||||
# Adopted Stage Requirements
|
||||
|
||||
The following are the entry requirements for an Adopted stage project of the ASWF, along with the status of OpenEXR with respect to these goals:
|
||||
|
||||
|
||||
|
||||
* Demonstrate having a healthy number of committers from a diverse contributor base. A committer is defined in the technical charter but is often used to describe the core contributors who can accept contributions to the project, or a portion thereof.
|
||||
* The OpenEXR project on GitHub currently has 39 contributors, including significant contributions from Lucasfilm, DreamWorks Animation, and Weta Digital, and we expect the number of contributing individuals and companies to increase under the ASWF.
|
||||
* Have achieved and maintained a Core Infrastructure Initiative Best Practices Badge.
|
||||
* Not yet
|
||||
* Demonstrate a substantial ongoing flow of commits and merged contributions.
|
||||
* The OpenEXR project on GitHub has 1,279 commits over its lifetime, and we expect the rate of new commits to increase once the project is under the ASWF.
|
||||
* Document current project owners and current and emeritus committers in a COMMITTER file or similarly visible system. A copy of the project’s charter (or other authorized governance document) will be included or linked to in visible location.
|
||||
* Not yet
|
||||
* Have a technical lead appointed for representation of the project to the TAC.
|
||||
* Not yet
|
||||
* Have a completed and presented to the TAC an initial license scan of the project’s codebase.
|
||||
* Not yet
|
||||
|
||||
|
||||
# Additional Discussion Topics
|
||||
|
||||
|
||||
## Near-Term Development Roadmap
|
||||
|
||||
|
||||
|
||||
* Robust builds, installation, and tests on all platforms, using the CMake build infrastructure. Builds should be warning-free on all modern compilers.
|
||||
* Automated building and testing of new pull requests using one or more CI solutions (e.g. CircleCI, Azure Pipelines, Travis, Appveyor, Jenkins).
|
||||
* Evaluating and merging existing pull requests from the community (23 open pull requests).
|
||||
* Evaluating and addressing existing issues from the community (122 open issues).
|
||||
* Establishing guidance for reporting new security issues (e.g. a private channel).
|
||||
* Discuss moving IlmBase into its own Git submodule.
|
||||
* Discuss creating a lightweight, shared library for vector/matrix functionality.
|
||||
|
||||
|
||||
## Community Discussion at SIGGRAPH 2018
|
||||
|
||||
The following additional ideas were suggested by the OpenEXR community at the Birds of a Feather event at SIGGRAPH 2018:
|
||||
|
||||
|
||||
|
||||
* Simple and fast write path (along the lines of TinyEXR)
|
||||
* Integer image support (reducing the need for TIFF)
|
||||
* Standalone LibHalf library (and reconciliation with CUDA half type)
|
||||
* GPU decompression for performance (potentially supporting only a subset of formats)
|
||||
* Metadata standardization
|
||||
|
||||
|
||||
## Technical Steering Committee
|
||||
|
||||
The initial members of the Technical Steering Committee for OpenEXR will be Larry Gritz (SPI), Rod Bogart (Epic), Peter Hillman (Weta), and Jonathan Stone (Lucasfilm).
|
||||
|
||||
In addition, we believe it would be valuable to nominate a small set of core committers, including recent contributors to OpenEXR, who would have push access to the new repository.
|
||||
|
||||
|
||||
<!-- Docs to Markdown version 1.0β17 -->
|
||||
|
||||
-562
@@ -1,562 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
|
||||
|
||||
config_setting(
|
||||
name = "windows",
|
||||
constraint_values = ["@platforms//os:windows"],
|
||||
)
|
||||
|
||||
expand_template(
|
||||
name = "IexConfig",
|
||||
out = "src/lib/Iex/IexConfig.h",
|
||||
substitutions = {
|
||||
"@IEX_INTERNAL_NAMESPACE@": "Iex_3_2",
|
||||
"@IEX_NAMESPACE_CUSTOM@": "0",
|
||||
"@IEX_NAMESPACE@": "Iex",
|
||||
},
|
||||
template = "cmake/IexConfig.h.in",
|
||||
)
|
||||
|
||||
expand_template(
|
||||
name = "IexConfigInternal",
|
||||
out = "src/lib/Iex/IexConfigInternal.h",
|
||||
substitutions = {
|
||||
"#cmakedefine HAVE_UCONTEXT_H 1": "/* #undef HAVE_UCONTEXT_H */",
|
||||
"#cmakedefine IEX_HAVE_CONTROL_REGISTER_SUPPORT 1": "/* #undef IEX_HAVE_CONTROL_REGISTER_SUPPORT */",
|
||||
"#cmakedefine IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT 1": "/* #undef IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT */",
|
||||
},
|
||||
template = "cmake/IexConfigInternal.h.in",
|
||||
)
|
||||
|
||||
expand_template(
|
||||
name = "IlmThreadConfig",
|
||||
out = "src/lib/IlmThread/IlmThreadConfig.h",
|
||||
substitutions = {
|
||||
"@ILMTHREAD_INTERNAL_NAMESPACE@": "IlmThread_3_2",
|
||||
"@ILMTHREAD_NAMESPACE_CUSTOM@": "0",
|
||||
"@ILMTHREAD_NAMESPACE@": "IlmThread",
|
||||
"#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES": "#define ILMTHREAD_HAVE_POSIX_SEMAPHORES 0",
|
||||
"#cmakedefine01 ILMTHREAD_THREADING_ENABLED": "#define ILMTHREAD_THREADING_ENABLED 1",
|
||||
},
|
||||
template = "cmake/IlmThreadConfig.h.in",
|
||||
)
|
||||
|
||||
expand_template(
|
||||
name = "OpenEXRConfig",
|
||||
out = "src/lib/OpenEXR/OpenEXRConfig.h",
|
||||
substitutions = {
|
||||
"@OPENEXR_IMF_NAMESPACE@": "Imf",
|
||||
"@OPENEXR_INTERNAL_IMF_NAMESPACE@": "Imf_3_2",
|
||||
"@OPENEXR_LIB_VERSION@": "3.2.0",
|
||||
"@OPENEXR_NAMESPACE_CUSTOM@": "3.2.0",
|
||||
"@OPENEXR_PACKAGE_NAME@": "OpenEXR 3.2.0",
|
||||
"@OPENEXR_VERSION_EXTRA@": "",
|
||||
"@OPENEXR_VERSION@": "3.2.0",
|
||||
"@OPENEXR_VERSION_MAJOR@": "3",
|
||||
"@OPENEXR_VERSION_MINOR@": "2",
|
||||
"@OPENEXR_VERSION_PATCH@": "0",
|
||||
"#cmakedefine OPENEXR_ENABLE_API_VISIBILITY": "#define OPENEXR_ENABLE_API_VISIBILITY",
|
||||
"#cmakedefine OPENEXR_HAVE_LARGE_STACK 1": "/* #undef OPENEXR_HAVE_LARGE_STACK */",
|
||||
},
|
||||
template = "cmake/OpenEXRConfig.h.in",
|
||||
)
|
||||
|
||||
expand_template(
|
||||
name = "OpenEXRConfigInternal",
|
||||
out = "src/lib/OpenEXR/OpenEXRConfigInternal.h",
|
||||
substitutions = {
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_COMPLETE_IOMANIP 1": "#define OPENEXR_IMF_HAVE_COMPLETE_IOMANIP 1",
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_DARWIN 1": "/* #undef OPENEXR_IMF_HAVE_DARWIN */",
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX 1": "/* #undef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX */",
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_LINUX_PROCFS 1": "/* #undef OPENEXR_IMF_HAVE_LINUX_PROCFS */",
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN 1": "/* #undef OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN */",
|
||||
"#cmakedefine OPENEXR_MISSING_ARM_VLD1 0": "/* #undef OPENEXR_MISSING_ARM_VLD1 */",
|
||||
},
|
||||
template = "cmake/OpenEXRConfigInternal.h.in",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "Iex",
|
||||
srcs = [
|
||||
"src/lib/Iex/IexBaseExc.cpp",
|
||||
"src/lib/Iex/IexMathFloatExc.cpp",
|
||||
"src/lib/Iex/IexMathFpu.cpp",
|
||||
"src/lib/Iex/IexThrowErrnoExc.cpp",
|
||||
"src/lib/OpenEXRCore/openexr_version.h",
|
||||
],
|
||||
hdrs = [
|
||||
"src/lib/Iex/Iex.h",
|
||||
"src/lib/Iex/IexBaseExc.h",
|
||||
"src/lib/Iex/IexConfig.h",
|
||||
"src/lib/Iex/IexConfigInternal.h",
|
||||
"src/lib/Iex/IexErrnoExc.h",
|
||||
"src/lib/Iex/IexExport.h",
|
||||
"src/lib/Iex/IexForward.h",
|
||||
"src/lib/Iex/IexMacros.h",
|
||||
"src/lib/Iex/IexMathExc.h",
|
||||
"src/lib/Iex/IexMathFloatExc.h",
|
||||
"src/lib/Iex/IexMathFpu.h",
|
||||
"src/lib/Iex/IexMathIeeeExc.h",
|
||||
"src/lib/Iex/IexNamespace.h",
|
||||
"src/lib/Iex/IexThrowErrnoExc.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfig.h",
|
||||
],
|
||||
features = select({
|
||||
":windows": ["windows_export_all_symbols"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = [
|
||||
"src/lib/Iex",
|
||||
"src/lib/OpenEXR",
|
||||
"src/lib/OpenEXRCore",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "IlmThread",
|
||||
srcs = [
|
||||
"src/lib/IlmThread/IlmThread.cpp",
|
||||
"src/lib/IlmThread/IlmThreadPool.cpp",
|
||||
"src/lib/IlmThread/IlmThreadSemaphore.cpp",
|
||||
"src/lib/IlmThread/IlmThreadSemaphoreOSX.cpp",
|
||||
"src/lib/IlmThread/IlmThreadSemaphorePosix.cpp",
|
||||
"src/lib/IlmThread/IlmThreadSemaphorePosixCompat.cpp",
|
||||
"src/lib/IlmThread/IlmThreadSemaphoreWin32.cpp",
|
||||
"src/lib/OpenEXRCore/openexr_version.h",
|
||||
],
|
||||
hdrs = [
|
||||
"src/lib/IlmThread/IlmThread.h",
|
||||
"src/lib/IlmThread/IlmThreadConfig.h",
|
||||
"src/lib/IlmThread/IlmThreadExport.h",
|
||||
"src/lib/IlmThread/IlmThreadForward.h",
|
||||
"src/lib/IlmThread/IlmThreadMutex.h",
|
||||
"src/lib/IlmThread/IlmThreadNamespace.h",
|
||||
"src/lib/IlmThread/IlmThreadPool.h",
|
||||
"src/lib/IlmThread/IlmThreadSemaphore.h",
|
||||
],
|
||||
features = select({
|
||||
":windows": ["windows_export_all_symbols"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = [
|
||||
"src/lib/IlmThread",
|
||||
"src/lib/OpenEXRCore",
|
||||
],
|
||||
deps = [":Iex"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "OpenEXRCore",
|
||||
srcs = [
|
||||
"src/lib/IlmThread/IlmThreadConfig.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfig.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfigInternal.h",
|
||||
"src/lib/OpenEXR/dwaLookups.h",
|
||||
"src/lib/OpenEXRCore/attributes.c",
|
||||
"src/lib/OpenEXRCore/backward_compatibility.h",
|
||||
"src/lib/OpenEXRCore/base.c",
|
||||
"src/lib/OpenEXRCore/channel_list.c",
|
||||
"src/lib/OpenEXRCore/chunk.c",
|
||||
"src/lib/OpenEXRCore/coding.c",
|
||||
"src/lib/OpenEXRCore/compression.c",
|
||||
"src/lib/OpenEXRCore/context.c",
|
||||
"src/lib/OpenEXRCore/debug.c",
|
||||
"src/lib/OpenEXRCore/decoding.c",
|
||||
"src/lib/OpenEXRCore/encoding.c",
|
||||
"src/lib/OpenEXRCore/float_vector.c",
|
||||
"src/lib/OpenEXRCore/internal_attr.h",
|
||||
"src/lib/OpenEXRCore/internal_b44.c",
|
||||
"src/lib/OpenEXRCore/internal_b44_table.c",
|
||||
"src/lib/OpenEXRCore/internal_channel_list.h",
|
||||
"src/lib/OpenEXRCore/internal_coding.h",
|
||||
"src/lib/OpenEXRCore/internal_compress.h",
|
||||
"src/lib/OpenEXRCore/internal_constants.h",
|
||||
"src/lib/OpenEXRCore/internal_cpuid.h",
|
||||
"src/lib/OpenEXRCore/internal_decompress.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa.c",
|
||||
"src/lib/OpenEXRCore/internal_dwa_channeldata.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_classifier.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_compressor.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_decoder.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_encoder.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_helpers.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_simd.h",
|
||||
"src/lib/OpenEXRCore/internal_file.h",
|
||||
"src/lib/OpenEXRCore/internal_float_vector.h",
|
||||
"src/lib/OpenEXRCore/internal_huf.c",
|
||||
"src/lib/OpenEXRCore/internal_huf.h",
|
||||
"src/lib/OpenEXRCore/internal_memory.h",
|
||||
"src/lib/OpenEXRCore/internal_opaque.h",
|
||||
"src/lib/OpenEXRCore/internal_piz.c",
|
||||
"src/lib/OpenEXRCore/internal_posix_file_impl.h",
|
||||
"src/lib/OpenEXRCore/internal_preview.h",
|
||||
"src/lib/OpenEXRCore/internal_pxr24.c",
|
||||
"src/lib/OpenEXRCore/internal_rle.c",
|
||||
"src/lib/OpenEXRCore/internal_string.h",
|
||||
"src/lib/OpenEXRCore/internal_string_vector.h",
|
||||
"src/lib/OpenEXRCore/internal_structs.c",
|
||||
"src/lib/OpenEXRCore/internal_structs.h",
|
||||
"src/lib/OpenEXRCore/internal_util.h",
|
||||
"src/lib/OpenEXRCore/internal_win32_file_impl.h",
|
||||
"src/lib/OpenEXRCore/internal_xdr.h",
|
||||
"src/lib/OpenEXRCore/internal_zip.c",
|
||||
"src/lib/OpenEXRCore/memory.c",
|
||||
"src/lib/OpenEXRCore/opaque.c",
|
||||
"src/lib/OpenEXRCore/openexr_version.h",
|
||||
"src/lib/OpenEXRCore/pack.c",
|
||||
"src/lib/OpenEXRCore/parse_header.c",
|
||||
"src/lib/OpenEXRCore/part.c",
|
||||
"src/lib/OpenEXRCore/part_attr.c",
|
||||
"src/lib/OpenEXRCore/preview.c",
|
||||
"src/lib/OpenEXRCore/std_attr.c",
|
||||
"src/lib/OpenEXRCore/string.c",
|
||||
"src/lib/OpenEXRCore/string_vector.c",
|
||||
"src/lib/OpenEXRCore/unpack.c",
|
||||
"src/lib/OpenEXRCore/validation.c",
|
||||
"src/lib/OpenEXRCore/write_header.c",
|
||||
],
|
||||
hdrs = [
|
||||
"src/lib/OpenEXRCore/openexr.h",
|
||||
"src/lib/OpenEXRCore/openexr_attr.h",
|
||||
"src/lib/OpenEXRCore/openexr_base.h",
|
||||
"src/lib/OpenEXRCore/openexr_chunkio.h",
|
||||
"src/lib/OpenEXRCore/openexr_coding.h",
|
||||
"src/lib/OpenEXRCore/openexr_compression.h",
|
||||
"src/lib/OpenEXRCore/openexr_config.h",
|
||||
"src/lib/OpenEXRCore/openexr_context.h",
|
||||
"src/lib/OpenEXRCore/openexr_debug.h",
|
||||
"src/lib/OpenEXRCore/openexr_decode.h",
|
||||
"src/lib/OpenEXRCore/openexr_encode.h",
|
||||
"src/lib/OpenEXRCore/openexr_errors.h",
|
||||
"src/lib/OpenEXRCore/openexr_part.h",
|
||||
"src/lib/OpenEXRCore/openexr_std_attr.h",
|
||||
],
|
||||
copts = select({
|
||||
":windows": [],
|
||||
"//conditions:default": [
|
||||
"-Wno-error",
|
||||
],
|
||||
}),
|
||||
features = select({
|
||||
":windows": ["windows_export_all_symbols"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = [
|
||||
"src/lib/IlmThread",
|
||||
"src/lib/OpenEXR",
|
||||
"src/lib/OpenEXRCore",
|
||||
],
|
||||
linkopts =
|
||||
select({
|
||||
":windows": [],
|
||||
"//conditions:default": [
|
||||
"-pthread",
|
||||
],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@Imath",
|
||||
"@libdeflate//:deflate",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "OpenEXR",
|
||||
srcs = [
|
||||
"src/lib/OpenEXR/ImfAcesFile.cpp",
|
||||
"src/lib/OpenEXR/ImfAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfB44Compressor.cpp",
|
||||
"src/lib/OpenEXR/ImfBoxAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfCRgbaFile.cpp",
|
||||
"src/lib/OpenEXR/ImfChannelList.cpp",
|
||||
"src/lib/OpenEXR/ImfChannelListAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfChromaticities.cpp",
|
||||
"src/lib/OpenEXR/ImfChromaticitiesAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfCompositeDeepScanLine.cpp",
|
||||
"src/lib/OpenEXR/ImfCompressionAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfCompressor.cpp",
|
||||
"src/lib/OpenEXR/ImfConvert.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepCompositing.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepFrameBuffer.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepImageStateAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineInputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineOutputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineOutputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepTiledInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepTiledInputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepTiledOutputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepTiledOutputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfDoubleAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfDwaCompressor.cpp",
|
||||
"src/lib/OpenEXR/ImfEnvmap.cpp",
|
||||
"src/lib/OpenEXR/ImfEnvmapAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfFastHuf.cpp",
|
||||
"src/lib/OpenEXR/ImfFloatAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfFloatVectorAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfFrameBuffer.cpp",
|
||||
"src/lib/OpenEXR/ImfFramesPerSecond.cpp",
|
||||
"src/lib/OpenEXR/ImfGenericInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfGenericOutputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfHeader.cpp",
|
||||
"src/lib/OpenEXR/ImfHuf.cpp",
|
||||
"src/lib/OpenEXR/ImfIDManifest.cpp",
|
||||
"src/lib/OpenEXR/ImfIDManifestAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfIO.cpp",
|
||||
"src/lib/OpenEXR/ImfInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfInputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfInputPartData.cpp",
|
||||
"src/lib/OpenEXR/ImfIntAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfKeyCode.cpp",
|
||||
"src/lib/OpenEXR/ImfKeyCodeAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfLineOrderAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfLut.cpp",
|
||||
"src/lib/OpenEXR/ImfMatrixAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfMisc.cpp",
|
||||
"src/lib/OpenEXR/ImfMultiPartInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfMultiPartOutputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfMultiView.cpp",
|
||||
"src/lib/OpenEXR/ImfOpaqueAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfOutputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfOutputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfOutputPartData.cpp",
|
||||
"src/lib/OpenEXR/ImfPartType.cpp",
|
||||
"src/lib/OpenEXR/ImfPizCompressor.cpp",
|
||||
"src/lib/OpenEXR/ImfPreviewImage.cpp",
|
||||
"src/lib/OpenEXR/ImfPreviewImageAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfPxr24Compressor.cpp",
|
||||
"src/lib/OpenEXR/ImfRational.cpp",
|
||||
"src/lib/OpenEXR/ImfRationalAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfRgbaFile.cpp",
|
||||
"src/lib/OpenEXR/ImfRgbaYca.cpp",
|
||||
"src/lib/OpenEXR/ImfRle.cpp",
|
||||
"src/lib/OpenEXR/ImfRleCompressor.cpp",
|
||||
"src/lib/OpenEXR/ImfScanLineInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfStandardAttributes.cpp",
|
||||
"src/lib/OpenEXR/ImfStdIO.cpp",
|
||||
"src/lib/OpenEXR/ImfStringAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfStringVectorAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfSystemSpecific.cpp",
|
||||
"src/lib/OpenEXR/ImfTestFile.cpp",
|
||||
"src/lib/OpenEXR/ImfThreading.cpp",
|
||||
"src/lib/OpenEXR/ImfTileDescriptionAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfTileOffsets.cpp",
|
||||
"src/lib/OpenEXR/ImfTiledInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfTiledInputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfTiledMisc.cpp",
|
||||
"src/lib/OpenEXR/ImfTiledOutputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfTiledOutputPart.cpp",
|
||||
"src/lib/OpenEXR/ImfTiledRgbaFile.cpp",
|
||||
"src/lib/OpenEXR/ImfTimeCode.cpp",
|
||||
"src/lib/OpenEXR/ImfTimeCodeAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfVecAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfVersion.cpp",
|
||||
"src/lib/OpenEXR/ImfWav.cpp",
|
||||
"src/lib/OpenEXR/ImfZip.cpp",
|
||||
"src/lib/OpenEXR/ImfZipCompressor.cpp",
|
||||
"src/lib/OpenEXR/b44ExpLogTable.h",
|
||||
"src/lib/OpenEXR/dwaLookups.h",
|
||||
],
|
||||
hdrs = [
|
||||
"src/lib/Iex/IexConfig.h",
|
||||
"src/lib/Iex/IexConfigInternal.h",
|
||||
"src/lib/IlmThread/IlmThreadConfig.h",
|
||||
"src/lib/OpenEXR/ImfAcesFile.h",
|
||||
"src/lib/OpenEXR/ImfArray.h",
|
||||
"src/lib/OpenEXR/ImfAttribute.h",
|
||||
"src/lib/OpenEXR/ImfAutoArray.h",
|
||||
"src/lib/OpenEXR/ImfB44Compressor.h",
|
||||
"src/lib/OpenEXR/ImfBoxAttribute.h",
|
||||
"src/lib/OpenEXR/ImfCRgbaFile.h",
|
||||
"src/lib/OpenEXR/ImfChannelList.h",
|
||||
"src/lib/OpenEXR/ImfChannelListAttribute.h",
|
||||
"src/lib/OpenEXR/ImfCheckedArithmetic.h",
|
||||
"src/lib/OpenEXR/ImfChromaticities.h",
|
||||
"src/lib/OpenEXR/ImfChromaticitiesAttribute.h",
|
||||
"src/lib/OpenEXR/ImfCompositeDeepScanLine.h",
|
||||
"src/lib/OpenEXR/ImfCompression.h",
|
||||
"src/lib/OpenEXR/ImfCompressionAttribute.h",
|
||||
"src/lib/OpenEXR/ImfCompressor.h",
|
||||
"src/lib/OpenEXR/ImfConvert.h",
|
||||
"src/lib/OpenEXR/ImfDeepCompositing.h",
|
||||
"src/lib/OpenEXR/ImfDeepFrameBuffer.h",
|
||||
"src/lib/OpenEXR/ImfDeepImageState.h",
|
||||
"src/lib/OpenEXR/ImfDeepImageStateAttribute.h",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineInputFile.h",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineInputPart.h",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineOutputFile.h",
|
||||
"src/lib/OpenEXR/ImfDeepScanLineOutputPart.h",
|
||||
"src/lib/OpenEXR/ImfDeepTiledInputFile.h",
|
||||
"src/lib/OpenEXR/ImfDeepTiledInputPart.h",
|
||||
"src/lib/OpenEXR/ImfDeepTiledOutputFile.h",
|
||||
"src/lib/OpenEXR/ImfDeepTiledOutputPart.h",
|
||||
"src/lib/OpenEXR/ImfDoubleAttribute.h",
|
||||
"src/lib/OpenEXR/ImfDwaCompressor.h",
|
||||
"src/lib/OpenEXR/ImfDwaCompressorSimd.h",
|
||||
"src/lib/OpenEXR/ImfEnvmap.h",
|
||||
"src/lib/OpenEXR/ImfEnvmapAttribute.h",
|
||||
"src/lib/OpenEXR/ImfExport.h",
|
||||
"src/lib/OpenEXR/ImfFastHuf.h",
|
||||
"src/lib/OpenEXR/ImfFloatAttribute.h",
|
||||
"src/lib/OpenEXR/ImfFloatVectorAttribute.h",
|
||||
"src/lib/OpenEXR/ImfForward.h",
|
||||
"src/lib/OpenEXR/ImfFrameBuffer.h",
|
||||
"src/lib/OpenEXR/ImfFramesPerSecond.h",
|
||||
"src/lib/OpenEXR/ImfGenericInputFile.h",
|
||||
"src/lib/OpenEXR/ImfGenericOutputFile.h",
|
||||
"src/lib/OpenEXR/ImfHeader.h",
|
||||
"src/lib/OpenEXR/ImfHuf.h",
|
||||
"src/lib/OpenEXR/ImfIDManifest.h",
|
||||
"src/lib/OpenEXR/ImfIDManifestAttribute.h",
|
||||
"src/lib/OpenEXR/ImfIO.h",
|
||||
"src/lib/OpenEXR/ImfInputFile.h",
|
||||
"src/lib/OpenEXR/ImfInputPart.h",
|
||||
"src/lib/OpenEXR/ImfInputPartData.h",
|
||||
"src/lib/OpenEXR/ImfInputStreamMutex.h",
|
||||
"src/lib/OpenEXR/ImfInt64.h",
|
||||
"src/lib/OpenEXR/ImfIntAttribute.h",
|
||||
"src/lib/OpenEXR/ImfKeyCode.h",
|
||||
"src/lib/OpenEXR/ImfKeyCodeAttribute.h",
|
||||
"src/lib/OpenEXR/ImfLineOrder.h",
|
||||
"src/lib/OpenEXR/ImfLineOrderAttribute.h",
|
||||
"src/lib/OpenEXR/ImfLut.h",
|
||||
"src/lib/OpenEXR/ImfMatrixAttribute.h",
|
||||
"src/lib/OpenEXR/ImfMisc.h",
|
||||
"src/lib/OpenEXR/ImfMultiPartInputFile.h",
|
||||
"src/lib/OpenEXR/ImfMultiPartOutputFile.h",
|
||||
"src/lib/OpenEXR/ImfMultiView.h",
|
||||
"src/lib/OpenEXR/ImfName.h",
|
||||
"src/lib/OpenEXR/ImfNamespace.h",
|
||||
"src/lib/OpenEXR/ImfOpaqueAttribute.h",
|
||||
"src/lib/OpenEXR/ImfOptimizedPixelReading.h",
|
||||
"src/lib/OpenEXR/ImfOutputFile.h",
|
||||
"src/lib/OpenEXR/ImfOutputPart.h",
|
||||
"src/lib/OpenEXR/ImfOutputPartData.h",
|
||||
"src/lib/OpenEXR/ImfOutputStreamMutex.h",
|
||||
"src/lib/OpenEXR/ImfPartHelper.h",
|
||||
"src/lib/OpenEXR/ImfPartType.h",
|
||||
"src/lib/OpenEXR/ImfPixelType.h",
|
||||
"src/lib/OpenEXR/ImfPizCompressor.h",
|
||||
"src/lib/OpenEXR/ImfPreviewImage.h",
|
||||
"src/lib/OpenEXR/ImfPreviewImageAttribute.h",
|
||||
"src/lib/OpenEXR/ImfPxr24Compressor.h",
|
||||
"src/lib/OpenEXR/ImfRational.h",
|
||||
"src/lib/OpenEXR/ImfRationalAttribute.h",
|
||||
"src/lib/OpenEXR/ImfRgba.h",
|
||||
"src/lib/OpenEXR/ImfRgbaFile.h",
|
||||
"src/lib/OpenEXR/ImfRgbaYca.h",
|
||||
"src/lib/OpenEXR/ImfRle.h",
|
||||
"src/lib/OpenEXR/ImfRleCompressor.h",
|
||||
"src/lib/OpenEXR/ImfScanLineInputFile.h",
|
||||
"src/lib/OpenEXR/ImfSimd.h",
|
||||
"src/lib/OpenEXR/ImfStandardAttributes.h",
|
||||
"src/lib/OpenEXR/ImfStdIO.h",
|
||||
"src/lib/OpenEXR/ImfStringAttribute.h",
|
||||
"src/lib/OpenEXR/ImfStringVectorAttribute.h",
|
||||
"src/lib/OpenEXR/ImfSystemSpecific.h",
|
||||
"src/lib/OpenEXR/ImfTestFile.h",
|
||||
"src/lib/OpenEXR/ImfThreading.h",
|
||||
"src/lib/OpenEXR/ImfTileDescription.h",
|
||||
"src/lib/OpenEXR/ImfTileDescriptionAttribute.h",
|
||||
"src/lib/OpenEXR/ImfTileOffsets.h",
|
||||
"src/lib/OpenEXR/ImfTiledInputFile.h",
|
||||
"src/lib/OpenEXR/ImfTiledInputPart.h",
|
||||
"src/lib/OpenEXR/ImfTiledMisc.h",
|
||||
"src/lib/OpenEXR/ImfTiledOutputFile.h",
|
||||
"src/lib/OpenEXR/ImfTiledOutputPart.h",
|
||||
"src/lib/OpenEXR/ImfTiledRgbaFile.h",
|
||||
"src/lib/OpenEXR/ImfTimeCode.h",
|
||||
"src/lib/OpenEXR/ImfTimeCodeAttribute.h",
|
||||
"src/lib/OpenEXR/ImfVecAttribute.h",
|
||||
"src/lib/OpenEXR/ImfVersion.h",
|
||||
"src/lib/OpenEXR/ImfWav.h",
|
||||
"src/lib/OpenEXR/ImfXdr.h",
|
||||
"src/lib/OpenEXR/ImfZip.h",
|
||||
"src/lib/OpenEXR/ImfZipCompressor.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfig.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfigInternal.h",
|
||||
],
|
||||
copts = select({
|
||||
":windows": [],
|
||||
"//conditions:default": [
|
||||
"-Wno-error",
|
||||
],
|
||||
}),
|
||||
features = select({
|
||||
":windows": ["windows_export_all_symbols"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = ["src/lib/OpenEXR"],
|
||||
linkopts =
|
||||
select({
|
||||
":windows": [],
|
||||
"//conditions:default": [
|
||||
"-pthread",
|
||||
],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":IlmThread",
|
||||
":OpenEXRCore",
|
||||
"@Imath",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "IexTest",
|
||||
srcs = [
|
||||
"src/test/IexTest/main.cpp",
|
||||
"src/test/IexTest/testBaseExc.cpp",
|
||||
"src/test/IexTest/testBaseExc.h",
|
||||
],
|
||||
includes = ["src/test/IexTest"],
|
||||
tags = ["manual"], # This test is not build and executed in the CI
|
||||
deps = [
|
||||
":Iex",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "exr2aces",
|
||||
srcs = ["src/bin/exr2aces/main.cpp"],
|
||||
deps = [
|
||||
":OpenEXR",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "exrheader",
|
||||
srcs = ["src/bin/exrheader/main.cpp"],
|
||||
deps = [
|
||||
":OpenEXR",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "exrenvmap",
|
||||
srcs = [
|
||||
"src/bin/exrenvmap/EnvmapImage.cpp",
|
||||
"src/bin/exrenvmap/blurImage.cpp",
|
||||
"src/bin/exrenvmap/main.cpp",
|
||||
"src/bin/exrenvmap/makeCubeMap.cpp",
|
||||
"src/bin/exrenvmap/makeLatLongMap.cpp",
|
||||
"src/bin/exrenvmap/readInputImage.cpp",
|
||||
"src/bin/exrenvmap/resizeImage.cpp",
|
||||
] + glob(["src/bin/exrenvmap/*.h"]),
|
||||
includes = [
|
||||
"src/bin/exrenvmap",
|
||||
],
|
||||
deps = [
|
||||
":OpenEXR",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "exrstdattr",
|
||||
srcs = ["src/bin/exrstdattr/main.cpp"],
|
||||
deps = [
|
||||
":OpenEXR",
|
||||
],
|
||||
)
|
||||
-4921
File diff suppressed because it is too large
Load Diff
-143
@@ -1,143 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# We require this to get object library link library support
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
if(POLICY CMP0074)
|
||||
# enable find_package(<Package>) to use <Package>_ROOT as a hint
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0077)
|
||||
# enable variables set outside to override options
|
||||
cmake_policy(SET CMP0077 NEW)
|
||||
endif()
|
||||
|
||||
#######################################
|
||||
# Create project and include cmake
|
||||
# configuration files
|
||||
#######################################
|
||||
|
||||
file(READ "src/lib/OpenEXRCore/openexr_version.h" VERSION_H)
|
||||
string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${VERSION_H})
|
||||
set(OPENEXR_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${VERSION_H})
|
||||
set(OPENEXR_VERSION_MINOR ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "VERSION_PATCH ([0-9]*)" _ ${VERSION_H})
|
||||
set(OPENEXR_VERSION_PATCH ${CMAKE_MATCH_1})
|
||||
|
||||
project(OpenEXR VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} LANGUAGES C CXX)
|
||||
|
||||
set(OPENEXR_VERSION_RELEASE_TYPE "" CACHE STRING "Extra version tag string for OpenEXR build, such as -dev, -beta1, etc.")
|
||||
|
||||
set(OPENEXR_VERSION ${OpenEXR_VERSION})
|
||||
set(OPENEXR_VERSION_API "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}")
|
||||
|
||||
# The SOVERSION (i.e. numerical component of SONAME) tracks the ABI
|
||||
# version. Increment this number whenever, and only when, the ABI changes in
|
||||
# non-backwards-compatible ways.
|
||||
#
|
||||
# The OpenEXR project policy is to append the library version
|
||||
# "major.minor.patch" to the SONAME to form the real shared library name.
|
||||
# For example, in "libOpenEXR.so.31.3.2.0", "libOpenEXR.so.31" is the SONAME
|
||||
# and ".3.2.0" identifies the corresponding library release.
|
||||
|
||||
set(OPENEXR_LIB_SOVERSION 31)
|
||||
set(OPENEXR_LIB_VERSION "${OPENEXR_LIB_SOVERSION}.${OPENEXR_VERSION}") # e.g. "31.3.2.0"
|
||||
|
||||
option(OPENEXR_INSTALL "Install OpenEXR libraries" ON)
|
||||
option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON)
|
||||
if(OPENEXR_INSTALL_TOOLS AND NOT OPENEXR_INSTALL)
|
||||
message(SEND_ERROR "OPENEXR_INSTALL_TOOLS requires OPENEXR_INSTALL")
|
||||
endif()
|
||||
|
||||
include(cmake/LibraryDefine.cmake)
|
||||
include(cmake/OpenEXRSetup.cmake)
|
||||
add_subdirectory(cmake)
|
||||
message(STATUS "Configure ${OPENEXR_PACKAGE_NAME}, library API version: ${OPENEXR_LIB_VERSION}")
|
||||
|
||||
# Hint: This can be set to enable custom find_package
|
||||
# search paths, probably best to set it when configuring
|
||||
# on the command line to cmake instead of setting it
|
||||
# here.
|
||||
###set(CMAKE_PREFIX_PATH "/prefix")
|
||||
|
||||
#######################################
|
||||
# Add all source in subdirectories
|
||||
#######################################
|
||||
|
||||
if(BUILD_TESTING AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
# Enable testing *before* adding any subdirectories that may include tests
|
||||
enable_testing()
|
||||
endif()
|
||||
|
||||
# Include these two modules without enable/disable options
|
||||
add_subdirectory(src/lib)
|
||||
add_subdirectory(src/bin)
|
||||
|
||||
# Tell CMake where to find the OpenEXRConfig.cmake file. Makes it possible to call
|
||||
# find_package(OpenEXR) in downstream projects
|
||||
set(OpenEXR_DIR "${CMAKE_CURRENT_BINARY_DIR}/cmake" CACHE PATH "" FORCE)
|
||||
# Add an empty OpenEXRTargets.cmake file for the config to use.
|
||||
# Can be empty since we already defined the targets in add_subdirectory
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cmake/OpenEXRTargets.cmake" "# Dummy file")
|
||||
|
||||
option(OPENEXR_INSTALL_EXAMPLES "Install OpenEXR examples" ON)
|
||||
if(OPENEXR_INSTALL_EXAMPLES)
|
||||
add_subdirectory( src/examples )
|
||||
endif()
|
||||
|
||||
# If you want to use ctest to configure, build and
|
||||
# upload the results, cmake has builtin support for
|
||||
# submitting to CDash, or any server who speaks the
|
||||
# same protocol
|
||||
#
|
||||
# These settings will need to be set for your environment,
|
||||
# and then a script such as the example in
|
||||
#
|
||||
# cmake/SampleCTestScript.cmake
|
||||
#
|
||||
# edited and placed into the CI system, then run:
|
||||
#
|
||||
# cmake -S cmake/SampleCTestScript.cmake
|
||||
#
|
||||
# [or whatever you name the file you edit]
|
||||
#
|
||||
#set(CTEST_PROJECT_NAME "OpenEXR")
|
||||
#set(CTEST_NIGHTLY_START_TIME "01:01:01 UTC")
|
||||
#set(CTEST_DROP_METHOD "http") # there are others...
|
||||
#set(CTEST_DROP_SITE "open.cdash.org")
|
||||
#set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
|
||||
#set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
include(CTest)
|
||||
|
||||
if(BUILD_TESTING AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
add_subdirectory(src/test)
|
||||
endif()
|
||||
|
||||
# Including this module will add a `clang-format` target to the build if
|
||||
# the clang-format executable can be found. Only do this if we are top level
|
||||
if(NOT OPENEXR_IS_SUBPROJECT)
|
||||
include(cmake/clang-format.cmake)
|
||||
endif()
|
||||
|
||||
option(OPENEXR_INSTALL_DOCS "Set ON to install tool manpages")
|
||||
if (OPENEXR_INSTALL_DOCS AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
add_subdirectory(docs)
|
||||
endif()
|
||||
|
||||
option(BUILD_WEBSITE "Set ON to build website source")
|
||||
if (BUILD_WEBSITE AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
add_subdirectory(website)
|
||||
endif()
|
||||
|
||||
if (NOT OPENEXR_IS_SUBPROJECT)
|
||||
# Even if not building the website, still make sure the website example code compiles.
|
||||
add_subdirectory(website/src)
|
||||
endif()
|
||||
|
||||
option(OPENEXR_BUILD_PYTHON "Set ON to build python bindings")
|
||||
if (OPENEXR_BUILD_PYTHON AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
add_subdirectory(src/wrappers/python)
|
||||
endif()
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
# See https://help.github.com/articles/about-codeowners/
|
||||
# for more info about CODEOWNERS file
|
||||
|
||||
# It uses the same pattern rule for gitignore file
|
||||
# https://git-scm.com/docs/gitignore#_pattern_format
|
||||
|
||||
# Admin
|
||||
/openexr/ASWF/ @cary-ilm @kdt3rd @lgritz @meshula @peterhillman @xlietz
|
||||
/openexr/*.md @cary-ilm @kdt3rd @lgritz @meshula @peterhillman @xlietz
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
# Code of Conduct
|
||||
|
||||
The OpenEXR project abides by Linux Foundation's code of conduct,
|
||||
which you can read in full
|
||||
[here](https://lfprojects.org/policies/code-of-conduct).
|
||||
|
||||
Our covenant includes:
|
||||
|
||||
* Treat each other with respect, professionalism, fairness, and
|
||||
sensitivity to our many differences and strengths, including in
|
||||
situations of high pressure and urgency.
|
||||
|
||||
* Never harass or bully anyone verbally, physically or sexually.
|
||||
|
||||
* Never discriminate on the basis of personal characteristics or group
|
||||
membership.
|
||||
|
||||
* Communicate constructively and avoid demeaning or insulting behavior
|
||||
or language.
|
||||
|
||||
* Seek, accept, and offer objective work criticism, and acknowledge
|
||||
properly the contributions of others.
|
||||
|
||||
* Be honest about your own qualifications, and about any circumstances
|
||||
that might lead to conflicts of interest.
|
||||
|
||||
* Respect the privacy of others and the confidentiality of data you
|
||||
access.
|
||||
|
||||
* With respect to cultural differences, be conservative in what you do
|
||||
and liberal in what you accept from others, but not to the point of
|
||||
accepting disrespectful, unprofessional or unfair or unwelcome
|
||||
behavior or advances.
|
||||
|
||||
* Promote the rules of this Code and take action (especially if you
|
||||
are in a leadership position) to bring the discussion back to a more
|
||||
civil level whenever inappropriate behaviors are observed.
|
||||
|
||||
* Stay on topic: Make sure that you are posting to the correct channel
|
||||
and avoid off-topic discussions. Remember when you update an issue
|
||||
or respond to an email you are potentially sending to a large number
|
||||
of people.
|
||||
|
||||
* Step down considerately: participants in every project come and go,
|
||||
and LF Projects is no different. When you leave or disengage from
|
||||
the project, in whole or in part, we ask that you do so in a way
|
||||
that minimizes disruption to the project. This means you should tell
|
||||
people you are leaving and take the proper steps to ensure that
|
||||
others can pick up where you left off.
|
||||
|
||||
To report incidents or to appeal reports of incidents, send email to
|
||||
the Manager of LF Projects at manager@lfprojects.org.
|
||||
-751
@@ -1,751 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
# Contributing to OpenEXR
|
||||
|
||||
Thank you for your interest in contributing to OpenEXR. This document
|
||||
explains our contribution process and procedures:
|
||||
|
||||
* [Getting Information](#Getting-Information)
|
||||
* [Legal Requirements](#Legal-Requirements)
|
||||
* [Development Workflow](#Development-Workflow)
|
||||
* [Coding Style](#Coding-Style)
|
||||
* [Versioning Policy](#Versioning-Policy)
|
||||
* [Creating a Patch Release](#Creating-a-Patch-Release)
|
||||
* [Creating a Major/Minor Release](#Creating-a-Major/Minor-Release)
|
||||
|
||||
For a description of the roles and responsibilities of the various
|
||||
members of the OpenEXR community, see [GOVERNANCE](GOVERNANCE.md), and
|
||||
for further details, see the OpenEXR project's [Technical
|
||||
Charter](ASWF/charter/OpenEXR-Technical-Charter.md). Briefly,
|
||||
a "contributor" is anyone who submits content to the project, a
|
||||
"committer" reviews and approves such submissions, and the "Technical
|
||||
Steering Committee" provides general project oversight and governance.
|
||||
|
||||
## Getting Information
|
||||
|
||||
There are two primary ways to connect with the OpenEXR project:
|
||||
|
||||
* The [openexr-dev](https://lists.aswf.io/g/openexr-dev) mail list:
|
||||
This is a development focused mail list with a deep history of
|
||||
technical conversations and decisions that have shaped the project.
|
||||
|
||||
* [GitHub Issues](https://github.com/AcademySoftwareFoundation/openexr/issues): GitHub
|
||||
Issues are used both to track bugs and to discuss feature requests.
|
||||
|
||||
### How to Ask for Help
|
||||
|
||||
If you have trouble installing, building, or using the library, but
|
||||
there's not yet reason to suspect you've encountered a genuine bug,
|
||||
start by posting a question to the
|
||||
[openexr-dev](http://lists.aswf.io/openexr-dev) mailing list. This is
|
||||
the place for question such has "How do I...".
|
||||
|
||||
### How to Report a Bug
|
||||
|
||||
OpenEXR use GitHub's issue tracking system for bugs and enhancements:
|
||||
https://github.com/AcademySoftwareFoundation/openexr/issues
|
||||
|
||||
If you are submitting a bug report, please be sure to note which
|
||||
version of OpenEXR you are using, on what platform (OS/version, which
|
||||
compiler you used, and any special build flags or other unusual
|
||||
environmental issues). Please give a specific account of
|
||||
|
||||
* what you tried
|
||||
* what happened
|
||||
* what you expected to happen instead
|
||||
|
||||
with enough detail that others can reproduce the problem.
|
||||
|
||||
### How to Request a Change
|
||||
|
||||
Open a GitHub issue: https://github.com/AcademySoftwareFoundation/openexr/issues.
|
||||
|
||||
Describe the situation and the objective in as much detail as
|
||||
possible. Feature requests will almost certainly spawn a discussion
|
||||
among the project community.
|
||||
|
||||
### How to Report a Security Vulnerability
|
||||
|
||||
If you think you've found a potential vulnerability in OpenEXR, please
|
||||
refer to [SECURITY.md](SECURITY.md) to responsibly disclose it.
|
||||
|
||||
### How to Contribute a Bug Fix or Change
|
||||
|
||||
To contribute code to the project, first read over the [GOVERNANCE](GOVERNANCE.md) page to understand the roles involved. You'll need:
|
||||
|
||||
* A good knowledge of git.
|
||||
|
||||
* A fork of the GitHub repo.
|
||||
|
||||
* An understanding of the project's development workflow.
|
||||
|
||||
* Legal authorization, that is, you need to have signed a contributor
|
||||
License Agreement. See below for details.
|
||||
|
||||
## Legal Requirements
|
||||
|
||||
OpenEXR is a project of the Academy Software Foundation and follows the
|
||||
open source software best practice policies of the Linux Foundation.
|
||||
|
||||
### License
|
||||
|
||||
OpenEXR is licensed under the [BSD-3-Clause](LICENSE.md)
|
||||
license. Contributions to the library should abide by that standard
|
||||
license.
|
||||
|
||||
### Contributor License Agreements
|
||||
|
||||
Developers who wish to contribute code to be considered for inclusion
|
||||
in the OpenEXR distribution must first complete a **Contributor
|
||||
License Agreement**.
|
||||
|
||||
To contribute to OpenEXR, you must sign a CLA through the
|
||||
[EasyCLA](https://contributor.easycla.lfx.linuxfoundation.org/#/cla/project/2e8710cb-e379-4116-a9ba-964f83618cc5/user/564e571e-12d7-4857-abd4-898939accdd7?redirect=https:%2F%2Fgithub.com%2FAcademySoftwareFoundation%2Fopenexr%2Fpull%2F1154)
|
||||
system, which is integrated with GitHub as a pull request check.
|
||||
|
||||
Sign the form through [this
|
||||
link](https://contributor.easycla.lfx.linuxfoundation.org/#/cla/project/2e8710cb-e379-4116-a9ba-964f83618cc5/user/564e571e-12d7-4857-abd4-898939accdd7?redirect=https:%2F%2Fgithub.com%2FAcademySoftwareFoundation%2Fopenexr%2Fpull%2F1154)
|
||||
prior to submitting a pull request. If you submit a pull request
|
||||
before the form is signed, the "linux-foundation-easycla" check will
|
||||
fail and a red "NOT COVERED" button will appear in the PR
|
||||
comments. Click that link to sign the form.
|
||||
|
||||
* If you are an individual writing the code on your own time and
|
||||
you're **sure** you are the sole owner of any intellectual property you
|
||||
contribute, you can sign the CLA as an **Individual Contributor**.
|
||||
|
||||
* If you are writing the code as part of your job, or if your employer
|
||||
retains ownership to intellectual property you create, no matter how
|
||||
small, then your company's legal affairs representatives should sign
|
||||
a **Corporate Contributor Licence Agreement**. If your company already
|
||||
has a signed CCLA on file, ask your local CLA manager to add you
|
||||
(via your GitHub account name/email address) to your company's
|
||||
"approved" list.
|
||||
|
||||
The downloadable PDF's on the EasyCLA page are provided for reference
|
||||
only. To execute the signature, sign the form online through the
|
||||
relevant links.
|
||||
|
||||
The OpenEXR CLAs are the standard forms used by Linux Foundation
|
||||
projects and [recommended by the ASWF
|
||||
TAC](https://github.com/AcademySoftwareFoundation/tac/blob/main/process/contributing.md#contributor-license-agreement-cla).
|
||||
|
||||
### Commit Sign-Off
|
||||
|
||||
Every commit must be signed off. That is, every commit log message
|
||||
must include a “`Signed-off-by`” line (generated, for example, with
|
||||
“`git commit --signoff`”), indicating that the committer wrote the
|
||||
code and has the right to release it under the [BSD-3-Clause](LICENSE.md)
|
||||
license. See https://github.com/AcademySoftwareFoundation/tac/blob/main/process/contributing.md#contribution-sign-off for more information on this requirement.
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Git Basics
|
||||
|
||||
Working with OpenEXR requires understanding a significant amount of
|
||||
Git and GitHub based terminology. If you’re unfamiliar with these
|
||||
tools or their lingo, please look at the [GitHub
|
||||
Glossary](https://help.github.com/articles/github-glossary/) or browse
|
||||
[GitHub Help](https://help.github.com/).
|
||||
|
||||
To contribute, you need a GitHub account. This is needed in order to
|
||||
push changes to the upstream repository, via a pull request.
|
||||
|
||||
You will also need Git installed on your local development machine. If
|
||||
you need setup assistance, please see the official [Git
|
||||
Documentation](https://git-scm.com/doc).
|
||||
|
||||
### Repository Structure and Commit Policy
|
||||
|
||||
The OpenEXR repository uses a simple branching and merging strategy.
|
||||
|
||||
All development work is done directly on the ``main`` branch. The ``main``
|
||||
branch represents the bleeding-edge of the project and most
|
||||
contributions should be done on top of it.
|
||||
|
||||
After sufficient work is done on the ``main`` branch and the OpenEXR
|
||||
leadership determines that a release is due, we will bump the relevant
|
||||
internal versioning and tag a commit with the corresponding version
|
||||
number, e.g. v2.0.1. Each minor version also has its own “Release
|
||||
Branch”, e.g. RB-1.1. This marks a branch of code dedicated to that
|
||||
``major.minor version``, which allows upstream bug fixes to be
|
||||
cherry-picked to a given version while still allowing the ``main``
|
||||
branch to continue forward onto higher versions. This basic repository
|
||||
structure keeps maintenance low, while remaining simple to understand.
|
||||
|
||||
To reiterate, the ``main`` branch represents the latest development
|
||||
version, so beware that it may include untested features and is not
|
||||
generally stable enough for release. To retrieve a stable version of
|
||||
the source code, use one of the release branches.
|
||||
|
||||
### The Git Workflow
|
||||
|
||||
This development workflow is sometimes referred to as
|
||||
[OneFlow](https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow). It
|
||||
leads to a simple, clean, linear edit history in the repo.
|
||||
|
||||
The OpenEXR GitHub repo allows rebase merging and disallows merge
|
||||
commits and squash merging. This ensures that the repo edit history
|
||||
remains linear, avoiding the "bubbles" characteristic of the
|
||||
[GitFlow](https://www.endoflineblog.com/gitflow-considered-harmful)
|
||||
workflow.
|
||||
|
||||
### Use the Fork, Luke.
|
||||
|
||||
In a typical workflow, you should **fork** the OpenEXR repository to
|
||||
your account. This creates a copy of the repository under your user
|
||||
namespace and serves as the “home base” for your development branches,
|
||||
from which you will submit **pull requests** to the upstream
|
||||
repository to be merged.
|
||||
|
||||
Once your Git environment is operational, the next step is to locally
|
||||
**clone** your forked OpenEXR repository, and add a **remote**
|
||||
pointing to the upstream OpenEXR repository. These topics are
|
||||
covered in the GitHub documentation [Cloning a
|
||||
repository](https://help.github.com/articles/cloning-a-repository/)
|
||||
and [Configuring a remote for a
|
||||
fork](https://help.github.com/articles/configuring-a-remote-for-a-fork/),
|
||||
but again, if you need assistance feel free to reach out on the
|
||||
openexr-dev@lists.aswf.io mail list.
|
||||
|
||||
### Pull Requests
|
||||
|
||||
Contributions should be submitted as Github pull requests. See
|
||||
[Creating a pull request](https://help.github.com/articles/creating-a-pull-request/)
|
||||
if you're unfamiliar with this concept.
|
||||
|
||||
The development cycle for a code change should follow this protocol:
|
||||
|
||||
1. Create a topic branch in your local repository, following the naming format
|
||||
"feature/<your-feature>" or "bugfix/<your-fix>".
|
||||
|
||||
2. Make changes, compile, and test thoroughly. Code style should match existing
|
||||
style and conventions, and changes should be focused on the topic the pull
|
||||
request will be addressing. Make unrelated changes in a separate topic branch
|
||||
with a separate pull request.
|
||||
|
||||
3. Push commits to your fork.
|
||||
|
||||
4. Create a Github pull request from your topic branch.
|
||||
|
||||
5. Pull requests will be reviewed by project committers and contributors,
|
||||
who may discuss, offer constructive feedback, request changes, or approve
|
||||
the work.
|
||||
|
||||
6. Upon receiving the required number of committer approvals (as
|
||||
outlined in [Required Approvals](#required-approvals)), a committer
|
||||
other than the PR contributor may merge changes into the ``main``
|
||||
branch.
|
||||
|
||||
### Code Review and Required Approvals
|
||||
|
||||
Modifications of the contents of the OpenEXR repository are made on a
|
||||
collaborative basis. Anyone with a GitHub account may propose a
|
||||
modification via pull request and it will be considered by the project
|
||||
committers.
|
||||
|
||||
Pull requests must meet a minimum number of committer approvals prior
|
||||
to being merged. Rather than having a hard rule for all PRs, the
|
||||
requirement is based on the complexity and risk of the proposed
|
||||
changes, factoring in the length of time the PR has been open to
|
||||
discussion. The following guidelines outline the project's established
|
||||
approval rules for merging:
|
||||
|
||||
* Core design decisions, large new features, or anything that might be
|
||||
perceived as changing the overall direction of the project should be
|
||||
discussed at length in the mail list or TSC meetings before any PR is
|
||||
submitted, in order to solicit feedback, try to get as much consensus
|
||||
as possible, and alert all the stakeholders to be on the lookout for
|
||||
the eventual PR when it appears.
|
||||
|
||||
* Trivial changes that don't affect functionality (typos, tests, website)
|
||||
can be approved by the committer without review, after waiting at
|
||||
least 48 hours.
|
||||
|
||||
* Big changes that can alter behavior, add major features, or present
|
||||
a high degree of risk should be signed off by TWO committers, ideally
|
||||
one of whom should be the "owner" for that section of the codebase (if
|
||||
a specific owner has been designated). If the person submitting the PR
|
||||
is him/herself the "owner" of that section of the codebase, then only
|
||||
one additional committer approval is sufficient. But in either case, a
|
||||
48 hour minimum is helpful to give everybody a chance to see it,
|
||||
unless it's a critical emergency fix (which would probably put it in
|
||||
the previous "small fix" category, rather than a "big feature").
|
||||
|
||||
* Escape valve: big changes can nonetheless be merged by a single
|
||||
committer if the PR has been open for over two weeks without any
|
||||
unaddressed objections from other committers. At some point, we have
|
||||
to assume that the people who know and care are monitoring the PRs and
|
||||
that an extended period without objections is really assent.
|
||||
|
||||
Approval must be from committers who are not authors of the change. If
|
||||
one or more committers oppose a proposed change, then the change
|
||||
cannot be accepted unless:
|
||||
|
||||
* Discussions and/or additional changes result in no committers
|
||||
objecting to the change. Previously-objecting committers do not
|
||||
necessarily have to sign-off on the change, but they should not be
|
||||
opposed to it.
|
||||
|
||||
* The change is escalated to the TSC and the TSC votes to approve the
|
||||
change. This should only happen if disagreements between committers
|
||||
cannot be resolved through discussion.
|
||||
|
||||
Committers may opt to elevate significant or controversial
|
||||
modifications to the TSC by assigning the `tsc-review` label to a pull
|
||||
request or issue. The TSC should serve as the final arbiter where
|
||||
required.
|
||||
|
||||
### Test Policy
|
||||
|
||||
All functionality in the library must be covered by an automated
|
||||
test. Each library has a companion ``Test`` project, e.g. ``OpenEXRTest``,
|
||||
``OpenEXRCoreTest``, ``OpenEXRUtilTest``, etc. This test suite is collectively
|
||||
expected to validate the behavior of very part of the library.
|
||||
|
||||
* All new functionality should be accompanied by a test that validates
|
||||
its behavior.
|
||||
|
||||
* Any change to existing functionality should have tests added if they
|
||||
don't already exist.
|
||||
|
||||
The test should should be run, via:
|
||||
|
||||
make test
|
||||
|
||||
before submitting a pull request.
|
||||
|
||||
In addition, the ``OpenEXRFuzzTest`` project validates the library by
|
||||
feeding it corrupted input data. This test is time-consuming (possible
|
||||
over 24 hours), so it will only be run occasionally, but it must
|
||||
succeed before a release is made.
|
||||
|
||||
## Coding Style
|
||||
|
||||
#### Formatting
|
||||
|
||||
The coding style of the library source code is enforced via Clang format, with the configuration defined in [.clang-format](.clang-format).
|
||||
|
||||
When modifying existing code, follow the surrounding formatting
|
||||
conventions so that new or modified code blends in with the current
|
||||
code.
|
||||
|
||||
* Indent with spaces, never tabs. Each indent level should be 4 spaces.
|
||||
|
||||
* Function return types go on a separate line:
|
||||
|
||||
const float &
|
||||
Header::pixelAspectRatio () const
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
* Use a space between function names and the following parentheses
|
||||
(although you can eliminate the space for functions with no
|
||||
arguments):
|
||||
|
||||
void
|
||||
Header::insert (const string& name, const Attribute& attribute)
|
||||
{
|
||||
insert (name.c_str(), attribute);
|
||||
}
|
||||
|
||||
* Place curly braces on their own lines:
|
||||
|
||||
void
|
||||
RgbaOutputFile::ToYca::padTmpBuf ()
|
||||
{
|
||||
for (int i = 0; i < N2; ++i)
|
||||
{
|
||||
_tmpBuf[i] = _tmpBuf[N2];
|
||||
_tmpBuf[_width + N2 + i] = _tmpBuf[_width + N2 - 2];
|
||||
}
|
||||
}
|
||||
|
||||
#### Naming Conventions
|
||||
|
||||
* In general, classes and template type names should start with upper
|
||||
case and capitalize new words: `class CustomerList;`
|
||||
|
||||
* In general, local variables should use camelCase. Macros and
|
||||
constants should use `ALL_CAPS`.
|
||||
|
||||
* Member fields in a class should start with an underscore. No other
|
||||
variables should begin with underscore.
|
||||
|
||||
#### File conventions
|
||||
|
||||
C++ implementation should be named `*.cpp`. Headers should be named `.h`.
|
||||
|
||||
All headers should contain:
|
||||
|
||||
#pragma once
|
||||
|
||||
#### Type Conventions
|
||||
|
||||
Because OpenEXR must deal properly with large images, whose width
|
||||
and/or height approach the maximum allowable in 32-bit signed
|
||||
integers, take special care that integer arithmetic doesn't overflow,
|
||||
and make it as clear as possible exactly what the code is doing,
|
||||
especially in the edge cases.
|
||||
|
||||
To clarify the intention, prefer to cast between types using
|
||||
``static_cast<>()`` rather than the basic C-style ``()`` notation:
|
||||
|
||||
// good:
|
||||
size_t x = static_cast <size_t> (y);
|
||||
|
||||
// bad:
|
||||
x = (size_t) y;
|
||||
x = size_t (y);
|
||||
|
||||
Prefer to use ``std::numeric_limits<>`` instead of preprocessor
|
||||
define's such as ``INT_MAX``:
|
||||
|
||||
// good:
|
||||
if (x > std::numeric_limits<int>::max())
|
||||
std::cout << "That's too freakin' high.\n";
|
||||
|
||||
// bad:
|
||||
if (x > INT_MAX)
|
||||
|
||||
#### Copyright Notices
|
||||
|
||||
All new source files should begin with a copyright and license stating:
|
||||
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#### Third-party libraries
|
||||
|
||||
Prefer C++11 `std` over boost where possible. Use boost classes you
|
||||
already see in the code base, but check with the project leadership
|
||||
before adding new boost usage.
|
||||
|
||||
#### Comments and Doxygen
|
||||
|
||||
Comment philosophy: try to be clear, try to help teach the reader
|
||||
what's going on in your code.
|
||||
|
||||
Prefer C++ comments (starting line with `//`) rather than C comments
|
||||
(`/* ... */`).
|
||||
|
||||
For public APIs, use Doxygen-style comments (start with `///`), such as:
|
||||
|
||||
/// Explanation of a class. Note THREE slashes!
|
||||
/// Also, you need at least two lines like this. If you don't have enough
|
||||
/// for two lines, make one line blank like this:
|
||||
///
|
||||
class myclass {
|
||||
....
|
||||
float foo; ///< Doxygen comments on same line look like this
|
||||
}
|
||||
|
||||
## Versioning Policy
|
||||
|
||||
OpenEXR uses [semantic versioning](https://semver.org), which labels
|
||||
each version with three numbers: ``major.minor.patch``, where:
|
||||
|
||||
* ``major`` - indicates incompatible API changes
|
||||
* ``minor`` - indicates functionality added in a backwards-compatible manner
|
||||
* ``patch`` - indicates backwards-compatible bug fixes
|
||||
|
||||
## Creating a Patch Release
|
||||
|
||||
Making a patch release typically involves merging changes from the
|
||||
main branch into the release branch, since all development generally
|
||||
takes place on the main branch. The usual workflow is to group these
|
||||
changes together and merge them all just prior to a release, rather
|
||||
than merging one-by-one as the changes go into main, although merging
|
||||
along the way is acceptable as well. For OpenEXR and Imath, a patch
|
||||
release typically involves under a dozen commits, so it's not a huge
|
||||
amount of work to organize them all at once.
|
||||
|
||||
A patch release *must* be ABI-compatible with preceding minor releases
|
||||
and should be validated with an ABI-checker tool such as
|
||||
[``abipkgdiff``](https://manpages.ubuntu.com/manpages/lunar/en/man1/abipkgdiff.1.html).
|
||||
|
||||
These instructions are for project administrators who have "push"
|
||||
access on the GitHub repo.
|
||||
|
||||
The preferred workflow is:
|
||||
|
||||
1. Make a PR that merges appropriate changes from the main branch to
|
||||
the release branch:
|
||||
|
||||
a. In a forked clone, create a branch to hold the patch commits,
|
||||
e.g. ``v3.1.9-fixes``.
|
||||
|
||||
b. Cherry-pick the appropriate commits from ``main``, resolving any
|
||||
merge conflicts.
|
||||
|
||||
c. Increment ``OPENEXR_VERSION_PATCH`` in
|
||||
[src/lib/OpenEXRCore/openexr_version.h](src/lib/OpenEXRCore/openexr_version.h)
|
||||
|
||||
d. Update the ``IMATH_TAG`` setting in
|
||||
[cmake/OpenEXRSetup.cmake](cmake/OpenEXRSetup.cmake) to
|
||||
correspond to the proper Imath release.
|
||||
|
||||
e. Add release notes to [CHANGES.md](CHANGES.md):
|
||||
|
||||
- Generate a list of links to merged pull requests.
|
||||
|
||||
Use ``git log`` to identify the merged commits, and for each
|
||||
commit, and add a link in the notes to the corresponding PR
|
||||
that merged it to ``main``. Citing PR's in the release notes
|
||||
is preferable to citing raw commits because the PR's often
|
||||
have helpful information and discussion missing from the
|
||||
commit descriptions, and the commit history is readily
|
||||
accessible via ``git log`` anyway.
|
||||
|
||||
The typical OpenEXR project workflow uses "squash and merge"
|
||||
to merge PR's into ``main``, so the changes involved in each
|
||||
PR end up on ``main`` as a single commit. This is preferable
|
||||
because a raw PR often includes numerous commits that address
|
||||
comments and feedback or fix typos or mistakes, intermediate
|
||||
steps not helpful to the preserved history of the main
|
||||
development thread. Note that GitHub's "squash and merge"
|
||||
helpfully appends the PR number to the commit subject line.
|
||||
|
||||
Note that when this PR is merged to the release branch, it
|
||||
should go in via "rebase and merge" that the release branch
|
||||
retains the granular changes, described below.
|
||||
|
||||
- Generate a list of OSS-Fuzz issues addressed.
|
||||
|
||||
These are security concerns, so they deserve special
|
||||
attention. Provide a link in the notes to the issue at
|
||||
https://bugs.chromium.org/p/oss-fuzz, including the issue id
|
||||
number and description.
|
||||
|
||||
- If there are any public CVE's, mention them explicitly with a
|
||||
link to the CVE registry item.
|
||||
|
||||
- Provide an executive summary of the patch changes, in a few
|
||||
sentences as well as bullet points if appropriate.
|
||||
|
||||
- Choose a proposed release date at least several days in
|
||||
advance.
|
||||
|
||||
f. If there are any public CVE's, reference them in
|
||||
[SECURITY.md](SECURITY.md).
|
||||
|
||||
g. Submit the PR for others to review. The PR should go *to the
|
||||
release branch, not ``main``*, obviously.
|
||||
|
||||
h. After others have had a chance to sanity-check the changes,
|
||||
merge the PR *with "rebase and merge"*. Unlike with the usual
|
||||
PR's merged to main, it is essential to retain the individual
|
||||
commits on the release branch. That way, the release branch
|
||||
commit history retains the details of the changes.
|
||||
|
||||
i. If further fixes come in that need to go into the release, push
|
||||
them to the PR branch. It's not absolutely essential that all
|
||||
changes to the release branch go in via a PR. The PR is simply a
|
||||
convient forum for publicly discussing and reviewing the
|
||||
composition of the release.
|
||||
|
||||
2. Tag the release with a ``-rc`` "release candidate" tag,
|
||||
e.g. ``v3.1.9-rc``.
|
||||
|
||||
3. Validate ABI compatibility. Build at the release candidate tag and
|
||||
run
|
||||
[abipkgdiff](https://manpages.ubuntu.com/manpages/lunar/en/man1/abipkgdiff.1.html)
|
||||
against a build of the previous patch release to confirm that no
|
||||
ABI changes have leaked in. Additions to the ABI are acceptable for
|
||||
a patch release, but there should be no symbol changes and no
|
||||
symbols removed. If there are, back up and fix them before proceeding.
|
||||
|
||||
4. Send mail to ``openexr-dev@lists.aswf.io`` announcing the staging
|
||||
of the release with link to the release candidate tag. Include the
|
||||
release notes from [CHANGES.md](CHANGES.md) for review.
|
||||
|
||||
5. Draft the release on the GitHub
|
||||
[Releases](https://github.com/AcademySoftwareFoundation/openexr/releases)
|
||||
page. Include the summary from the notes in
|
||||
[CHANGES.md](CHANGES.md), but don't include the list of PR's.
|
||||
|
||||
Create the release from the latest ``--rc`` tag, and give it a name
|
||||
that begins with ``v``, i.e. ``v3.1.9``.
|
||||
|
||||
Save the release as a "draft".
|
||||
|
||||
6. Wait at least 48 hours, to give the community time to discover and
|
||||
report any obvious problems. Avoid the temptation to rush changes
|
||||
into a release and publish it immediately, as that is uncomfortably
|
||||
error prone.
|
||||
|
||||
If additional fixes need to go in before release:
|
||||
|
||||
a. Merge commits to the release branch. Push them directly, no need
|
||||
for a pull request.
|
||||
|
||||
b. Update the release notes in a separate commit.
|
||||
|
||||
c. Re-tag with a incremented "release candidate" number,
|
||||
e.g. ``v3.1.9-rc2``.
|
||||
|
||||
d. Send an email update to ``openexr-dev@lists.aswf.io`` notifying
|
||||
the community of the addition and the new tag.
|
||||
|
||||
7. Publish the release
|
||||
|
||||
a. Click the "Publish release" button on the GitHub release draft
|
||||
|
||||
b. Send an email to ``openexr-dev@lists.aswf.io`` officially
|
||||
annoucing the release.
|
||||
|
||||
8. Update the ``release`` branch, which should always point to the
|
||||
most recent patch of the most recent minor release, i.e. the most
|
||||
preferred release.
|
||||
|
||||
From a clone of the main repo:
|
||||
|
||||
% git checkout release
|
||||
% git merge RB-3.1
|
||||
% git push
|
||||
|
||||
9. Submit a PR that adds the release notes to [CHANGES.md](CHANGES.md)
|
||||
on the main branch. Cherry-pick the release notes commit from
|
||||
the release branch.
|
||||
|
||||
- If any changes have gone into [SECURITY.md](SECURITY), cherry-pick
|
||||
the associated commit as well.
|
||||
|
||||
- Also include in this PR edits to [``docs/news.rst``](docs/news.rst)
|
||||
that add an announcment of the release.
|
||||
|
||||
10. After review/merge of the updates to ``docs/news.rst``, build the
|
||||
website at https://readthedocs.org/projects/openexr.
|
||||
|
||||
11. If the release has resolved any OSS-Fuzz issues, update the
|
||||
associated pages at https://bugs.chromium.org/p/oss-fuzz with a
|
||||
reference to the release.
|
||||
|
||||
12. If the release has resolved any public CVE's, request an update
|
||||
from the registry service providing the release and a link to the
|
||||
release notes.
|
||||
|
||||
## Creating a Major/Minor Release
|
||||
|
||||
A major/minor release is created from the main branch, assuming there
|
||||
are no changes on ``main`` that should *not* go into the release. We
|
||||
don't generally allow experimental changes onto ``main``. Anything
|
||||
accepted onto ``main`` should be intended for the next release.
|
||||
|
||||
The overall workflow is similar to a patch release, as described
|
||||
above, but it's simpler because there is no cherry-picking and merging
|
||||
of commits. The major/minor release is simply a snapshot of ``main``.
|
||||
|
||||
To create a new release from the ``main`` branch:
|
||||
|
||||
1. Confirm that the ``OPENEXR_VERSION_MAJOR``,
|
||||
``OPENEXR_VERSION_MINOR``, and ``OPENEXR_VERSION_PATCH`` value in
|
||||
[src/lib/OpenEXRCore/openexr_version.h](src/lib/OpenEXRCore/openexr_version.h)
|
||||
are correct. The OpenEXR project policy is that the values on the
|
||||
main branch, which is the bleeding edge of development, correspond
|
||||
to the next minor release, with the patch set to 0.
|
||||
|
||||
2. Update the release notes in [CHANGES.md](CHANGES.md):
|
||||
|
||||
- Write a high-level summary of the features and improvements.
|
||||
|
||||
- Include the log of all PR's that have *not* been merged into the
|
||||
previous minor release.
|
||||
|
||||
- Mention any OSS-Fuzz issues. Provide a link in the notes to the issue at
|
||||
https://bugs.chromium.org/p/oss-fuzz, including the issue id
|
||||
number and description.
|
||||
|
||||
- If there are any public CVE's, mention them explicitly with a
|
||||
link to the CVE registry item.
|
||||
|
||||
- Submit this change as a separate PR.
|
||||
|
||||
3. Add a mention of the release to [``docs/news.rst``](docs/news.rst)
|
||||
|
||||
- Submit this change as a separate PR.
|
||||
|
||||
4. Increment the ``OPENEXR_LIB_SOVERSION`` setting in [CMakeLists.txt](CMakeLists.txt).
|
||||
|
||||
- The SO version increases whenever, and only when, the ABI changes
|
||||
in non-backwards-compatible ways. Consistent with the semantic
|
||||
versioning policy, this usually happens at major and minor
|
||||
releases, but never on a patch release.
|
||||
|
||||
- Submit this change as a separate PR for review.
|
||||
|
||||
5. Once the above PR's are merged, create the release branch with the
|
||||
``RB`` prefix, e.g. ``RB-3.2``.
|
||||
|
||||
6. Update the ``IMATH_TAG`` setting in
|
||||
[cmake/OpenEXRSetup.cmake](cmake/OpenEXRSetup.cmake) to correspond
|
||||
to the proper Imath release.
|
||||
|
||||
7. Tag the release with a ``-rc`` "release candidate" tag,
|
||||
e.g. ``v3.2.0-rc``.
|
||||
|
||||
8. Send mail to ``openexr-dev@lists.aswf.io`` announcing the staging
|
||||
of the release with link to the release candidate tag. Include the
|
||||
release notes from [CHANGES.md](CHANGES.md) for review.
|
||||
|
||||
9. If additonal fixes need to go in before release:
|
||||
|
||||
a. Merge commits to the release branch. Push them directly, no need
|
||||
for a pull request.
|
||||
|
||||
b. Update the release notes in a separate commit.
|
||||
|
||||
c. Re-tag with a incremented "release candidate" number,
|
||||
e.g. ``v3.2.0-rc2``.
|
||||
|
||||
d. Send a email update to ``openexr-dev@lists.aswf.io`` notifying
|
||||
the community of the addition.
|
||||
|
||||
10. Draft the release on the GitHub
|
||||
[Releases](https://github.com/AcademySoftwareFoundation/openexr/releases)
|
||||
page. Include the summary from the notes in
|
||||
[CHANGES.md](CHANGES.md), but don't include the list of PR's.
|
||||
|
||||
- Create the release from the latest ``--rc`` tag, and give it a name
|
||||
that begins with ``v`` and ends in ``0``, e.g. ``v3.2.0``.
|
||||
|
||||
- Save the release as a "draft".
|
||||
|
||||
11. Wait at least 48 hours after the email announcement.
|
||||
|
||||
12. Publish the release
|
||||
|
||||
a. Click the "Publish release" button on the GitHub release draft
|
||||
|
||||
b. Send an email to ``openexr-dev@lists.aswf.io`` officially
|
||||
annoucing the release.
|
||||
|
||||
13. Update the ``release`` branch, which should always point to the
|
||||
most recent release.
|
||||
|
||||
From a clone of the main repo:
|
||||
|
||||
% git checkout release
|
||||
% git merge RB-3.1
|
||||
% git push
|
||||
|
||||
14. Increment ``OPENEXR_VERSION_MINOR`` in
|
||||
[src/lib/OpenEXRCore/openexr_version.h](src/lib/OpenEXRCore/openexr_version.h) on the main branch
|
||||
|
||||
- Submit a PR for this. This leaves the release version on the
|
||||
main branch pointing to the next minor release, as described in
|
||||
Step #1.
|
||||
|
||||
15. Build the website at https://readthedocs.org/projects/openexr.
|
||||
|
||||
16. If the release has resolved any OSS-Fuzz issues, update the
|
||||
associated pages at https://bugs.chromium.org/p/oss-fuzz with a
|
||||
reference to the release.
|
||||
|
||||
17. If the release has resolved any public CVE's, request an update
|
||||
from the registry service providing the release and a link to the
|
||||
release notes.
|
||||
@@ -1,71 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
This is a list of contributors to the OpenEXR project, sorted
|
||||
alphabetically by first name.
|
||||
|
||||
If you know of missing, please email: info@openexr.com.
|
||||
|
||||
* Aloys Baillet
|
||||
* Andre Mazzone
|
||||
* Andrew Kunz
|
||||
* Arkady Shapkin
|
||||
* Arkell Rasiah
|
||||
* Brendan Bolles
|
||||
* Cary Phillips
|
||||
* Christina Tempelaar-Lietz
|
||||
* Christopher Horvath
|
||||
* Christopher Kulla
|
||||
* Daniel Kaneider
|
||||
* Darby Johnston
|
||||
* Drew Hess
|
||||
* Ed Hanway
|
||||
* Edward Kmett
|
||||
* Eric Sommerlade
|
||||
* Eric Wimmer
|
||||
* E Sommerlade
|
||||
* Florian Kainz
|
||||
* Halfdan Ingvarsson
|
||||
* Harry Mallon
|
||||
* Ibraheem Alhashim
|
||||
* Jack Kingsman
|
||||
* Jamie Kenyon
|
||||
* Jan Tojnar
|
||||
* Ji Hun Yu
|
||||
* John Loy
|
||||
* John Mertic
|
||||
* Jonathan Stone
|
||||
* Julian Amann
|
||||
* Juri Abramov
|
||||
* Karl Rasche
|
||||
* Kevin Wheatley
|
||||
* Kimball Thurston
|
||||
* Larry Gritz
|
||||
* Liam Fernandez
|
||||
* Lucy Wilkes
|
||||
* Matthäus G. Chajdas
|
||||
* Michael Thomas
|
||||
* Nicholas Yue
|
||||
* Nick Porcino
|
||||
* Nick Rasmussen
|
||||
* Nicolas Chauvet
|
||||
* Niklas Hambüchen
|
||||
* Owen Thompson
|
||||
* Paul Schneider
|
||||
* Peter Hillman
|
||||
* Peter Steneteg
|
||||
* Phil Barrett
|
||||
* Piotr Stanczyk
|
||||
* Ralph Potter
|
||||
* Reto Kromer
|
||||
* Richard Goedeken
|
||||
* Shawn Walker-Salas
|
||||
* Simon Otter
|
||||
* Srinath Ravichandran
|
||||
* Thanh Ha
|
||||
* Thorsten Kaufmann
|
||||
* Wenzel Jakob
|
||||
* Wojciech Jarosz
|
||||
* Xo Wang
|
||||
* Yining Karl Li
|
||||
* Yujie Shu
|
||||
@@ -1,7 +0,0 @@
|
||||
Developers:
|
||||
-----------
|
||||
|
||||
Christopher Horvath <encino@pixar.com>
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
Version 1.0.0:
|
||||
* Initial release of this code.
|
||||
|
||||
Version 1.0.1:
|
||||
* Fixed misinterpretation of values read from "deepopacity" dtex files.
|
||||
The data stored is actually transmission, or 1.0-opacity, which means
|
||||
that "deepopacity" dtex values actually monotonically decrease from 1
|
||||
to 0. We have updated the comments and documentation to reflect this
|
||||
and have fixed the PxOneChanDeepOpacity file to convert the data
|
||||
as it is read out of the file.
|
||||
|
||||
|
||||
|
||||
@@ -1,564 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#include "PxBaseDeepHelper.h"
|
||||
#include "PxDeepOutPixel.h"
|
||||
#include "PxDeepOutRow.h"
|
||||
#include "PxDeepUtils.h"
|
||||
#include "PxFourChanDeepRgba.h"
|
||||
#include "PxOneChanDeepAlpha.h"
|
||||
#include "PxOneChanDeepOpacity.h"
|
||||
|
||||
#include <dtex.h>
|
||||
|
||||
#include <ImfChannelList.h>
|
||||
#include <ImfDeepScanLineOutputFile.h>
|
||||
#include <ImfHeader.h>
|
||||
#include <ImfPartType.h>
|
||||
#include <ImfStandardAttributes.h>
|
||||
|
||||
#include <ImathBox.h>
|
||||
#include <ImathMatrix.h>
|
||||
#include <ImathVec.h>
|
||||
|
||||
#include <half.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <float.h>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
//-*****************************************************************************
|
||||
// DTEX CONVERTER EXPLANATION!
|
||||
//-*****************************************************************************
|
||||
// There are six possible code paths through converting the dtex data. They are:
|
||||
// DeepOpacity, Continuous
|
||||
// DeepOpacity, Discrete
|
||||
// DeepAlpha, Continuous
|
||||
// DeepAlpha, Discrete
|
||||
// DeepRGBA, Continuous
|
||||
// DeepRGBA, Discrete
|
||||
// The newer dtex usages allow for other combinations of channels, but we
|
||||
// are temporarily just supporting these six paths for sake of simplicity.
|
||||
// We will eventually support arbitrary outputs and multiple views.
|
||||
//
|
||||
// We had an earlier version of this code which condensed these six code
|
||||
// pathways into a single function, with templated functors to provide
|
||||
// specific differing behavior for each of the different possibilities, and
|
||||
// while it may have been slightly less code, the resulting loops were very hard
|
||||
// to read and understand. Because each of the different pathways
|
||||
// has some specific kernel of knowledge necessary to make it work, we
|
||||
// chose instead to break each one out separately, to clearly expose the
|
||||
// behavior in each case.
|
||||
//
|
||||
// The terminology for Density, Visibility, DeepOpacity, DepthRanges,
|
||||
// along with explanations of the constants are provided in
|
||||
// PxDeepUtils.h
|
||||
//
|
||||
// Our DeepOutPixel helper class is in PxDeepOutPixel.h
|
||||
//
|
||||
// Our DeepOutRow helper class is in PxDeepOutRow.h
|
||||
//
|
||||
// The Base Helper class, which loops over rows, and then pixels of those
|
||||
// rows, is in PxBaseDeepHelper.h
|
||||
//
|
||||
// The DeepOpacity subclasses (discrete/continuous) of BaseDeepHelper are in
|
||||
// PxOneChanDeepOpacity.h
|
||||
//
|
||||
// The DeepAlpha subclasses (discrete/continuous) of BaseDeepHelper are in
|
||||
// PxOneChanDeepAlpha.h
|
||||
//
|
||||
// The DeepRgba subclasses (discrete/continuous) of BaseDeepHelper are in
|
||||
// PxFourChanDeepAlpha.h
|
||||
//
|
||||
//-*****************************************************************************
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
ConvertDtexFile (
|
||||
const std::string& i_fileName,
|
||||
const std::string& i_outFileName,
|
||||
const Parameters& i_params)
|
||||
{
|
||||
int dtexOpenError = DTEX_NOERR;
|
||||
DtexFile* dtexFile = NULL;
|
||||
DtexCache* dtexCache = NULL;
|
||||
|
||||
if (i_fileName.length ())
|
||||
{
|
||||
// We probably don't need 10000 tiles in the cache, but it's
|
||||
// fine for now.
|
||||
dtexCache = DtexCreateCache (10000, NULL);
|
||||
dtexOpenError =
|
||||
DtexOpenFile (i_fileName.c_str (), "rb", dtexCache, &dtexFile);
|
||||
}
|
||||
|
||||
if (!dtexFile)
|
||||
{
|
||||
if (i_fileName.length () == 0) { PXDU_THROW ("no filename specified"); }
|
||||
else if (dtexOpenError != DTEX_NOERR)
|
||||
{
|
||||
PXDU_THROW (
|
||||
"error (" << dtexOpenError << " opening file: " << i_fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
PXDU_THROW ("missing file: " << i_fileName);
|
||||
}
|
||||
}
|
||||
|
||||
// Just handling the first image in the Dtex file for now.
|
||||
DtexImage* image;
|
||||
DtexGetImageByIndex (dtexFile, 0, &image);
|
||||
|
||||
float NP[16];
|
||||
DtexNP (image, NP);
|
||||
|
||||
float Nl[16];
|
||||
DtexNl (image, Nl);
|
||||
|
||||
int numDtexChans = DtexNumChan (image);
|
||||
|
||||
if (numDtexChans != 1 && numDtexChans != 3 && numDtexChans != 4)
|
||||
{
|
||||
DtexClose (dtexFile);
|
||||
PXDU_THROW (
|
||||
"ERROR: only 1, 3 or 4 channel dtex files are supported.\n"
|
||||
<< "Dtex file " << i_fileName << " contains " << numDtexChans
|
||||
<< " channels.\n"
|
||||
<< "In the case of 3 channels, the data is assumed to be\n"
|
||||
<< "3-channel opacity, and for now, at least, only the\n"
|
||||
<< "first channel is used, rather than all three.\n");
|
||||
}
|
||||
|
||||
int w = DtexWidth (image);
|
||||
int h = DtexHeight (image);
|
||||
|
||||
// Extract the parameters so we can conditionally modify them.
|
||||
Parameters params = i_params;
|
||||
|
||||
// If we're reading anything more than 1 channel,
|
||||
// we can't (for now) assume it's a deepOpacity signal,
|
||||
// so we turn off the deepOpacity flag.
|
||||
// We also make sure RGB is turned on when RGB data is present.
|
||||
if (numDtexChans == 4)
|
||||
{
|
||||
params.deepOpacity = false;
|
||||
params.doRGB = true;
|
||||
}
|
||||
|
||||
// If we're discrete, we don't necessarily need to output deepBack.
|
||||
// However, from a pipeline point of view it is often preferable to have
|
||||
// all the channels actually in existence, even if they're redundant.
|
||||
// Nonetheless, if
|
||||
if (!params.discrete) { params.doDeepBack = true; }
|
||||
|
||||
// Determine the output size
|
||||
int outWidth = w;
|
||||
int outHeight = h;
|
||||
if (params.sideways)
|
||||
{
|
||||
outWidth = h;
|
||||
outHeight = w;
|
||||
}
|
||||
|
||||
// Create the windows.
|
||||
Imath::Box2i dataWindow (
|
||||
Imath::V2i (0, 0), Imath::V2i (outWidth - 1, outHeight - 1));
|
||||
Imath::Box2i displayWindow = dataWindow;
|
||||
|
||||
// Create the header.
|
||||
Imf::Header header (
|
||||
displayWindow,
|
||||
dataWindow,
|
||||
1,
|
||||
Imath::V2f (0.0f, 0.0f),
|
||||
1,
|
||||
Imf::INCREASING_Y,
|
||||
Imf::ZIPS_COMPRESSION);
|
||||
|
||||
// Add Np/Nl to the header.
|
||||
Imath::M44f NPm (
|
||||
NP[0],
|
||||
NP[1],
|
||||
NP[2],
|
||||
NP[3],
|
||||
NP[4],
|
||||
NP[5],
|
||||
NP[6],
|
||||
NP[7],
|
||||
NP[8],
|
||||
NP[9],
|
||||
NP[10],
|
||||
NP[11],
|
||||
NP[12],
|
||||
NP[13],
|
||||
NP[14],
|
||||
NP[15]);
|
||||
addWorldToNDC (header, NPm);
|
||||
|
||||
Imath::M44f Nlm (
|
||||
Nl[0],
|
||||
Nl[1],
|
||||
Nl[2],
|
||||
Nl[3],
|
||||
Nl[4],
|
||||
Nl[5],
|
||||
Nl[6],
|
||||
Nl[7],
|
||||
Nl[8],
|
||||
Nl[9],
|
||||
Nl[10],
|
||||
Nl[11],
|
||||
Nl[12],
|
||||
Nl[13],
|
||||
Nl[14],
|
||||
Nl[15]);
|
||||
addWorldToCamera (header, Nlm);
|
||||
|
||||
// Add channels to the header.
|
||||
|
||||
// RGB
|
||||
if (params.doRGB)
|
||||
{
|
||||
header.channels ().insert ("R", Imf::Channel (ImfPixelType<RGBA_T> ()));
|
||||
header.channels ().insert ("G", Imf::Channel (ImfPixelType<RGBA_T> ()));
|
||||
header.channels ().insert ("B", Imf::Channel (ImfPixelType<RGBA_T> ()));
|
||||
}
|
||||
|
||||
// A
|
||||
header.channels ().insert ("A", Imf::Channel (ImfPixelType<RGBA_T> ()));
|
||||
|
||||
// Deep Front (z)
|
||||
header.channels ().insert ("Z", Imf::Channel (Imf::FLOAT));
|
||||
|
||||
// Deep Back
|
||||
if (params.doDeepBack)
|
||||
{
|
||||
header.channels ().insert ("ZBack", Imf::Channel (Imf::FLOAT));
|
||||
}
|
||||
|
||||
// Tell header to be deep!
|
||||
header.setType (Imf::DEEPSCANLINE);
|
||||
|
||||
// Create output file, and fill it up!
|
||||
{
|
||||
Imf::DeepScanLineOutputFile outputFile (i_outFileName.c_str (), header);
|
||||
|
||||
// Process deep pixels.
|
||||
if (numDtexChans < 4)
|
||||
{
|
||||
if (params.discrete)
|
||||
{
|
||||
if (params.deepOpacity)
|
||||
{
|
||||
OneChanDeepOpacityDiscrete<RGBA_T> op (
|
||||
dtexFile, numDtexChans, params);
|
||||
op.processDeepBox (outputFile, dataWindow);
|
||||
}
|
||||
else
|
||||
{
|
||||
OneChanDeepAlphaDiscrete<RGBA_T> op (
|
||||
dtexFile, numDtexChans, params);
|
||||
op.processDeepBox (outputFile, dataWindow);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (params.deepOpacity)
|
||||
{
|
||||
OneChanDeepOpacityContinuous<RGBA_T> op (
|
||||
dtexFile, numDtexChans, params);
|
||||
op.processDeepBox (outputFile, dataWindow);
|
||||
}
|
||||
else
|
||||
{
|
||||
OneChanDeepAlphaContinuous<RGBA_T> op (
|
||||
dtexFile, numDtexChans, params);
|
||||
op.processDeepBox (outputFile, dataWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (params.discrete)
|
||||
{
|
||||
FourChanDeepRgbaDiscrete<RGBA_T> op (
|
||||
dtexFile, numDtexChans, params);
|
||||
op.processDeepBox (outputFile, dataWindow);
|
||||
}
|
||||
else
|
||||
{
|
||||
FourChanDeepRgbaContinuous<RGBA_T> op (
|
||||
dtexFile, numDtexChans, params);
|
||||
op.processDeepBox (outputFile, dataWindow);
|
||||
}
|
||||
}
|
||||
} // Output file has gone out of scope, and should be closed!
|
||||
std::cout << "Wrote file: " << i_outFileName << std::endl;
|
||||
|
||||
// Close it up!
|
||||
if (dtexFile) { DtexClose (dtexFile); }
|
||||
|
||||
if (dtexCache) { DtexDestroyCache (dtexCache); }
|
||||
}
|
||||
|
||||
} // End namespace PxDeep
|
||||
|
||||
//-*****************************************************************************
|
||||
// Print Usage.
|
||||
void
|
||||
PrintUsage (const std::string& i_cmd, std::ostream& ostr)
|
||||
{
|
||||
ostr << "DtexToExr: USAGE: " << i_cmd << std::endl
|
||||
<< std::endl
|
||||
<< "\t <inFileName.dtex>" << std::endl
|
||||
<< std::endl
|
||||
<< "\t <outFileName.exr>" << std::endl
|
||||
<< std::endl
|
||||
<< "\t --deepOpacity (DEFAULT) "
|
||||
<< "\n\t\t (corresponds to output channels \'deepopacity\')"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< "\t --deepAlpha "
|
||||
<< "\n\t\t (corresponds to output channels \'a\' or \'rgba\')"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< "\t --discrete (DEFAULT) "
|
||||
<< "\n\t\t (corresponds to \'volumeinterpretation discrete\')"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< "\t --continuous "
|
||||
<< "\n\t\t (corresponds to \'volumeinterpretation continuous\')"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< "\t --full "
|
||||
<< "\n\t\t (use full 32-bit precision for non-depth (RGBA) data)"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< "\t --half (DEFAULT) "
|
||||
<< "\n\t\t (use half 16-bit precision for non-depth (RGBA) data)"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< "\t --multRgb "
|
||||
<< "\n\t\t (multiply RGB data by Alpha, "
|
||||
<< "implying that source data is unpremultiplied)" << std::endl
|
||||
<< std::endl
|
||||
<< "\t --sideways [true|false]"
|
||||
<< "\n\t\t (rotate image 90 deg clockwise)" << std::endl
|
||||
<< std::endl
|
||||
<< "\t --compressionError <float> (DEFAULT: 0.0f) "
|
||||
<< "\n\t\t (compress dtex data before converting to deep exr)"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< "\t --keepZeroAlpha "
|
||||
<< "\n\t\t (don\'t discard samples with zero alpha)" << std::endl
|
||||
<< std::endl
|
||||
<< "\t --discardZeroAlpha (DEFAULT) "
|
||||
<< "\n\t\t (discard samples with zero alpha)" << std::endl
|
||||
<< std::endl
|
||||
<< "\t -h,--h,--help "
|
||||
<< "\n\t\t (print this message and exit)" << std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
inline bool
|
||||
GoodFileName (const std::string& i_fileName)
|
||||
{
|
||||
return !((
|
||||
i_fileName.length () == 0 || i_fileName == "" || i_fileName[0] == '-'));
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// Argument parsing. So inelegant, but libarg is not widely supported, and
|
||||
// boost::program_options is, well, boost. Also - not particularly awesome.
|
||||
void
|
||||
ParseArguments (
|
||||
int argc,
|
||||
char* argv[],
|
||||
bool& o_full,
|
||||
std::string& o_dtexFileName,
|
||||
std::string& o_exrFileName,
|
||||
PxDeep::Parameters& o_params)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
PrintUsage (argv[0], std::cerr);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
// Make our params match what the usage string says by default.
|
||||
o_full = false;
|
||||
o_dtexFileName = "";
|
||||
o_exrFileName = "";
|
||||
o_params.deepOpacity = true;
|
||||
o_params.discrete = true;
|
||||
o_params.multiplyColorByAlpha = false;
|
||||
o_params.sideways = false;
|
||||
o_params.discardZeroAlphaSamples = true;
|
||||
o_params.doDeepBack = true;
|
||||
o_params.doRGB = false;
|
||||
o_params.compressionError = 0.0f;
|
||||
|
||||
// Eat up the args!
|
||||
for (int argi = 1; argi < argc; ++argi)
|
||||
{
|
||||
std::string arg = argv[argi];
|
||||
|
||||
if (arg == "-h" || arg == "-help" || arg == "--help")
|
||||
{
|
||||
PrintUsage (argv[0], std::cerr);
|
||||
exit (-1);
|
||||
}
|
||||
else if (argi == 1)
|
||||
{
|
||||
if (!GoodFileName (arg))
|
||||
{
|
||||
PrintUsage (argv[0], std::cerr);
|
||||
PXDU_THROW ("Bad file name: " << arg);
|
||||
}
|
||||
o_dtexFileName = arg;
|
||||
}
|
||||
else if (argi == 2)
|
||||
{
|
||||
if (!GoodFileName (arg))
|
||||
{
|
||||
PrintUsage (argv[0], std::cerr);
|
||||
PXDU_THROW ("Bad file name: " << arg);
|
||||
}
|
||||
o_exrFileName = arg;
|
||||
}
|
||||
else if (arg == "--deepOpacity")
|
||||
{
|
||||
o_params.deepOpacity = true;
|
||||
}
|
||||
else if (arg == "--deepAlpha")
|
||||
{
|
||||
o_params.deepOpacity = false;
|
||||
}
|
||||
else if (arg == "--discrete")
|
||||
{
|
||||
o_params.discrete = true;
|
||||
}
|
||||
else if (arg == "--continuous")
|
||||
{
|
||||
o_params.discrete = false;
|
||||
}
|
||||
else if (arg == "--full")
|
||||
{
|
||||
o_full = true;
|
||||
}
|
||||
else if (arg == "--half")
|
||||
{
|
||||
o_full = false;
|
||||
}
|
||||
else if (arg == "--multRgb")
|
||||
{
|
||||
o_params.multiplyColorByAlpha = true;
|
||||
}
|
||||
else if (arg == "--sideways")
|
||||
{
|
||||
if (argi <= argc - 1)
|
||||
{
|
||||
std::cout << argv[argi + 1] << std::endl;
|
||||
if (strcmp (argv[argi + 1], "true") == 0)
|
||||
{
|
||||
o_params.sideways = true;
|
||||
++argi;
|
||||
}
|
||||
else if (strcmp (argv[argi + 1], "false") == 0)
|
||||
{
|
||||
o_params.sideways = false;
|
||||
++argi;
|
||||
}
|
||||
else if (argv[argi + 1][0] == '-')
|
||||
{
|
||||
// found another arg. sideways has no parameter, which means sideways is on.
|
||||
o_params.sideways = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// sideways must be followed by "true", "false", another arg, or nothing.
|
||||
PXDU_THROW (
|
||||
"Invalid parameter for --sideways: " << argv[argi + 1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
o_params.sideways = true;
|
||||
}
|
||||
}
|
||||
else if (arg == "--compressionError")
|
||||
{
|
||||
if (argi >= argc - 1)
|
||||
{
|
||||
PrintUsage (argv[0], std::cerr);
|
||||
PXDU_THROW ("Unspecified compression error.");
|
||||
}
|
||||
|
||||
o_params.compressionError = atof (argv[argi + 1]);
|
||||
++argi;
|
||||
}
|
||||
else if (arg == "--keepZeroAlpha")
|
||||
{
|
||||
o_params.discardZeroAlphaSamples = false;
|
||||
}
|
||||
else if (arg == "--discardZeroAlpha")
|
||||
{
|
||||
o_params.discardZeroAlphaSamples = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintUsage (argv[0], std::cerr);
|
||||
PXDU_THROW ("Unknown command line argument: " << arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// MAIN FUNCTION
|
||||
//-*****************************************************************************
|
||||
int
|
||||
main (int argc, char* argv[])
|
||||
{
|
||||
try
|
||||
{
|
||||
PxDeep::Parameters params;
|
||||
std::string dtexFileName;
|
||||
std::string exrFileName;
|
||||
bool full;
|
||||
|
||||
ParseArguments (argc, argv, full, dtexFileName, exrFileName, params);
|
||||
|
||||
if (full)
|
||||
{
|
||||
PxDeep::ConvertDtexFile<float> (dtexFileName, exrFileName, params);
|
||||
}
|
||||
else
|
||||
{
|
||||
PxDeep::ConvertDtexFile<half> (dtexFileName, exrFileName, params);
|
||||
}
|
||||
}
|
||||
catch (std::exception& exc)
|
||||
{
|
||||
std::cerr << "ERROR EXCEPTION: " << exc.what () << std::endl;
|
||||
exit (-1);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "UNKNOWN EXCEPTION." << std::endl;
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
##
|
||||
## SPDX-License-Identifier: BSD-3-Clause
|
||||
## Copyright (c) Contributors to the OpenEXR Project.
|
||||
##
|
||||
|
||||
BUILDTMP = obj
|
||||
|
||||
IPATH = -I${DTEXTOEXR_PREFIX}/include/OpenEXR \
|
||||
-I${DTEXTOEXR_RMANROOT}/include/prmansdk-160 \
|
||||
-I${DTEXTOEXR_RMANROOT}/include
|
||||
|
||||
LPATH = -L${DTEXTOEXR_PREFIX}/lib \
|
||||
-L${DTEXTOEXR_RMANROOT}/lib/prmansdk-160 \
|
||||
-L${DTEXTOEXR_RMANROOT}/lib \
|
||||
-Wl,-rpath ${DTEXTOEXR_PREFIX}/lib \
|
||||
-Wl,-rpath ${DTEXTOEXR_RMANROOT}/lib/prmansdk-160 \
|
||||
-Wl,-rpath ${DTEXTOEXR_RMANROOT}/lib
|
||||
|
||||
LIBS = -lOpenEXR -lImath -lIlmThread -lIex -lHalf \
|
||||
-lprman \
|
||||
-lpthread -lm
|
||||
|
||||
CXX = /usr/bin/g++
|
||||
LN = /usr/bin/g++
|
||||
|
||||
CFLAGS = -g
|
||||
|
||||
HFILES = PxBaseDeepHelper.h \
|
||||
PxDeepOutPixel.h \
|
||||
PxDeepOutRow.h \
|
||||
PxDeepUtils.h \
|
||||
PxFourChanDeepRgba.h \
|
||||
PxOneChanDeepAlpha.h \
|
||||
PxOneChanDeepOpacity.h
|
||||
|
||||
OFILES = ${BUILDTMP}/PxDeepUtils.o \
|
||||
${BUILDTMP}/DtexToExr.o
|
||||
|
||||
all: ${BUILDTMP}/DtexToExr
|
||||
|
||||
${BUILDTMP}/PxDeepUtils.o: PxDeepUtils.h PxDeepUtils.cpp
|
||||
mkdir -p ${BUILDTMP}
|
||||
${CXX} PxDeepUtils.cpp -c -o ${BUILDTMP}/PxDeepUtils.o ${CFLAGS} ${IPATH}
|
||||
|
||||
|
||||
${BUILDTMP}/DtexToExr.o: DtexToExr.cpp ${HFILES}
|
||||
mkdir -p ${BUILDTMP}
|
||||
${CXX} DtexToExr.cpp -c -o ${BUILDTMP}/DtexToExr.o ${CFLAGS} ${IPATH}
|
||||
|
||||
${BUILDTMP}/DtexToExr: ${OFILES}
|
||||
mkdir -p ${BUILDTMP}
|
||||
${LN} ${OFILES} -o ${BUILDTMP}/DtexToExr ${CFLAGS} ${IPATH} ${LPATH} ${LIBS}
|
||||
|
||||
install: ${BUILDTMP}/DtexToExr
|
||||
/bin/cp -f ${BUILDTMP}/DtexToExr ${DTEXTOEXR_PREFIX}/bin/DtexToExr
|
||||
|
||||
clean:
|
||||
/bin/rm ${OFILES}
|
||||
/bin/rm ${BUILDTMP}/DtexToExr
|
||||
@@ -1,277 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef _PxDeepBaseHelper_h_
|
||||
#define _PxDeepBaseHelper_h_
|
||||
|
||||
#include "PxDeepOutPixel.h"
|
||||
#include "PxDeepOutRow.h"
|
||||
#include "PxDeepUtils.h"
|
||||
|
||||
#include <dtex.h>
|
||||
|
||||
#include <ImfChannelList.h>
|
||||
#include <ImfDeepScanLineOutputFile.h>
|
||||
#include <ImfPartType.h>
|
||||
|
||||
#include <ImathBox.h>
|
||||
#include <ImathVec.h>
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
// PARAMETERS STRUCT
|
||||
//-*****************************************************************************
|
||||
// This allows us to keep function signatures from changing around too much
|
||||
// as the parameter set grows & changes, which it always does.
|
||||
struct Parameters
|
||||
{
|
||||
Parameters ()
|
||||
: deepOpacity (true)
|
||||
, discrete (true)
|
||||
, multiplyColorByAlpha (false)
|
||||
, sideways (false)
|
||||
, discardZeroAlphaSamples (true)
|
||||
, doDeepBack (true)
|
||||
, doRGB (true)
|
||||
, compressionError (0.0f)
|
||||
{}
|
||||
|
||||
bool deepOpacity;
|
||||
bool discrete;
|
||||
bool multiplyColorByAlpha;
|
||||
bool sideways;
|
||||
bool discardZeroAlphaSamples;
|
||||
bool doDeepBack;
|
||||
bool doRGB;
|
||||
float compressionError;
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
// BASE DEEP HELPER CLASS
|
||||
//-*****************************************************************************
|
||||
// The intention of this templated base class is to provide consistent
|
||||
// storage vectors for spans and deep pixels across multiple pixel reads,
|
||||
// so we don't slow down constantly creating and destroying std::vectors.
|
||||
// This class has a "processDeepBox" function which does the work.
|
||||
template <typename RGBA_T, typename DERIVED, typename SPAN> class BaseDeepHelper
|
||||
{
|
||||
public:
|
||||
typedef DERIVED sub_type;
|
||||
typedef SPAN span_type;
|
||||
|
||||
BaseDeepHelper (
|
||||
DtexFile* i_dtexFile, int i_numDtexChans, const Parameters& i_params)
|
||||
: m_dtexFile (i_dtexFile)
|
||||
, m_numDtexChans (i_numDtexChans)
|
||||
, m_params (i_params)
|
||||
{
|
||||
m_image = NULL;
|
||||
DtexGetImageByIndex (m_dtexFile, 0, &m_image);
|
||||
|
||||
m_fileWidth = DtexWidth (m_image);
|
||||
m_fileHeight = DtexHeight (m_image);
|
||||
|
||||
m_pixel = DtexMakePixel (m_numDtexChans);
|
||||
m_rawPixel = DtexMakePixel (m_numDtexChans);
|
||||
}
|
||||
|
||||
~BaseDeepHelper ()
|
||||
{
|
||||
DtexDestroyPixel (m_pixel);
|
||||
DtexDestroyPixel (m_rawPixel);
|
||||
}
|
||||
|
||||
void processDeepBox (
|
||||
Imf::DeepScanLineOutputFile& o_file, const Imath::Box2i& i_box);
|
||||
|
||||
protected:
|
||||
DtexFile* m_dtexFile;
|
||||
int m_numDtexChans;
|
||||
Parameters m_params;
|
||||
|
||||
DtexImage* m_image;
|
||||
int m_fileWidth;
|
||||
int m_fileHeight;
|
||||
DtexPixel* m_pixel;
|
||||
DtexPixel* m_rawPixel;
|
||||
|
||||
std::vector<span_type> m_spans;
|
||||
DeepOutPixel<RGBA_T> m_deepOutPixel;
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
// SPAN CLASSES
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
|
||||
//-*****************************************************************************
|
||||
// These span objects are used by the helper classes below to keep track
|
||||
// of the information read out of the DTEX file, so it can be processed.
|
||||
// They have an ordering operator which sorts them by depth and then index.
|
||||
// We use double precision for 'viz', for reasons described in the 'VIZ'
|
||||
// section of the explanatory comments in the PxDeepUtils library.
|
||||
struct Span
|
||||
{
|
||||
Span () : in (0.0f), out (0.0f), viz (0.0), index (0) {}
|
||||
|
||||
float in;
|
||||
float out;
|
||||
double viz;
|
||||
int index;
|
||||
|
||||
void clear ()
|
||||
{
|
||||
in = 0.0f;
|
||||
out = 0.0f;
|
||||
viz = 0.0;
|
||||
index = 0;
|
||||
}
|
||||
|
||||
bool operator< (const Span& i_other) const
|
||||
{
|
||||
if (in < i_other.in) { return true; }
|
||||
else if (in == i_other.in)
|
||||
{
|
||||
return index < i_other.index;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
// Because the RGB values here are unpremultiplied, we use double precision
|
||||
// to avoid precision loss when going (RGB/A)*A.
|
||||
struct SpanRgba : public Span
|
||||
{
|
||||
SpanRgba () : Span ()
|
||||
{
|
||||
rgb[0] = 0.0;
|
||||
rgb[1] = 0.0;
|
||||
rgb[2] = 0.0;
|
||||
}
|
||||
|
||||
double rgb[3];
|
||||
|
||||
void clear ()
|
||||
{
|
||||
Span::clear ();
|
||||
rgb[0] = 0.0;
|
||||
rgb[1] = 0.0;
|
||||
rgb[2] = 0.0;
|
||||
}
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
// As above, we use double precision for viz.
|
||||
struct SpanOpac : public Span
|
||||
{
|
||||
SpanOpac () : Span (), deepViz (0.0) {}
|
||||
|
||||
double deepViz;
|
||||
|
||||
void clear ()
|
||||
{
|
||||
Span::clear ();
|
||||
deepViz = 0.0;
|
||||
}
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
// The box processing simply loops over the rows, compresses each pixel, then
|
||||
// converts from dtex representation to deep exr representation, and finally
|
||||
// writes the rows to the file.
|
||||
template <typename RGBA_T, typename DERIVED, typename SPAN>
|
||||
void
|
||||
BaseDeepHelper<RGBA_T, DERIVED, SPAN>::processDeepBox (
|
||||
Imf::DeepScanLineOutputFile& o_file, const Imath::Box2i& i_box)
|
||||
{
|
||||
int width = (i_box.max.x - i_box.min.x) + 1;
|
||||
|
||||
DeepOutRow<RGBA_T> outRow (width, m_params.doDeepBack, m_params.doRGB);
|
||||
|
||||
for (int y = i_box.max.y; y >= i_box.min.y; --y)
|
||||
{
|
||||
outRow.clear ();
|
||||
|
||||
for (int x = i_box.min.x; x <= i_box.max.x; ++x)
|
||||
{
|
||||
if (m_params.sideways)
|
||||
{
|
||||
DtexGetPixel (
|
||||
m_image,
|
||||
m_fileWidth - 1 - y,
|
||||
m_fileHeight - 1 - x,
|
||||
m_rawPixel);
|
||||
}
|
||||
else
|
||||
{
|
||||
DtexGetPixel (m_image, x, m_fileHeight - 1 - y, m_rawPixel);
|
||||
}
|
||||
|
||||
// Get the number of input points.
|
||||
int numPointsIn = DtexPixelGetNumPoints (m_rawPixel);
|
||||
if (numPointsIn < 0)
|
||||
{
|
||||
PXDU_THROW (
|
||||
"Negative num points returned at dtex pixel: " << x << ", "
|
||||
<< y);
|
||||
}
|
||||
|
||||
// Compress the pixel.
|
||||
if (numPointsIn > 1 && m_params.compressionError > 0.0f)
|
||||
{
|
||||
DtexCompressPixel (
|
||||
m_rawPixel, m_pixel, m_params.compressionError);
|
||||
DtexFinishPixel (m_pixel);
|
||||
}
|
||||
else
|
||||
{
|
||||
DtexCopyPixel (m_pixel, m_rawPixel);
|
||||
DtexFinishPixel (m_pixel);
|
||||
}
|
||||
|
||||
// Get num points of compressed pixel.
|
||||
int numPts = DtexPixelGetNumPoints (m_pixel);
|
||||
|
||||
// If no samples here, continue on.
|
||||
if (numPts < 1)
|
||||
{
|
||||
outRow.addHole (x - i_box.min.x);
|
||||
continue;
|
||||
}
|
||||
|
||||
m_deepOutPixel.clear ();
|
||||
m_deepOutPixel.reserve (numPts * m_numDtexChans);
|
||||
|
||||
// Process the deep pixels.
|
||||
DERIVED* derivedThis = static_cast<DERIVED*> (this);
|
||||
derivedThis->processDeepPixel (numPts);
|
||||
|
||||
// Add the pixel to the row.
|
||||
outRow.addPixel (x - i_box.min.x, m_deepOutPixel);
|
||||
}
|
||||
|
||||
// Create the frame buffer.
|
||||
// I'm not sure if this can be reused from row to row.
|
||||
Imf::DeepFrameBuffer frameBuffer;
|
||||
|
||||
// Set the deep out row into the framebuffer.
|
||||
outRow.setFrameBuffer (frameBuffer);
|
||||
|
||||
// Write row.
|
||||
o_file.setFrameBuffer (frameBuffer);
|
||||
o_file.writePixels (1);
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace PxDeep
|
||||
|
||||
#endif
|
||||
@@ -1,106 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef _PxDeepOutPixel_h_
|
||||
#define _PxDeepOutPixel_h_
|
||||
|
||||
#include "PxDeepUtils.h"
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
// DEEP OUT PIXEL
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
// While constructing a deep out pixel from a dtex pixel, we reuse some
|
||||
// temporary storage.
|
||||
template <typename RGBA_T> struct DeepOutPixel
|
||||
{
|
||||
size_t size () const { return deepFront.size (); }
|
||||
|
||||
void clear ()
|
||||
{
|
||||
deepFront.clear ();
|
||||
deepBack.clear ();
|
||||
red.clear ();
|
||||
green.clear ();
|
||||
blue.clear ();
|
||||
alpha.clear ();
|
||||
}
|
||||
|
||||
void reserve (size_t N)
|
||||
{
|
||||
deepFront.reserve (N);
|
||||
deepBack.reserve (N);
|
||||
red.reserve (N);
|
||||
green.reserve (N);
|
||||
blue.reserve (N);
|
||||
alpha.reserve (N);
|
||||
}
|
||||
|
||||
void push_back (float i_depth, RGBA_T i_alpha)
|
||||
{
|
||||
deepFront.push_back (i_depth);
|
||||
deepBack.push_back (i_depth);
|
||||
red.push_back (0.0f);
|
||||
green.push_back (0.0f);
|
||||
blue.push_back (0.0f);
|
||||
alpha.push_back (i_alpha);
|
||||
}
|
||||
|
||||
void push_back (float i_deepFront, float i_deepBack, RGBA_T i_alpha)
|
||||
{
|
||||
deepFront.push_back (i_deepFront);
|
||||
deepBack.push_back (i_deepBack);
|
||||
red.push_back (0.0f);
|
||||
green.push_back (0.0f);
|
||||
blue.push_back (0.0f);
|
||||
alpha.push_back (i_alpha);
|
||||
}
|
||||
|
||||
void push_back (
|
||||
float i_depth,
|
||||
RGBA_T i_red,
|
||||
RGBA_T i_green,
|
||||
RGBA_T i_blue,
|
||||
RGBA_T i_alpha)
|
||||
{
|
||||
deepFront.push_back (i_depth);
|
||||
deepBack.push_back (i_depth);
|
||||
red.push_back (i_red);
|
||||
green.push_back (i_green);
|
||||
blue.push_back (i_blue);
|
||||
alpha.push_back (i_alpha);
|
||||
}
|
||||
|
||||
void push_back (
|
||||
float i_deepFront,
|
||||
float i_deepBack,
|
||||
RGBA_T i_red,
|
||||
RGBA_T i_green,
|
||||
RGBA_T i_blue,
|
||||
RGBA_T i_alpha)
|
||||
{
|
||||
deepFront.push_back (i_deepFront);
|
||||
deepBack.push_back (i_deepBack);
|
||||
red.push_back (i_red);
|
||||
green.push_back (i_green);
|
||||
blue.push_back (i_blue);
|
||||
alpha.push_back (i_alpha);
|
||||
}
|
||||
|
||||
std::vector<float> deepFront;
|
||||
std::vector<float> deepBack;
|
||||
std::vector<RGBA_T> red;
|
||||
std::vector<RGBA_T> green;
|
||||
std::vector<RGBA_T> blue;
|
||||
std::vector<RGBA_T> alpha;
|
||||
};
|
||||
|
||||
} // namespace PxDeep
|
||||
|
||||
#endif
|
||||
@@ -1,236 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef _PxDeepOutRow_h_
|
||||
#define _PxDeepOutRow_h_
|
||||
|
||||
#include "PxDeepOutPixel.h"
|
||||
#include "PxDeepUtils.h"
|
||||
|
||||
#include <ImfChannelList.h>
|
||||
#include <ImfDeepFrameBuffer.h>
|
||||
#include <ImfDeepScanLineOutputFile.h>
|
||||
#include <ImfPartType.h>
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
// DEEP OUT ROW
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T> class DeepOutRow
|
||||
{
|
||||
public:
|
||||
DeepOutRow (int i_width, bool i_doDeepBack, bool i_doRGB);
|
||||
|
||||
void clear ();
|
||||
|
||||
void addHole (int i_x) { m_sampleCounts[i_x] = 0; }
|
||||
|
||||
void addPixel (int i_x, const DeepOutPixel<RGBA_T>& i_pixel);
|
||||
|
||||
void setFrameBuffer (Imf::DeepFrameBuffer& o_frameBuffer);
|
||||
|
||||
protected:
|
||||
// Width of the row.
|
||||
int m_width;
|
||||
|
||||
// Whether or not to bother with deep back
|
||||
bool m_doDeepBack;
|
||||
|
||||
// Whether or not to bother with RGB
|
||||
bool m_doRGB;
|
||||
|
||||
// Scanline sample buffers.
|
||||
std::vector<uint> m_sampleCounts;
|
||||
|
||||
// The pointers to data at each pixel
|
||||
std::vector<float*> m_deepFrontPtrs;
|
||||
std::vector<float*> m_deepBackPtrs;
|
||||
std::vector<RGBA_T*> m_redPtrs;
|
||||
std::vector<RGBA_T*> m_greenPtrs;
|
||||
std::vector<RGBA_T*> m_bluePtrs;
|
||||
std::vector<RGBA_T*> m_alphaPtrs;
|
||||
|
||||
// The data itself.
|
||||
std::vector<float> m_deepFrontSamples;
|
||||
std::vector<float> m_deepBackSamples;
|
||||
std::vector<RGBA_T> m_redSamples;
|
||||
std::vector<RGBA_T> m_greenSamples;
|
||||
std::vector<RGBA_T> m_blueSamples;
|
||||
std::vector<RGBA_T> m_alphaSamples;
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename T>
|
||||
inline void
|
||||
VecAppend (T& i_dst, const T& i_src)
|
||||
{
|
||||
i_dst.insert (i_dst.end (), i_src.begin (), i_src.end ());
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
DeepOutRow<RGBA_T>::DeepOutRow (int i_width, bool i_doDeepBack, bool i_doRGB)
|
||||
: m_width (i_width), m_doDeepBack (i_doDeepBack), m_doRGB (i_doRGB)
|
||||
{
|
||||
m_sampleCounts.resize ((size_t) m_width);
|
||||
m_deepFrontPtrs.resize ((size_t) m_width);
|
||||
if (m_doDeepBack) { m_deepBackPtrs.resize ((size_t) m_width); }
|
||||
if (m_doRGB)
|
||||
{
|
||||
m_redPtrs.resize ((size_t) m_width);
|
||||
m_greenPtrs.resize ((size_t) m_width);
|
||||
m_bluePtrs.resize ((size_t) m_width);
|
||||
}
|
||||
m_alphaPtrs.resize ((size_t) m_width);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
DeepOutRow<RGBA_T>::clear ()
|
||||
{
|
||||
std::fill (m_sampleCounts.begin (), m_sampleCounts.end (), (uint) 0);
|
||||
m_deepFrontSamples.clear ();
|
||||
m_deepBackSamples.clear ();
|
||||
m_redSamples.clear ();
|
||||
m_greenSamples.clear ();
|
||||
m_blueSamples.clear ();
|
||||
m_alphaSamples.clear ();
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
DeepOutRow<RGBA_T>::addPixel (int i_x, const DeepOutPixel<RGBA_T>& i_pixel)
|
||||
{
|
||||
int npoints = i_pixel.size ();
|
||||
m_sampleCounts[i_x] = npoints;
|
||||
if (npoints > 0)
|
||||
{
|
||||
VecAppend (m_deepFrontSamples, i_pixel.deepFront);
|
||||
if (m_doDeepBack) { VecAppend (m_deepBackSamples, i_pixel.deepBack); }
|
||||
if (m_doRGB)
|
||||
{
|
||||
VecAppend (m_redSamples, i_pixel.red);
|
||||
VecAppend (m_greenSamples, i_pixel.green);
|
||||
VecAppend (m_blueSamples, i_pixel.blue);
|
||||
}
|
||||
VecAppend (m_alphaSamples, i_pixel.alpha);
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
DeepOutRow<RGBA_T>::setFrameBuffer (Imf::DeepFrameBuffer& o_frameBuffer)
|
||||
{
|
||||
// Set up the pointers.
|
||||
float* deepFrontLastPtr = m_deepFrontSamples.data ();
|
||||
float* deepBackLastPtr = m_deepBackSamples.data ();
|
||||
RGBA_T* redLastPtr = m_redSamples.data ();
|
||||
RGBA_T* greenLastPtr = m_greenSamples.data ();
|
||||
RGBA_T* blueLastPtr = m_blueSamples.data ();
|
||||
RGBA_T* alphaLastPtr = m_alphaSamples.data ();
|
||||
for (int x = 0; x < m_width; ++x)
|
||||
{
|
||||
m_deepFrontPtrs[x] = deepFrontLastPtr;
|
||||
if (m_doDeepBack) { m_deepBackPtrs[x] = deepBackLastPtr; }
|
||||
if (m_doRGB)
|
||||
{
|
||||
m_redPtrs[x] = redLastPtr;
|
||||
m_greenPtrs[x] = greenLastPtr;
|
||||
m_bluePtrs[x] = blueLastPtr;
|
||||
}
|
||||
m_alphaPtrs[x] = alphaLastPtr;
|
||||
|
||||
int c = m_sampleCounts[x];
|
||||
|
||||
deepFrontLastPtr += c;
|
||||
deepBackLastPtr += c;
|
||||
redLastPtr += c;
|
||||
greenLastPtr += c;
|
||||
blueLastPtr += c;
|
||||
alphaLastPtr += c;
|
||||
}
|
||||
|
||||
// Sample counts
|
||||
o_frameBuffer.insertSampleCountSlice (Imf::Slice (
|
||||
Imf::UINT,
|
||||
(char*) m_sampleCounts.data (),
|
||||
sizeof (uint), // x stride
|
||||
0)); // y stride
|
||||
|
||||
// RGB
|
||||
if (m_doRGB)
|
||||
{
|
||||
o_frameBuffer.insert (
|
||||
"R",
|
||||
Imf::DeepSlice (
|
||||
ImfPixelType<RGBA_T> (),
|
||||
(char*) m_redPtrs.data (),
|
||||
sizeof (RGBA_T*), // xstride
|
||||
0, // ystride
|
||||
sizeof (RGBA_T))); // sample stride
|
||||
|
||||
o_frameBuffer.insert (
|
||||
"G",
|
||||
Imf::DeepSlice (
|
||||
ImfPixelType<RGBA_T> (),
|
||||
(char*) m_greenPtrs.data (),
|
||||
sizeof (RGBA_T*), // xstride
|
||||
0, // ystride
|
||||
sizeof (RGBA_T))); // sample stride
|
||||
|
||||
o_frameBuffer.insert (
|
||||
"B",
|
||||
Imf::DeepSlice (
|
||||
ImfPixelType<RGBA_T> (),
|
||||
(char*) m_bluePtrs.data (),
|
||||
sizeof (RGBA_T*), // xstride
|
||||
0, // ystride
|
||||
sizeof (RGBA_T))); // sample stride
|
||||
}
|
||||
|
||||
// ALPHA
|
||||
o_frameBuffer.insert (
|
||||
"A",
|
||||
Imf::DeepSlice (
|
||||
ImfPixelType<RGBA_T> (),
|
||||
(char*) m_alphaPtrs.data (),
|
||||
sizeof (RGBA_T*), // xstride
|
||||
0, // ystride
|
||||
sizeof (RGBA_T))); // sample stride
|
||||
|
||||
// DEEP FRONT
|
||||
o_frameBuffer.insert (
|
||||
"Z",
|
||||
Imf::DeepSlice (
|
||||
Imf::FLOAT,
|
||||
(char*) m_deepFrontPtrs.data (),
|
||||
sizeof (float*), // xstride
|
||||
0, // ystride
|
||||
sizeof (float))); // sample stride
|
||||
|
||||
// DEEP BACK
|
||||
if (m_doDeepBack)
|
||||
{
|
||||
o_frameBuffer.insert (
|
||||
"ZBack",
|
||||
Imf::DeepSlice (
|
||||
Imf::FLOAT,
|
||||
(char*) m_deepBackPtrs.data (),
|
||||
sizeof (float*), // xstride
|
||||
0, // ystride
|
||||
sizeof (float))); // sample stride
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace PxDeep
|
||||
|
||||
#endif
|
||||
@@ -1,134 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#include "PxDeepUtils.h"
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
// Density/Viz/DZ calculations are always performed in double precision.
|
||||
// We try to leave them alone as much as possible, but the logarithm can get
|
||||
// weird for very very small numbers. The "isfinite" call basically rules
|
||||
// out NaN and Infinity results, though it doesn't bother with subnormal
|
||||
// numbers, since the error case we're worried about is log being too big.
|
||||
// viz = exp( -dz * density )
|
||||
// log( viz ) = -dz * density
|
||||
// density = -log( viz ) / dz
|
||||
double
|
||||
DensityFromVizDz (double i_viz, double i_dz)
|
||||
{
|
||||
assert (i_viz >= 0.0);
|
||||
assert (i_viz <= 1.0);
|
||||
assert (i_dz >= 0.0);
|
||||
|
||||
if (i_viz >= 1.0)
|
||||
{
|
||||
// There's no attenuation at all, so there's no density!
|
||||
return 0.0;
|
||||
}
|
||||
else if (i_viz <= 0.0)
|
||||
{
|
||||
// There's total attenuation, so we use our max density.
|
||||
return PXDU_DENSITY_OF_VIZ_0;
|
||||
}
|
||||
else if (i_dz <= 0.0)
|
||||
{
|
||||
// There's no depth, and viz is greater than zero,
|
||||
// so we assume the density is as high as possible
|
||||
return PXDU_DENSITY_OF_VIZ_0;
|
||||
}
|
||||
else
|
||||
{
|
||||
double d = -log (i_viz) / i_dz;
|
||||
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0; }
|
||||
else
|
||||
{
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// We can often treat "density times dz" as a single quantity without
|
||||
// separating it.
|
||||
// viz = exp( -densityTimesDz )
|
||||
// log( viz ) = -densityTimesDz
|
||||
// densityTimesDz = -log( viz )
|
||||
double
|
||||
DensityTimesDzFromViz (double i_viz)
|
||||
{
|
||||
assert (i_viz >= 0.0);
|
||||
assert (i_viz <= 1.0);
|
||||
|
||||
if (i_viz >= 1.0)
|
||||
{
|
||||
// There's no attenuation at all, so there's no density!
|
||||
return 0.0;
|
||||
}
|
||||
else if (i_viz <= 0.0)
|
||||
{
|
||||
// There's total attenuation, so we use our max density.
|
||||
return PXDU_DENSITY_OF_VIZ_0 * PXDU_DZ_OF_VIZ_0;
|
||||
}
|
||||
else
|
||||
{
|
||||
double d = -log (i_viz);
|
||||
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0 * PXDU_DZ_OF_VIZ_0; }
|
||||
else
|
||||
{
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// viz = exp( -dz * density )
|
||||
// log( viz ) = -dz * density
|
||||
// dz = -log( viz ) / density
|
||||
// Note that this is basically the same as the computation above.
|
||||
double
|
||||
DzFromVizDensity (double i_viz, double i_density)
|
||||
{
|
||||
assert (i_viz >= 0.0);
|
||||
assert (i_viz <= 1.0);
|
||||
assert (i_density >= 0.0);
|
||||
|
||||
if (i_viz >= 1.0)
|
||||
{
|
||||
// There's no attenuation, so there's no depth.
|
||||
return 0.0;
|
||||
}
|
||||
else if (i_viz <= 0.0)
|
||||
{
|
||||
// There's total attenuation, so we use the smallest depth
|
||||
// for our max density.
|
||||
return PXDU_DZ_OF_VIZ_0;
|
||||
}
|
||||
else if (i_density <= 0.0)
|
||||
{
|
||||
// Hmmm. There's no density, but there is some attenuation,
|
||||
// which basically implies an infinite depth.
|
||||
// We'll use the minimum density.
|
||||
// This whole part is hacky at best.
|
||||
double dz = -log (i_viz) / PXDU_MIN_NON_ZERO_DENSITY;
|
||||
if (!isfinite (dz)) { return PXDU_MAX_DZ; }
|
||||
else
|
||||
{
|
||||
return dz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
double dz = -log (i_viz) / i_density;
|
||||
if (!isfinite (dz)) { return PXDU_MAX_DZ; }
|
||||
else
|
||||
{
|
||||
return dz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace PxDeep
|
||||
@@ -1,478 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef _PxDeepUtils_h_
|
||||
#define _PxDeepUtils_h_
|
||||
|
||||
#include <ImfNamespace.h>
|
||||
#include <ImfPartType.h>
|
||||
#include <ImfPixelType.h>
|
||||
|
||||
#include <ImathBox.h>
|
||||
#include <ImathFun.h>
|
||||
#include <ImathMatrix.h>
|
||||
#include <ImathVec.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <cmath>
|
||||
#include <dtex.h>
|
||||
#include <float.h>
|
||||
#include <half.h>
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
using std::isfinite;
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
// The large block of comments below explains our working terminology and
|
||||
// the justification of our limits & magic numbers. In a few places, the
|
||||
// use of centimeters as a spatial unit does affect the absolute position of
|
||||
// various minima and maxima, but in normal usage those should be well outside
|
||||
// working ranges.
|
||||
//-*****************************************************************************
|
||||
|
||||
//-*****************************************************************************
|
||||
// DENSITY
|
||||
//-*****************************************************************************
|
||||
// "Density" refers to the optical density which, when integrated
|
||||
// through a line, produces an alpha. The relationship between alpha, density,
|
||||
// and line segment of a given length "dz" is as follows:
|
||||
//
|
||||
// alpha = 1.0 - exp( -dz * density )
|
||||
//
|
||||
// We use a minimum non-zero density in some places in our code, which
|
||||
// represents the density of dry air at atmospheric pressure. Though
|
||||
// different wavelengths of light are attenuated differently, the average
|
||||
// attenuation is 10^-5 per meter. To make it very minimal,
|
||||
// we'll work with 1/10th that density (tiny tiny). Since our facility
|
||||
// works in centimeters, this works out to (using & rearranging the
|
||||
// equation above)
|
||||
//
|
||||
// 10^-6 = 1.0 - exp( -100.0 * MIN_NON_ZERO_DENSITY )
|
||||
// exp( -100.0 * MIN_NON_ZERO_DENSITY ) = 1.0 - 10^-6
|
||||
// -100.0 * MIN_NON_ZERO_DENSITY = log( 1.0 - 10^-6 )
|
||||
// MIN_NON_ZERO_DENSITY = log( 1.0 - 10^-6 ) / -100.0
|
||||
// MIN_NON_ZERO_DENSITY = 1.0000050000290891e-08
|
||||
//
|
||||
// We use double precision for density and dz calculations.
|
||||
//
|
||||
//-*****************************************************************************
|
||||
// VISIBILITY (or 'VIZ', or 'TRANSMISSION')
|
||||
//-*****************************************************************************
|
||||
// Throughout the code below, we transform "alpha" into its inverse, which is
|
||||
// transmissivity, or visibility, or for short, 'viz'. The relationship between
|
||||
// alpha and viz is simple:
|
||||
//
|
||||
// alpha = 1.0 - viz, or viz = 1.0 - alpha.
|
||||
//
|
||||
// Similarly, the relationship between viz and density & dz is simple:
|
||||
//
|
||||
// viz = exp( -dz * density )
|
||||
// log( viz ) = -dz * density
|
||||
//
|
||||
// Viz is easier to work with than alpha, because to accumulate a total
|
||||
// visibility of many adjacent samples, the relationship is just, for the
|
||||
// set of sample viz's: {viz0, viz1, viz2, ..., vizN-1}
|
||||
//
|
||||
// totalViz = viz0 * viz1 * viz2 * ... * vizN-1
|
||||
//
|
||||
// It's interesting to note that for any given set of spans, their accumulated
|
||||
// visibility is the same regardless of what order they're accumulated in,
|
||||
// since A*B == B*A.
|
||||
//
|
||||
// When using viz, we use double precision because the operation
|
||||
// 1.0f - ( 1.0f - a ) loses precision, and we want as little of that as
|
||||
// possible!
|
||||
//
|
||||
//-*****************************************************************************
|
||||
// DEPTH RANGES
|
||||
//-*****************************************************************************
|
||||
// Because we need to be able to arithmetically manipulate depths, we place
|
||||
// a range on the valid depth values. Positive Infinity is a valid depth value
|
||||
// to be stored in a DTEX file, but in order to make everything else work, we
|
||||
// set the maximum depth to near (but not at) FLT_MAX, 10^30. Similarly, we
|
||||
// set the minimum depth to just slightly greater than zero, 10^-4. This
|
||||
// could potentially clip effects being deep composited with very small
|
||||
// distances and units of meters.
|
||||
//
|
||||
//-*****************************************************************************
|
||||
// DEEP OPACITY
|
||||
//-*****************************************************************************
|
||||
// "Deep Opacity" refers to a depth function in which the sample at each point
|
||||
// represents the total accumulated opacity at that depth. This represents
|
||||
// the way that deep shadows would have been produced by renderman with the
|
||||
// Display Driver Line: "deepshad" "deepopacity", except that the files actually
|
||||
// store the inverse (1.0-opacity) at each point. It is important to note
|
||||
// that for any given Dtex deepopacity sample, the value represents the
|
||||
// accumulation of visibility on the NEAR side of the sample - up to and
|
||||
// including the sample's depth, but no further in depth. Deep Opacity
|
||||
// functions are monotonically decreasing in depth, and are always
|
||||
// between 0 and 1.
|
||||
//
|
||||
// A complication arises when the 0'th continuous deep opacity sample has a
|
||||
// non-zero deep opacity, because we don't have enough information to infer
|
||||
// where the continuous span that ends at the 0th sample begins in depth. We
|
||||
// solve the problem by interrogating the entire deep pixel for the maximum
|
||||
// density of all its spans (see above), and then solving for what dz
|
||||
// would produce the given accumulated alpha for that max density. The
|
||||
// near point of the initial span is then 'dz' units in front of the 0th
|
||||
// sample depth.
|
||||
//
|
||||
// We sometimes use 'deepViz' to in the code below to refer to 1.0 - deepOpacity
|
||||
//
|
||||
//-*****************************************************************************
|
||||
// DEEP ALPHA
|
||||
//-*****************************************************************************
|
||||
// "Deep Alpha" refers to a depth function in which the sample at each point
|
||||
// represents the non-accumulated alpha of that single sample. When interpreting
|
||||
// the depth function as continuous instead of discrete, Deep Alpha represents
|
||||
// the alpha of the FAR side of the sample - from the depth of the sample
|
||||
// up to, but not including, the depth of the next sample.
|
||||
//
|
||||
// A complication arises when the last continuous deep alpha sample has a
|
||||
// non-zero deep alpha, because we don't have enough information to infer
|
||||
// where the continuous span that begins at the last sample ends in depth. We
|
||||
// solve this problem analagously to how we solve the DeepOpacity problem.
|
||||
// We get the maximum density along the entire deep pixel and extrapolate to
|
||||
// determine an end depth.
|
||||
//
|
||||
//-*****************************************************************************
|
||||
// DEEP RGBA
|
||||
//-*****************************************************************************
|
||||
// Deep RGBA is exactly the same as Deep Alpha, for both discrete and
|
||||
// continuous cases, with the additional R,G, and B channels carried along.
|
||||
// The RGB can be read as premultiplied by alpha, or not. The output deep
|
||||
// pixel expects RGB to be premultiplied by alpha.
|
||||
// The use of premultiplied alpha makes it possible to entangle emitted and
|
||||
// reflected light - basically "glows", when premultiplied R,G,B are non-zero
|
||||
// but alpha is zero. However, in order for us to collapse coindicent samples,
|
||||
// we need to temporarily store RGB unpremultiplied. We simply don't affect
|
||||
// the samples that have zero alpha, and don't remultiply samples that have
|
||||
// zero alpha. There's no way for uncombined samples that had non-zero alpha
|
||||
// to produce a combined sample with zero alpha, so any sample that has
|
||||
// zero alpha at the end of all the combining was entirely composed of zero
|
||||
// alpha samples to begin with. SO, if the alpha is zero, we don't
|
||||
// multiply by it!
|
||||
//-*****************************************************************************
|
||||
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
// UTILITY CONSTANTS AND FUNCTIONS
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
|
||||
//-*****************************************************************************
|
||||
// Explained above in the "Density" section of the comments.
|
||||
// We set this value to one tenth the attenuation of light in dry air
|
||||
// at atmospheric pressure.
|
||||
// 10^-6 = 1.0 - exp( -100.0 * MIN_NON_ZERO_DENSITY )
|
||||
// exp( -100.0 * MIN_NON_ZERO_DENSITY ) = 1.0 - 10^-6
|
||||
// -100.0 * MIN_NON_ZERO_DENSITY = log( 1.0 - 10^-6 )
|
||||
// MIN_NON_ZERO_DENSITY = log( 1.0 - 10^-6 ) / -100.0
|
||||
// MIN_NON_ZERO_DENSITY = 1.0000050000290891e-08
|
||||
// static const double MIN_NON_ZERO_DENSITY = log( 1.0 - 1.0e-6 ) / -100.0;
|
||||
#define PXDU_MIN_NON_ZERO_DENSITY 1.0000050000290891e-08L
|
||||
|
||||
//-*****************************************************************************
|
||||
// The change in depth which produces maximum alpha for maximum density.
|
||||
// We want this to be small without risking subnormality.
|
||||
// static const double DZ_OF_ALPHA_1 = 0.001;
|
||||
// static const double DZ_OF_VIZ_0 = 0.001;
|
||||
#define PXDU_DZ_OF_ALPHA_1 0.001
|
||||
#define PXDU_DZ_OF_VIZ_0 0.001
|
||||
|
||||
//-*****************************************************************************
|
||||
// We set the max density of alpha 1 to the density which would produce
|
||||
// an alpha of 0.99999 in a distance of 0.001 centimeters (DZ_OF_ALPHA_1)
|
||||
//
|
||||
// 0.99999 = 1.0 - exp( -0.001 * MAX_DENSITY )
|
||||
// exp( -0.001 * MAX_DENSITY ) = 1.0 - 0.99999
|
||||
// -0.001 * MAX_DENSITY = log( 1.0 - 0.99999 )
|
||||
// MAX_DENSITY = log( 1.0 - 0.99999 ) / -0.001
|
||||
// MAX_DENSITY = 11512.925464974779
|
||||
// static const double DENSITY_OF_ALPHA_1 = log( 1.0 - 0.99999 ) / -0.001;
|
||||
// static const double DENSITY_OF_VIZ_0 = DENSITY_OF_ALPHA_1;
|
||||
#define PXDU_DENSITY_OF_ALPHA_1 11512.92546497478
|
||||
#define PXDU_DENSITY_OF_VIZ_0 11512.92546497478
|
||||
|
||||
//-*****************************************************************************
|
||||
// Just in case we need it. These are the constants used above.
|
||||
#define PXDU_MAX_NON_OPAQUE_ALPHA 0.99999
|
||||
#define PXDU_MIN_NON_OPAQUE_VIZ 0.00001
|
||||
|
||||
#define PXDU_MIN_NON_TRANSPARENT_ALPHA 0.00001
|
||||
#define PXDU_MAX_NON_TRANSPARENT_VIZ 0.99999
|
||||
|
||||
//-*****************************************************************************
|
||||
// Explained above in the "Depth" section of the comments.
|
||||
// static const double MIN_DEEP_DEPTH = 1.0e-4;
|
||||
// static const double MAX_DEEP_DEPTH = 1.0e30;
|
||||
#define PXDU_MIN_DEEP_DEPTH 1.0e-4
|
||||
#define PXDU_MAX_DEEP_DEPTH 1.0e30
|
||||
|
||||
//-*****************************************************************************
|
||||
// A maximum depth change (dz)
|
||||
// static const double MAX_DZ = double( MAX_DEEP_DEPTH ) -
|
||||
// double( MIN_DEEP_DEPTH );
|
||||
#define PXDU_MAX_DZ 1.0e30
|
||||
|
||||
//-*****************************************************************************
|
||||
// IEEE 754 floats can be incremented to the "next" positive float
|
||||
// in this manner, for positive float inputs.
|
||||
inline float
|
||||
IncrementPositiveFloat (float i_a, int32_t i_inc = 1)
|
||||
{
|
||||
typedef union
|
||||
{
|
||||
int32_t i;
|
||||
float f;
|
||||
} intfloat;
|
||||
intfloat a;
|
||||
a.f = i_a;
|
||||
a.i += i_inc;
|
||||
return a.f;
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// IEEE 754 floats can be decremented to the "previous" positive float
|
||||
// in this manner, for positive float inputs.
|
||||
inline float
|
||||
DecrementPositiveFloat (float i_a, int32_t i_inc = 1)
|
||||
{
|
||||
typedef union
|
||||
{
|
||||
int32_t i;
|
||||
float f;
|
||||
} intfloat;
|
||||
intfloat a;
|
||||
a.f = i_a;
|
||||
a.i -= i_inc;
|
||||
return a.f;
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// From: man isinf
|
||||
// isinf(x) returns 1 if x is positive infinity, and -1 if x is nega-
|
||||
// tive infinity.
|
||||
template <typename T>
|
||||
inline bool
|
||||
IsInfinity (T i_f)
|
||||
{
|
||||
return (isinf (i_f) == 1);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// A zero-nan function, which actually zeros inf as well.
|
||||
template <typename T>
|
||||
inline T
|
||||
ZeroNAN (T i_f)
|
||||
{
|
||||
if (!isfinite (i_f)) { return (T) 0; }
|
||||
else
|
||||
{
|
||||
return i_f;
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename T>
|
||||
inline T
|
||||
ClampDepth (T i_depth)
|
||||
{
|
||||
if (IsInfinity (i_depth)) { return PXDU_MAX_DEEP_DEPTH; }
|
||||
else
|
||||
{
|
||||
return Imath::clamp (
|
||||
i_depth, (T) PXDU_MIN_DEEP_DEPTH, (T) PXDU_MAX_DEEP_DEPTH);
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename T>
|
||||
inline T
|
||||
ClampDz (T i_dz)
|
||||
{
|
||||
return Imath::clamp (ZeroNAN (i_dz), (T) 0, (T) PXDU_MAX_DZ);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename T>
|
||||
inline T
|
||||
ClampNonZeroDz (T i_dz)
|
||||
{
|
||||
return Imath::clamp (
|
||||
ZeroNAN (i_dz), (T) PXDU_DZ_OF_ALPHA_1, (T) PXDU_MAX_DZ);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename T>
|
||||
inline T
|
||||
ClampAlpha (T i_alpha)
|
||||
{
|
||||
return Imath::clamp (ZeroNAN (i_alpha), (T) 0, (T) 1);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// "plausible" in this case means not completely transparent, nor
|
||||
// completely opaque.
|
||||
template <typename T>
|
||||
inline T
|
||||
ClampPlausibleAlpha (T i_alpha)
|
||||
{
|
||||
return Imath::clamp (
|
||||
ZeroNAN (i_alpha),
|
||||
(T) PXDU_MIN_NON_TRANSPARENT_ALPHA,
|
||||
(T) PXDU_MAX_NON_OPAQUE_ALPHA);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename T>
|
||||
inline double
|
||||
ClampViz (T i_viz)
|
||||
{
|
||||
return Imath::clamp (ZeroNAN (i_viz), (T) 0, (T) 1);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// "plausible" in this case means not completely transparent, nor
|
||||
// completely opaque.
|
||||
template <typename T>
|
||||
inline T
|
||||
ClampPlausibleViz (T i_viz)
|
||||
{
|
||||
return Imath::clamp (
|
||||
ZeroNAN (i_viz),
|
||||
(T) PXDU_MIN_NON_OPAQUE_VIZ,
|
||||
(T) PXDU_MAX_NON_TRANSPARENT_VIZ);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// Plausible density is clamped between min non-zero density
|
||||
// and density of alpha 1.
|
||||
template <typename T>
|
||||
inline T
|
||||
ClampPlausibleDensity (T i_density)
|
||||
{
|
||||
return Imath::clamp (
|
||||
ZeroNAN (i_density),
|
||||
(T) PXDU_MIN_NON_ZERO_DENSITY,
|
||||
(T) PXDU_DENSITY_OF_ALPHA_1);
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// Density/Viz/DZ calculations are always performed in double precision.
|
||||
// We try to leave them alone as much as possible, but the logarithm can get
|
||||
// weird for very very small numbers. The "isfinite" call basically rules
|
||||
// out NaN and Infinity results, though it doesn't bother with subnormal
|
||||
// numbers, since the error case we're worried about is log being too big.
|
||||
// viz = exp( -dz * density )
|
||||
// log( viz ) = -dz * density
|
||||
// density = -log( viz ) / dz
|
||||
double DensityFromVizDz (double i_viz, double i_dz);
|
||||
|
||||
//-*****************************************************************************
|
||||
// We can often treat "density times dz" as a single quantity without
|
||||
// separating it.
|
||||
// viz = exp( -densityTimesDz )
|
||||
// log( viz ) = -densityTimesDz
|
||||
// densityTimesDz = -log( viz )
|
||||
double DensityTimesDzFromViz (double i_viz);
|
||||
|
||||
//-*****************************************************************************
|
||||
// Plausible density defined above.
|
||||
inline double
|
||||
PlausibleDensityFromVizDz (double i_viz, double i_dz)
|
||||
{
|
||||
return ClampPlausibleDensity (DensityFromVizDz (i_viz, i_dz));
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// viz = exp( -dz * density )
|
||||
// log( viz ) = -dz * density
|
||||
// dz = -log( viz ) / density
|
||||
// Note that this is basically the same as the computation above.
|
||||
double DzFromVizDensity (double i_viz, double i_density);
|
||||
|
||||
//-*****************************************************************************
|
||||
// viz = exp( -dz * density ) // valid for all finite numbers.
|
||||
// negative densities or dz's will give greater than 1 viz's, which will
|
||||
// get clamped!
|
||||
inline double
|
||||
VizFromDensityDz (double i_density, double i_dz)
|
||||
{
|
||||
return ClampViz (exp (-ZeroNAN (i_density * i_dz)));
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// same as above.
|
||||
inline double
|
||||
VizFromDensityTimesDz (double i_densityTimesDz)
|
||||
{
|
||||
return ClampViz (exp (-ZeroNAN (i_densityTimesDz)));
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
// IMF SPECIFIC STUFF
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
//-*****************************************************************************
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename T> Imf::PixelType ImfPixelType ();
|
||||
|
||||
template <>
|
||||
inline Imf::PixelType
|
||||
ImfPixelType<half> ()
|
||||
{
|
||||
return Imf::HALF;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline Imf::PixelType
|
||||
ImfPixelType<float> ()
|
||||
{
|
||||
return Imf::FLOAT;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline Imf::PixelType
|
||||
ImfPixelType<uint> ()
|
||||
{
|
||||
return Imf::UINT;
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
// Handy exception macro.
|
||||
#define PXDU_THROW(TEXT) \
|
||||
do \
|
||||
{ \
|
||||
std::stringstream sstr; \
|
||||
sstr << TEXT; \
|
||||
std::runtime_error exc (sstr.str ()); \
|
||||
throw (exc); \
|
||||
} while (0)
|
||||
|
||||
} // End namespace PxDeep
|
||||
|
||||
#endif
|
||||
@@ -1,443 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef _PxFourChanDeepRgba_h_
|
||||
#define _PxFourChanDeepRgba_h_
|
||||
|
||||
#include "PxBaseDeepHelper.h"
|
||||
#include "PxDeepUtils.h"
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
// FOUR CHANNEL DEEP RGBA CONTINUOUS
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
class FourChanDeepRgbaContinuous : public BaseDeepHelper<
|
||||
RGBA_T,
|
||||
FourChanDeepRgbaContinuous<RGBA_T>,
|
||||
SpanRgba>
|
||||
{
|
||||
public:
|
||||
typedef BaseDeepHelper<RGBA_T, FourChanDeepRgbaContinuous<RGBA_T>, SpanRgba>
|
||||
super_type;
|
||||
typedef FourChanDeepRgbaContinuous<RGBA_T> this_type;
|
||||
typedef typename super_type::span_type span_type;
|
||||
|
||||
FourChanDeepRgbaContinuous (
|
||||
DtexFile* i_dtexFile, int i_numDtexChans, const Parameters& i_params)
|
||||
: BaseDeepHelper<RGBA_T, FourChanDeepRgbaContinuous<RGBA_T>, SpanRgba> (
|
||||
i_dtexFile, i_numDtexChans, i_params)
|
||||
{}
|
||||
|
||||
void processDeepPixel (int i_numPts);
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
// FOUR CHANNEL DEEP RGBA DISCRETE
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
class FourChanDeepRgbaDiscrete
|
||||
: public BaseDeepHelper<RGBA_T, FourChanDeepRgbaDiscrete<RGBA_T>, SpanRgba>
|
||||
{
|
||||
public:
|
||||
typedef BaseDeepHelper<RGBA_T, FourChanDeepRgbaDiscrete<RGBA_T>, SpanRgba>
|
||||
super_type;
|
||||
typedef FourChanDeepRgbaDiscrete<RGBA_T> this_type;
|
||||
typedef typename super_type::span_type span_type;
|
||||
|
||||
FourChanDeepRgbaDiscrete (
|
||||
DtexFile* i_dtexFile, int i_numDtexChans, const Parameters& i_params)
|
||||
: BaseDeepHelper<RGBA_T, FourChanDeepRgbaDiscrete<RGBA_T>, SpanRgba> (
|
||||
i_dtexFile, i_numDtexChans, i_params)
|
||||
{}
|
||||
|
||||
void processDeepPixel (int i_numPts);
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
FourChanDeepRgbaContinuous<RGBA_T>::processDeepPixel (int i_numPts)
|
||||
{
|
||||
assert (i_numPts > 0);
|
||||
|
||||
// Loop over all the dtex points and get their deepAlphas
|
||||
// and their depths. Enforce the case that deepAlpha
|
||||
// is always between 0 and 1.
|
||||
(this->m_spans).resize ((size_t) i_numPts);
|
||||
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
float z;
|
||||
float pts[4];
|
||||
DtexPixelGetPoint ((this->m_pixel), j, &z, (float*) pts);
|
||||
|
||||
z = ClampDepth (z);
|
||||
|
||||
double red = ZeroNAN (pts[0]);
|
||||
double green = ZeroNAN (pts[1]);
|
||||
double blue = ZeroNAN (pts[2]);
|
||||
double alpha = ClampAlpha (pts[3]);
|
||||
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
spanJ.clear ();
|
||||
spanJ.in = z;
|
||||
spanJ.out = z;
|
||||
spanJ.viz = ClampViz (1.0 - alpha);
|
||||
spanJ.index = j;
|
||||
|
||||
// Only unpremult if the data is assumed to be premultiplied,
|
||||
// which is when the params say DON'T multiply color by alpha.
|
||||
if (alpha > 0.0 && !(this->m_params).multiplyColorByAlpha)
|
||||
{
|
||||
spanJ.rgb[0] = red / alpha;
|
||||
spanJ.rgb[1] = green / alpha;
|
||||
spanJ.rgb[2] = blue / alpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
spanJ.rgb[0] = red;
|
||||
spanJ.rgb[1] = green;
|
||||
spanJ.rgb[2] = blue;
|
||||
}
|
||||
}
|
||||
|
||||
// Sort the spans.
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
|
||||
// Combine identical depths.
|
||||
double maxDensity = PXDU_MIN_NON_ZERO_DENSITY;
|
||||
{
|
||||
int activeBegin = 0;
|
||||
int activeEnd = 0;
|
||||
float interestingDepth = 0.0f;
|
||||
int numRemoved = 0;
|
||||
|
||||
while (activeBegin < i_numPts)
|
||||
{
|
||||
span_type& spanActiveBegin = (this->m_spans)[activeBegin];
|
||||
float nextInterestingDepth = spanActiveBegin.in;
|
||||
assert (nextInterestingDepth > interestingDepth);
|
||||
|
||||
activeEnd = i_numPts;
|
||||
for (int a = activeBegin + 1; a < i_numPts; ++a)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[a];
|
||||
|
||||
assert (spanNext.in > interestingDepth);
|
||||
assert (spanNext.in >= nextInterestingDepth);
|
||||
|
||||
if (spanNext.in > nextInterestingDepth)
|
||||
{
|
||||
// This span is not active in this round,
|
||||
// set activeEnd and get out.
|
||||
activeEnd = a;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This span has an identical depth to
|
||||
// the previous one, so we must combine their
|
||||
// alphas and eliminate the depth.
|
||||
// We simply add their unpremultiplied color.
|
||||
spanActiveBegin.viz *= spanNext.viz;
|
||||
spanActiveBegin.rgb[0] += spanNext.rgb[0];
|
||||
spanActiveBegin.rgb[1] += spanNext.rgb[1];
|
||||
spanActiveBegin.rgb[2] += spanNext.rgb[2];
|
||||
spanNext.in = FLT_MAX;
|
||||
spanNext.out = FLT_MAX;
|
||||
++numRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
spanActiveBegin.viz = ClampViz (spanActiveBegin.viz);
|
||||
|
||||
// Accumulate density from here to the next point.
|
||||
if (activeEnd < i_numPts)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[activeEnd];
|
||||
double dz = spanNext.in - spanActiveBegin.in;
|
||||
assert (spanNext.in > spanActiveBegin.in);
|
||||
assert (dz > 0.0);
|
||||
|
||||
double density = DensityFromVizDz (spanActiveBegin.viz, dz);
|
||||
maxDensity = std::max (maxDensity, density);
|
||||
}
|
||||
|
||||
activeBegin = activeEnd;
|
||||
interestingDepth = nextInterestingDepth;
|
||||
}
|
||||
|
||||
// If any removed, re-sort the list and remove the end
|
||||
// points.
|
||||
if (numRemoved > 0)
|
||||
{
|
||||
assert (numRemoved < i_numPts);
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
i_numPts -= numRemoved;
|
||||
(this->m_spans).resize (i_numPts);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the single point case.
|
||||
if (i_numPts == 1)
|
||||
{
|
||||
span_type& span0 = (this->m_spans)[0];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && span0.viz >= 1.0)
|
||||
{
|
||||
// Nothing!
|
||||
return;
|
||||
}
|
||||
|
||||
span0.out = ClampDepth (IncrementPositiveFloat (span0.in));
|
||||
|
||||
double alpha = ClampAlpha (1.0 - span0.viz);
|
||||
|
||||
// If the alpha is zero, and we're still here, it means
|
||||
// that the spans are either completely transparent and
|
||||
// the user has elected to keep them anyway, in which case
|
||||
// no multiplication by alpha is needed, or alternatively,
|
||||
// they're "glow" spans which have zero alpha but non-zero
|
||||
// color. Those glow spans were not unpremultiplied above,
|
||||
// and therefore do not need to be premultiplied here.
|
||||
// SO! If alpha is zero, we don't premultiply.
|
||||
if (alpha > 0.0)
|
||||
{
|
||||
span0.rgb[0] *= alpha;
|
||||
span0.rgb[1] *= alpha;
|
||||
span0.rgb[2] *= alpha;
|
||||
}
|
||||
|
||||
(this->m_deepOutPixel)
|
||||
.push_back (
|
||||
span0.in,
|
||||
span0.out,
|
||||
span0.rgb[0],
|
||||
span0.rgb[1],
|
||||
span0.rgb[2],
|
||||
alpha);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Put the spans back out.
|
||||
// If the last point has a non-zero alpha, extrapolate the
|
||||
// maximum density to create an end point.
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && spanJ.viz >= 1.0)
|
||||
{
|
||||
// This span is transparent, ignore it.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (j < i_numPts - 1) { spanJ.out = (this->m_spans)[j + 1].in; }
|
||||
else
|
||||
{
|
||||
// This is the last point.
|
||||
// If it has non-zero alpha, it needs depth,
|
||||
// which we use the max density for.
|
||||
if (spanJ.viz >= 1.0)
|
||||
{
|
||||
// Don't need to worry about this last span!
|
||||
// It is at the end of the continuous span, and
|
||||
// is completely transparent.
|
||||
continue;
|
||||
}
|
||||
|
||||
double dz = DzFromVizDensity (spanJ.viz, maxDensity);
|
||||
spanJ.out = ClampDepth (spanJ.in + dz);
|
||||
if (spanJ.out <= spanJ.in)
|
||||
{
|
||||
spanJ.out = ClampDepth (IncrementPositiveFloat (spanJ.in));
|
||||
}
|
||||
}
|
||||
|
||||
double alpha = ClampAlpha (1.0 - spanJ.viz);
|
||||
|
||||
// If the alpha is zero, and we're still here, it means
|
||||
// that the spans are either completely transparent and
|
||||
// the user has elected to keep them anyway, in which case
|
||||
// no multiplication by alpha is needed, or alternatively,
|
||||
// they're "glow" spans which have zero alpha but non-zero
|
||||
// color. Those glow spans were not unpremultiplied above,
|
||||
// and therefore do not need to be premultiplied here.
|
||||
// SO! If alpha is zero, we don't premultiply.
|
||||
if (alpha > 0.0)
|
||||
{
|
||||
spanJ.rgb[0] *= alpha;
|
||||
spanJ.rgb[1] *= alpha;
|
||||
spanJ.rgb[2] *= alpha;
|
||||
}
|
||||
|
||||
// Set the channels!
|
||||
(this->m_deepOutPixel)
|
||||
.push_back (
|
||||
spanJ.in,
|
||||
spanJ.out,
|
||||
spanJ.rgb[0],
|
||||
spanJ.rgb[1],
|
||||
spanJ.rgb[2],
|
||||
alpha);
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
FourChanDeepRgbaDiscrete<RGBA_T>::processDeepPixel (int i_numPts)
|
||||
{
|
||||
assert (i_numPts > 0);
|
||||
|
||||
// Loop over all the dtex points and get their deepAlphas
|
||||
// and their depths. Enforce the case that deepAlpha
|
||||
// is always between 0 and 1.
|
||||
(this->m_spans).resize ((size_t) i_numPts);
|
||||
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
float z;
|
||||
float pts[4];
|
||||
DtexPixelGetPoint ((this->m_pixel), j, &z, (float*) pts);
|
||||
|
||||
z = ClampDepth (z);
|
||||
|
||||
double red = ZeroNAN (pts[0]);
|
||||
double green = ZeroNAN (pts[1]);
|
||||
double blue = ZeroNAN (pts[2]);
|
||||
double alpha = ClampAlpha (pts[3]);
|
||||
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
spanJ.clear ();
|
||||
spanJ.in = z;
|
||||
spanJ.out = z;
|
||||
spanJ.viz = ClampViz (1.0 - alpha);
|
||||
spanJ.index = j;
|
||||
|
||||
// Only unpremult if the data is assumed to be premultiplied,
|
||||
// which is when the params say DON'T multiply color by alpha.
|
||||
if (alpha > 0.0 && !(this->m_params).multiplyColorByAlpha)
|
||||
{
|
||||
spanJ.rgb[0] = red / alpha;
|
||||
spanJ.rgb[1] = green / alpha;
|
||||
spanJ.rgb[2] = blue / alpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
spanJ.rgb[0] = red;
|
||||
spanJ.rgb[1] = green;
|
||||
spanJ.rgb[2] = blue;
|
||||
}
|
||||
}
|
||||
|
||||
// Sort the spans.
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
|
||||
// Combine identical depths.
|
||||
{
|
||||
int activeBegin = 0;
|
||||
int activeEnd = 0;
|
||||
float interestingDepth = 0.0f;
|
||||
int numRemoved = 0;
|
||||
|
||||
while (activeBegin < i_numPts)
|
||||
{
|
||||
span_type& spanActiveBegin = (this->m_spans)[activeBegin];
|
||||
float nextInterestingDepth = spanActiveBegin.in;
|
||||
assert (nextInterestingDepth > interestingDepth);
|
||||
|
||||
activeEnd = i_numPts;
|
||||
for (int a = activeBegin + 1; a < i_numPts; ++a)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[a];
|
||||
|
||||
assert (spanNext.in > interestingDepth);
|
||||
assert (spanNext.in >= nextInterestingDepth);
|
||||
|
||||
if (spanNext.in > nextInterestingDepth)
|
||||
{
|
||||
// This span is not active in this round,
|
||||
// set activeEnd and get out.
|
||||
activeEnd = a;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This span has an identical depth to
|
||||
// the previous one, so we must combine their
|
||||
// alphas and eliminate the depth.
|
||||
// We simply add their unpremultiplied color.
|
||||
spanActiveBegin.viz *= spanNext.viz;
|
||||
spanActiveBegin.rgb[0] += spanNext.rgb[0];
|
||||
spanActiveBegin.rgb[1] += spanNext.rgb[1];
|
||||
spanActiveBegin.rgb[2] += spanNext.rgb[2];
|
||||
spanNext.in = FLT_MAX;
|
||||
spanNext.out = FLT_MAX;
|
||||
++numRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
spanActiveBegin.viz = ClampViz (spanActiveBegin.viz);
|
||||
|
||||
activeBegin = activeEnd;
|
||||
interestingDepth = nextInterestingDepth;
|
||||
}
|
||||
|
||||
// If any removed, re-sort the list and remove the end
|
||||
// points.
|
||||
if (numRemoved > 0)
|
||||
{
|
||||
assert (numRemoved < i_numPts);
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
i_numPts -= numRemoved;
|
||||
(this->m_spans).resize (i_numPts);
|
||||
}
|
||||
}
|
||||
|
||||
// Put the spans back out.
|
||||
// If the last point has a non-zero alpha, extrapolate the
|
||||
// maximum density to create an end point.
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && spanJ.viz >= 1.0)
|
||||
{
|
||||
// This span is transparent, ignore it.
|
||||
continue;
|
||||
}
|
||||
|
||||
double alpha = ClampAlpha (1.0 - spanJ.viz);
|
||||
|
||||
// If the alpha is zero, and we're still here, it means
|
||||
// that the spans are either completely transparent and
|
||||
// the user has elected to keep them anyway, in which case
|
||||
// no multiplication by alpha is needed, or alternatively,
|
||||
// they're "glow" spans which have zero alpha but non-zero
|
||||
// color. Those glow spans were not unpremultiplied above,
|
||||
// and therefore do not need to be premultiplied here.
|
||||
// SO! If alpha is zero, we don't premultiply.
|
||||
if (alpha > 0.0)
|
||||
{
|
||||
spanJ.rgb[0] *= alpha;
|
||||
spanJ.rgb[1] *= alpha;
|
||||
spanJ.rgb[2] *= alpha;
|
||||
}
|
||||
|
||||
// Set the channels!
|
||||
(this->m_deepOutPixel)
|
||||
.push_back (
|
||||
spanJ.in, spanJ.rgb[0], spanJ.rgb[1], spanJ.rgb[2], alpha);
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace PxDeep
|
||||
|
||||
#endif
|
||||
@@ -1,334 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef _PxOneChanDeepAlpha_h_
|
||||
#define _PxOneChanDeepAlpha_h_
|
||||
|
||||
#include "PxBaseDeepHelper.h"
|
||||
#include "PxDeepUtils.h"
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
// ONE CHANNEL DEEP ALPHA CONTINUOUS
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
class OneChanDeepAlphaContinuous
|
||||
: public BaseDeepHelper<RGBA_T, OneChanDeepAlphaContinuous<RGBA_T>, Span>
|
||||
{
|
||||
public:
|
||||
typedef BaseDeepHelper<RGBA_T, OneChanDeepAlphaContinuous<RGBA_T>, Span>
|
||||
super_type;
|
||||
typedef OneChanDeepAlphaContinuous<RGBA_T> this_type;
|
||||
typedef typename super_type::span_type span_type;
|
||||
|
||||
OneChanDeepAlphaContinuous (
|
||||
DtexFile* i_dtexFile, int i_numDtexChans, const Parameters& i_params)
|
||||
: BaseDeepHelper<RGBA_T, OneChanDeepAlphaContinuous<RGBA_T>, Span> (
|
||||
i_dtexFile, i_numDtexChans, i_params)
|
||||
{}
|
||||
|
||||
void processDeepPixel (int i_numPts);
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
// ONE CHANNEL DEEP ALPHA DISCRETE
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
class OneChanDeepAlphaDiscrete
|
||||
: public BaseDeepHelper<RGBA_T, OneChanDeepAlphaDiscrete<RGBA_T>, Span>
|
||||
{
|
||||
public:
|
||||
typedef BaseDeepHelper<RGBA_T, OneChanDeepAlphaDiscrete<RGBA_T>, Span>
|
||||
super_type;
|
||||
typedef OneChanDeepAlphaDiscrete<RGBA_T> this_type;
|
||||
typedef typename super_type::span_type span_type;
|
||||
|
||||
OneChanDeepAlphaDiscrete (
|
||||
DtexFile* i_dtexFile, int i_numDtexChans, const Parameters& i_params)
|
||||
: BaseDeepHelper<RGBA_T, OneChanDeepAlphaDiscrete<RGBA_T>, Span> (
|
||||
i_dtexFile, i_numDtexChans, i_params)
|
||||
{}
|
||||
|
||||
void processDeepPixel (int i_numPts);
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
OneChanDeepAlphaContinuous<RGBA_T>::processDeepPixel (int i_numPts)
|
||||
{
|
||||
assert (i_numPts > 0);
|
||||
|
||||
// Loop over all the dtex points and get their deepAlphas
|
||||
// and their depths. Enforce the case that deepAlpha
|
||||
// is always between 0 and 1.
|
||||
// Also, find a good "best slope" for extraplolation.
|
||||
(this->m_spans).resize ((size_t) i_numPts);
|
||||
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
float z;
|
||||
float pts[4];
|
||||
DtexPixelGetPoint ((this->m_pixel), j, &z, (float*) pts);
|
||||
|
||||
z = ClampDepth (z);
|
||||
|
||||
double alpha = ClampAlpha (pts[0]);
|
||||
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
spanJ.clear ();
|
||||
spanJ.in = z;
|
||||
spanJ.out = z;
|
||||
spanJ.viz = ClampViz (1.0 - alpha);
|
||||
spanJ.index = j;
|
||||
}
|
||||
|
||||
// Sort the spans.
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
|
||||
// Combine identical depths, gathering max density along
|
||||
// the way.
|
||||
double maxDensity = PXDU_MIN_NON_ZERO_DENSITY;
|
||||
{
|
||||
int activeBegin = 0;
|
||||
int activeEnd = 0;
|
||||
float interestingDepth = 0.0f;
|
||||
int numRemoved = 0;
|
||||
|
||||
while (activeBegin < i_numPts)
|
||||
{
|
||||
span_type& spanActiveBegin = (this->m_spans)[activeBegin];
|
||||
float nextInterestingDepth = spanActiveBegin.in;
|
||||
assert (nextInterestingDepth > interestingDepth);
|
||||
|
||||
activeEnd = i_numPts;
|
||||
for (int a = activeBegin + 1; a < i_numPts; ++a)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[a];
|
||||
|
||||
assert (spanNext.in > interestingDepth);
|
||||
assert (spanNext.in >= nextInterestingDepth);
|
||||
|
||||
if (spanNext.in > nextInterestingDepth)
|
||||
{
|
||||
// This span is not active in this round,
|
||||
// set activeEnd and get out.
|
||||
activeEnd = a;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This span has an identical depth to
|
||||
// the previous one, so we must combine their
|
||||
// vizs and eliminate the depth.
|
||||
spanActiveBegin.viz *= spanNext.viz;
|
||||
spanNext.in = FLT_MAX;
|
||||
spanNext.out = FLT_MAX;
|
||||
++numRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
spanActiveBegin.viz = ClampViz (spanActiveBegin.viz);
|
||||
|
||||
// Accumulate density from here to the next point.
|
||||
if (activeEnd < i_numPts)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[activeEnd];
|
||||
double dz = spanNext.in - spanActiveBegin.in;
|
||||
assert (spanNext.in > spanActiveBegin.in);
|
||||
assert (dz > 0.0);
|
||||
|
||||
double density = DensityFromVizDz (spanActiveBegin.viz, dz);
|
||||
maxDensity = std::max (maxDensity, density);
|
||||
}
|
||||
|
||||
activeBegin = activeEnd;
|
||||
interestingDepth = nextInterestingDepth;
|
||||
}
|
||||
|
||||
// If any removed, re-sort the list and remove the end
|
||||
// points.
|
||||
if (numRemoved > 0)
|
||||
{
|
||||
assert (numRemoved < i_numPts);
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
i_numPts -= numRemoved;
|
||||
(this->m_spans).resize (i_numPts);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the single point case.
|
||||
if (i_numPts == 1)
|
||||
{
|
||||
span_type& span0 = (this->m_spans)[0];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && span0.viz >= 1.0)
|
||||
{
|
||||
// Nothing!
|
||||
return;
|
||||
}
|
||||
|
||||
span0.out = ClampDepth (IncrementPositiveFloat (span0.in));
|
||||
|
||||
float alphaF = ClampAlpha (1.0 - span0.viz);
|
||||
|
||||
(this->m_deepOutPixel).push_back (span0.in, span0.out, alphaF);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Put the spans back out.
|
||||
// If the last point has a non-zero alpha, extrapolate the
|
||||
// maximum density to create an end point.
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && spanJ.viz >= 1.0)
|
||||
{
|
||||
// This span is transparent, ignore it.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Set the out points.
|
||||
if (j < i_numPts - 1) { spanJ.out = (this->m_spans)[j + 1].in; }
|
||||
else
|
||||
{
|
||||
// This is the last point.
|
||||
// If it has non-zero alpha, it needs depth,
|
||||
// which we use the max density for.
|
||||
if (spanJ.viz >= 1.0)
|
||||
{
|
||||
// Don't need to worry about this last span!
|
||||
// It is at the end of the continuous span, and
|
||||
// is completely transparent.
|
||||
continue;
|
||||
}
|
||||
|
||||
double dz = DzFromVizDensity (spanJ.viz, maxDensity);
|
||||
spanJ.out = ClampDepth (spanJ.in + dz);
|
||||
if (spanJ.out <= spanJ.in)
|
||||
{
|
||||
spanJ.out = ClampDepth (IncrementPositiveFloat (spanJ.in));
|
||||
}
|
||||
}
|
||||
|
||||
float alphaF = ClampAlpha (1.0 - spanJ.viz);
|
||||
|
||||
(this->m_deepOutPixel).push_back (spanJ.in, spanJ.out, alphaF);
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
OneChanDeepAlphaDiscrete<RGBA_T>::processDeepPixel (int i_numPts)
|
||||
{
|
||||
assert (i_numPts > 0);
|
||||
|
||||
// Loop over all the dtex points and get their deepAlphas
|
||||
// and their depths. Enforce the case that deepAlpha
|
||||
// is always between 0 and 1.
|
||||
// Also, find a good "best slope" for extraplolation.
|
||||
(this->m_spans).resize ((size_t) i_numPts);
|
||||
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
float z;
|
||||
float pts[4];
|
||||
DtexPixelGetPoint ((this->m_pixel), j, &z, (float*) pts);
|
||||
|
||||
z = ClampDepth (z);
|
||||
|
||||
double alpha = ClampAlpha (pts[0]);
|
||||
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
spanJ.clear ();
|
||||
spanJ.in = z;
|
||||
spanJ.viz = ClampViz (1.0 - alpha);
|
||||
spanJ.index = j;
|
||||
}
|
||||
|
||||
// Sort the spans.
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
|
||||
// Combine identical depths.
|
||||
{
|
||||
int activeBegin = 0;
|
||||
int activeEnd = 0;
|
||||
float interestingDepth = 0.0f;
|
||||
int numRemoved = 0;
|
||||
|
||||
while (activeBegin < i_numPts)
|
||||
{
|
||||
span_type& spanActiveBegin = (this->m_spans)[activeBegin];
|
||||
float nextInterestingDepth = spanActiveBegin.in;
|
||||
assert (nextInterestingDepth > interestingDepth);
|
||||
|
||||
activeEnd = i_numPts;
|
||||
for (int a = activeBegin + 1; a < i_numPts; ++a)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[a];
|
||||
|
||||
assert (spanNext.in > interestingDepth);
|
||||
assert (spanNext.in >= nextInterestingDepth);
|
||||
|
||||
if (spanNext.in > nextInterestingDepth)
|
||||
{
|
||||
// This span is not active in this round,
|
||||
// set activeEnd and get out.
|
||||
activeEnd = a;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This span has an identical depth to
|
||||
// the previous one, so we must combine their
|
||||
// alphas and eliminate the depth.
|
||||
spanActiveBegin.viz *= spanNext.viz;
|
||||
spanNext.in = FLT_MAX;
|
||||
++numRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
spanActiveBegin.viz = ClampViz (spanActiveBegin.viz);
|
||||
activeBegin = activeEnd;
|
||||
interestingDepth = nextInterestingDepth;
|
||||
}
|
||||
|
||||
// If any removed, re-sort the list and remove the end
|
||||
// points.
|
||||
if (numRemoved > 0)
|
||||
{
|
||||
assert (numRemoved < i_numPts);
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
i_numPts -= numRemoved;
|
||||
(this->m_spans).resize (i_numPts);
|
||||
}
|
||||
}
|
||||
|
||||
// Put the spans back out.
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && spanJ.viz >= 1.0)
|
||||
{
|
||||
// This span is transparent, ignore it.
|
||||
continue;
|
||||
}
|
||||
|
||||
float alphaF = ClampAlpha (1.0 - spanJ.viz);
|
||||
|
||||
// Set the channels!
|
||||
(this->m_deepOutPixel).push_back (spanJ.in, alphaF);
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace PxDeep
|
||||
|
||||
#endif
|
||||
@@ -1,428 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef _PxOneChanDeepOpacity_h_
|
||||
#define _PxOneChanDeepOpacity_h_
|
||||
|
||||
#include "PxBaseDeepHelper.h"
|
||||
#include "PxDeepUtils.h"
|
||||
|
||||
namespace PxDeep
|
||||
{
|
||||
|
||||
//-*****************************************************************************
|
||||
// ONE CHANNEL DEEP OPACITY CONTINUOUS
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
class OneChanDeepOpacityContinuous : public BaseDeepHelper<
|
||||
RGBA_T,
|
||||
OneChanDeepOpacityContinuous<RGBA_T>,
|
||||
SpanOpac>
|
||||
{
|
||||
public:
|
||||
typedef BaseDeepHelper<
|
||||
RGBA_T,
|
||||
OneChanDeepOpacityContinuous<RGBA_T>,
|
||||
SpanOpac>
|
||||
super_type;
|
||||
typedef OneChanDeepOpacityContinuous<RGBA_T> this_type;
|
||||
typedef typename super_type::span_type span_type;
|
||||
|
||||
OneChanDeepOpacityContinuous (
|
||||
DtexFile* i_dtexFile, int i_numDtexChans, const Parameters& i_params)
|
||||
: BaseDeepHelper<
|
||||
RGBA_T,
|
||||
OneChanDeepOpacityContinuous<RGBA_T>,
|
||||
SpanOpac> (i_dtexFile, i_numDtexChans, i_params)
|
||||
{}
|
||||
|
||||
void processDeepPixel (int i_numPts);
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
// ONE CHANNEL DEEP OPACITY DISCRETE
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
class OneChanDeepOpacityDiscrete : public BaseDeepHelper<
|
||||
RGBA_T,
|
||||
OneChanDeepOpacityDiscrete<RGBA_T>,
|
||||
SpanOpac>
|
||||
{
|
||||
public:
|
||||
typedef BaseDeepHelper<RGBA_T, OneChanDeepOpacityDiscrete<RGBA_T>, SpanOpac>
|
||||
super_type;
|
||||
typedef OneChanDeepOpacityDiscrete<RGBA_T> this_type;
|
||||
typedef typename super_type::span_type span_type;
|
||||
|
||||
OneChanDeepOpacityDiscrete (
|
||||
DtexFile* i_dtexFile, int i_numDtexChans, const Parameters& i_params)
|
||||
: BaseDeepHelper<RGBA_T, OneChanDeepOpacityDiscrete<RGBA_T>, SpanOpac> (
|
||||
i_dtexFile, i_numDtexChans, i_params)
|
||||
{}
|
||||
|
||||
void processDeepPixel (int i_numPts);
|
||||
};
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
OneChanDeepOpacityContinuous<RGBA_T>::processDeepPixel (int i_numPts)
|
||||
{
|
||||
assert (i_numPts > 0);
|
||||
|
||||
// Loop over all the dtex points and get their deepOpacities and
|
||||
// depths.
|
||||
(this->m_spans).resize ((size_t) i_numPts);
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
float z;
|
||||
float pts[4];
|
||||
DtexPixelGetPoint ((this->m_pixel), j, &z, (float*) pts);
|
||||
|
||||
z = ClampDepth (z);
|
||||
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
spanJ.clear ();
|
||||
spanJ.in = z;
|
||||
spanJ.out = z;
|
||||
|
||||
// Data stored in dtex files for "deepopacity" is actually
|
||||
// "deeptransmission", monotonically decreasing from an initial
|
||||
// value of 1.0. We just convert it to viz directly.
|
||||
// (viz == transmissivity)
|
||||
spanJ.deepViz = ClampViz (pts[0]);
|
||||
spanJ.index = j;
|
||||
}
|
||||
|
||||
// Sort the spans by depth (and then index)
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
|
||||
// Combine identical depths, accumulating maximum density
|
||||
// along the way. Because we have deep opacity,
|
||||
// coincident samples use the maximum deepOpacity value.
|
||||
double maxDensity = PXDU_MIN_NON_ZERO_DENSITY;
|
||||
{
|
||||
int prevSpanIndex = 0;
|
||||
int activeBegin = 0;
|
||||
int activeEnd = 0;
|
||||
float interestingDepth = 0.0f;
|
||||
int numRemoved = 0;
|
||||
|
||||
while (activeBegin < i_numPts)
|
||||
{
|
||||
span_type& spanActiveBegin = (this->m_spans)[activeBegin];
|
||||
float nextInterestingDepth = spanActiveBegin.in;
|
||||
assert (nextInterestingDepth > interestingDepth);
|
||||
|
||||
// This loop combines all the coincident samples
|
||||
// into a single sample, invalidates the other coincident
|
||||
// samples, and sets activeEnd to point to the next
|
||||
// sample with a larger depth.
|
||||
activeEnd = i_numPts;
|
||||
for (int a = activeBegin + 1; a < i_numPts; ++a)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[a];
|
||||
|
||||
assert (spanNext.in > interestingDepth);
|
||||
assert (spanNext.in >= nextInterestingDepth);
|
||||
|
||||
if (spanNext.in > nextInterestingDepth)
|
||||
{
|
||||
// This span is not active in this round,
|
||||
// set activeEnd and get out.
|
||||
activeEnd = a;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This span has an identical depth to
|
||||
// the previous one, so we use whichever one has the
|
||||
// largest deep opacity, which equates to the
|
||||
// smallest deep viz.
|
||||
spanActiveBegin.deepViz =
|
||||
std::min (spanActiveBegin.deepViz, spanNext.deepViz);
|
||||
spanNext.in = FLT_MAX;
|
||||
spanNext.out = FLT_MAX;
|
||||
++numRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
// Okay, the deep vizibility at our in point
|
||||
// is equal to the total vizibility before us,
|
||||
// which is the deep vizibility at the previous point,
|
||||
// times the vizibility of this point.
|
||||
// deepViz = deepVizPrev * viz
|
||||
// viz = deepViz / deepVizPrev;
|
||||
if (activeBegin == 0)
|
||||
{
|
||||
spanActiveBegin.viz = spanActiveBegin.deepViz;
|
||||
}
|
||||
else
|
||||
{
|
||||
span_type& spanPrev = (this->m_spans)[prevSpanIndex];
|
||||
|
||||
// Make sure the deep visibilities are
|
||||
// monotonically decreasing with depth.
|
||||
spanActiveBegin.deepViz =
|
||||
std::min (spanActiveBegin.deepViz, spanPrev.deepViz);
|
||||
|
||||
if (spanPrev.deepViz > 0.0)
|
||||
{
|
||||
// If we have non-zero accumulated visibility,
|
||||
// we can compute the span visibility.
|
||||
spanActiveBegin.viz =
|
||||
spanActiveBegin.deepViz / spanPrev.deepViz;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we have zero accumulated visibility,
|
||||
// then the span visibility is also zero.
|
||||
spanActiveBegin.viz = 0.0;
|
||||
}
|
||||
|
||||
// Use the viz of this span to update the
|
||||
// max density.
|
||||
spanActiveBegin.viz = ClampViz (spanActiveBegin.viz);
|
||||
|
||||
spanActiveBegin.in = spanPrev.out;
|
||||
double dz = spanActiveBegin.out - spanActiveBegin.in;
|
||||
assert (dz > 0.0);
|
||||
assert (spanActiveBegin.out > spanActiveBegin.in);
|
||||
double density = DensityFromVizDz (spanActiveBegin.viz, dz);
|
||||
maxDensity = std::max (maxDensity, density);
|
||||
}
|
||||
|
||||
prevSpanIndex = activeBegin;
|
||||
activeBegin = activeEnd;
|
||||
interestingDepth = nextInterestingDepth;
|
||||
}
|
||||
|
||||
// If any removed, re-sort the list and remove the end
|
||||
// points.
|
||||
if (numRemoved > 0)
|
||||
{
|
||||
assert (numRemoved < i_numPts);
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
i_numPts -= numRemoved;
|
||||
(this->m_spans).resize (i_numPts);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the single point case.
|
||||
if (i_numPts == 1)
|
||||
{
|
||||
span_type& span0 = (this->m_spans)[0];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && span0.viz >= 1.0)
|
||||
{
|
||||
// Nothing!
|
||||
return;
|
||||
}
|
||||
|
||||
span0.in = ClampDepth (DecrementPositiveFloat (span0.out));
|
||||
|
||||
float alphaF = ClampAlpha (1.0 - span0.viz);
|
||||
|
||||
(this->m_deepOutPixel).push_back (span0.in, span0.out, alphaF);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Put the spans back out.
|
||||
// If the first point has a non-zero alpha, extrapolate the
|
||||
// maximum density to create a begin point.
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
|
||||
if ((this->m_params.discardZeroAlphaSamples) && spanJ.viz >= 1.0)
|
||||
{
|
||||
// This span is transparent, ignore it.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (j == 0)
|
||||
{
|
||||
// This is first point.
|
||||
// If it has non-zero alpha, it needs depth,
|
||||
// which we use the max density for.
|
||||
if (spanJ.viz >= 1.0)
|
||||
{
|
||||
// Don't need to worry about this last span!
|
||||
// It is at the end of the continuous span, and
|
||||
// is completely transparent.
|
||||
continue;
|
||||
}
|
||||
|
||||
double dz = DzFromVizDensity (spanJ.viz, maxDensity);
|
||||
spanJ.in = ClampDepth (spanJ.out - dz);
|
||||
if (spanJ.out <= spanJ.in)
|
||||
{
|
||||
spanJ.in = ClampDepth (DecrementPositiveFloat (spanJ.out));
|
||||
}
|
||||
}
|
||||
|
||||
float alphaF = ClampAlpha (1.0 - spanJ.viz);
|
||||
|
||||
// Set the channels!
|
||||
(this->m_deepOutPixel).push_back (spanJ.in, spanJ.out, alphaF);
|
||||
}
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
template <typename RGBA_T>
|
||||
void
|
||||
OneChanDeepOpacityDiscrete<RGBA_T>::processDeepPixel (int i_numPts)
|
||||
{
|
||||
assert (i_numPts > 0);
|
||||
|
||||
// Loop over all the dtex points and get their deepOpacities and
|
||||
// depths.
|
||||
(this->m_spans).resize ((size_t) i_numPts);
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
float z;
|
||||
float pts[4];
|
||||
DtexPixelGetPoint ((this->m_pixel), j, &z, (float*) pts);
|
||||
|
||||
z = ClampDepth (z);
|
||||
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
spanJ.clear ();
|
||||
spanJ.in = z;
|
||||
spanJ.out = z;
|
||||
|
||||
// Data stored in dtex files for "deepopacity" is actually
|
||||
// "deeptransmission", monotonically decreasing from an initial
|
||||
// value of 1.0. We just convert it to viz directly.
|
||||
// (viz == transmissivity)
|
||||
spanJ.deepViz = ClampViz (pts[0]);
|
||||
spanJ.index = j;
|
||||
}
|
||||
|
||||
// Sort the spans.
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
|
||||
// Combine identical depths. Because we have deep opacity,
|
||||
// coincident samples use the maximum deepOpacity value.
|
||||
{
|
||||
int prevSpanIndex = 0;
|
||||
int activeBegin = 0;
|
||||
int activeEnd = 0;
|
||||
float interestingDepth = 0.0f;
|
||||
int numRemoved = 0;
|
||||
|
||||
while (activeBegin < i_numPts)
|
||||
{
|
||||
span_type& spanActiveBegin = (this->m_spans)[activeBegin];
|
||||
float nextInterestingDepth = spanActiveBegin.in;
|
||||
assert (nextInterestingDepth > interestingDepth);
|
||||
|
||||
// This loop combines all the coincident samples
|
||||
// into a single sample, invalidates the other coincident
|
||||
// samples, and sets activeEnd to point to the next
|
||||
// sample with a larger depth.
|
||||
activeEnd = i_numPts;
|
||||
for (int a = activeBegin + 1; a < i_numPts; ++a)
|
||||
{
|
||||
span_type& spanNext = (this->m_spans)[a];
|
||||
|
||||
assert (spanNext.in > interestingDepth);
|
||||
assert (spanNext.in >= nextInterestingDepth);
|
||||
|
||||
if (spanNext.in > nextInterestingDepth)
|
||||
{
|
||||
// This span is not active in this round,
|
||||
// set activeEnd and get out.
|
||||
activeEnd = a;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This span has an identical depth to
|
||||
// the previous one, so we use whichever one has the
|
||||
// largest deep opacity, which equates to the
|
||||
// smallest deep viz.
|
||||
spanActiveBegin.deepViz =
|
||||
std::min (spanActiveBegin.deepViz, spanNext.deepViz);
|
||||
spanNext.in = FLT_MAX;
|
||||
spanNext.out = FLT_MAX;
|
||||
++numRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
// Okay, the deep vizibility at our in point
|
||||
// is equal to the total vizibility before us,
|
||||
// which is the deep vizibility at the previous point,
|
||||
// times the vizibility of this point.
|
||||
// deepViz = deepVizPrev * viz
|
||||
// viz = deepViz / deepVizPrev;
|
||||
if (activeBegin == 0)
|
||||
{
|
||||
spanActiveBegin.viz = spanActiveBegin.deepViz;
|
||||
}
|
||||
else
|
||||
{
|
||||
span_type& spanPrev = (this->m_spans)[prevSpanIndex];
|
||||
|
||||
// Make sure the deep visibilities are
|
||||
// monotonically decreasing with depth.
|
||||
spanActiveBegin.deepViz =
|
||||
std::min (spanActiveBegin.deepViz, spanPrev.deepViz);
|
||||
|
||||
if (spanPrev.deepViz > 0.0)
|
||||
{
|
||||
// If we have non-zero accumulated visibility,
|
||||
// we can compute the span visibility.
|
||||
spanActiveBegin.viz =
|
||||
spanActiveBegin.deepViz / spanPrev.deepViz;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we have zero accumulated visibility,
|
||||
// then the span visibility is also zero.
|
||||
spanActiveBegin.viz = 0.0;
|
||||
}
|
||||
|
||||
// Clean up the viz!
|
||||
spanActiveBegin.viz = ClampViz (spanActiveBegin.viz);
|
||||
}
|
||||
|
||||
prevSpanIndex = activeBegin;
|
||||
activeBegin = activeEnd;
|
||||
interestingDepth = nextInterestingDepth;
|
||||
}
|
||||
|
||||
// If any removed, re-sort the list and remove the end
|
||||
// points.
|
||||
if (numRemoved > 0)
|
||||
{
|
||||
assert (numRemoved < i_numPts);
|
||||
std::sort ((this->m_spans).begin (), (this->m_spans).end ());
|
||||
i_numPts -= numRemoved;
|
||||
(this->m_spans).resize (i_numPts);
|
||||
}
|
||||
}
|
||||
|
||||
// Put the spans back out.
|
||||
for (int j = 0; j < i_numPts; ++j)
|
||||
{
|
||||
span_type& spanJ = (this->m_spans)[j];
|
||||
|
||||
if ((this->m_params).discardZeroAlphaSamples && spanJ.viz >= 1.0)
|
||||
{
|
||||
// This span is transparent, ignore it.
|
||||
continue;
|
||||
}
|
||||
|
||||
float alphaF = ClampAlpha (1.0 - spanJ.viz);
|
||||
|
||||
(this->m_deepOutPixel).push_back (spanJ.in, alphaF);
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace PxDeep
|
||||
|
||||
#endif
|
||||
@@ -1,85 +0,0 @@
|
||||
//-*****************************************************************************
|
||||
|
||||
Pixar's Dtex to Exr conversion utility
|
||||
Aug 1, 2012 - first checkin to OpenEXR 2.0 branch of OpenEXR git repository.
|
||||
|
||||
This utility converts a DTEX deep shadow file to an OpenEXR 2.0 deep exr file,
|
||||
formerly, ".odz" (or .dexr, or whatever extension your facility may use). As of
|
||||
the first checkin, the utility only supports 1, 3, or 4-channel dtex files,
|
||||
corresponding to deep alpha or deep RGBA only. The Nuke DTEX reader, which
|
||||
uses basically the same code, will support a more complete arbitrary channel
|
||||
set, and this utility may be upgraded as well. We also only support a single
|
||||
view for the time being.
|
||||
|
||||
DTEX has a complicated set of interpretations, which represent six separate
|
||||
code paths for conversion to the deep representation in OpenEXR 2.0. They
|
||||
represent the permutations of these exemplary Display Driver config strings
|
||||
to prman:
|
||||
|
||||
Display "+filename.dtex" "deepshad" "deepopacity" "string volumeinterpretation" "continuous"
|
||||
Display "+filename.dtex" "deepshad" "deepopacity" "string volumeinterpretation" "discrete"
|
||||
Display "+filename.dtex" "deepshad" "a" "string volumeinterpretation" "continuous"
|
||||
Display "+filename.dtex" "deepshad" "a" "string volumeinterpretation" "discrete"
|
||||
Display "+filename.dtex" "deepshad" "rgba" "string volumeinterpretation" "continuous"
|
||||
Display "+filename.dtex" "deepshad" "rgba" "string volumeinterpretation" "discrete"
|
||||
|
||||
In our terminology, these six options are called:
|
||||
|
||||
OneChanDeepOpacityContinuous
|
||||
OneChanDeepOpacityDiscrete
|
||||
OneChanDeepAlphaContinuous
|
||||
OneChanDeepAlphaDiscrete
|
||||
FourChanDeepRgbaContinuous
|
||||
FourChanDeepRgbaDiscrete
|
||||
|
||||
Renderman will write out both 1-channel and 3-channel opacity in the
|
||||
"deepopacity" case, which we currently only use the first channel of, as
|
||||
we are only targeting a single opacity curve in space. This may evolve in
|
||||
the future.
|
||||
|
||||
There are weird gotchas for each of these 6 cases, and they are documented
|
||||
in the PxDeepUtils.h file, along with specific comments in each of the six
|
||||
header files that correspond to each case:
|
||||
|
||||
PxOneChanDeepOpacityContinuous.h
|
||||
PxOneChanDeepOpacityDiscrete.h
|
||||
PxOneChanDeepAlphaContinuous.h
|
||||
PxOneChanDeepAlphaDiscrete.h
|
||||
PxFourChanDeepRgbaContinuous.h
|
||||
PxFourChanDeepRgbaDiscrete.h
|
||||
|
||||
The gotchas relate to several issues, mostly to do with coincident or
|
||||
out-of-order samples, precision issues, compression artifacts, and the
|
||||
differences between the "deepopacity" vs "deepalpha" interpretations.
|
||||
|
||||
With "deepopacity" (the pre-prman 16 usage), opacity values stored in
|
||||
dtex files were accumulated, so they were bounded between 0 and 1. The
|
||||
values stored are actually not opacities, but rather transmissivities
|
||||
(1-opacity), and monotonically decreased from fully transparent (1)
|
||||
to fully opaque (0). This representation is ideal for meaningful error
|
||||
minimization during compression, and also for usage as a shadow map
|
||||
by a renderer, because the extinction at a particular depth, at a
|
||||
particular pixel, can be evaluated with a single look-up. However,
|
||||
this representation is poor for deep compositing, because each of the
|
||||
samples includes data from smaller depth samples, and recombination is
|
||||
difficult. With these types of files, when using volumetric (continuous)
|
||||
interpretation, the samples represent the accumulated transmissivity at
|
||||
the NEAR SIDE of a depth span, and our code paths take this into account.
|
||||
|
||||
With all other usages - "a" and "rgba", the values represent filtered
|
||||
samples of the given field at that point in space. The alpha values
|
||||
will be between 0 and 1, but are not guaranteed to be increasing or
|
||||
decreasing. This presents a strange problem for volumetric interpretation,
|
||||
as what does it mean to describe the alpha of an infintesimally small
|
||||
region of space (point sample). The best interpretation of the data
|
||||
in this case uses the alpha to represent the accumulated opacity of
|
||||
the region of space nearer than the sample, and thus each sample
|
||||
represents the FAR SIDE of a depth span. Our code paths take this into
|
||||
account as well.
|
||||
|
||||
Please see the files for additional comments, and the command
|
||||
"dtexToExr" may be run with -h, --h, --help, or no arguments to
|
||||
print its usage.
|
||||
|
||||
-Christopher Horvath, Aug 2012, Pixar
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# If we're on OS X, use glibtoolize instead of toolize
|
||||
HOSTTYPE=`uname`
|
||||
if [ "$HOSTTYPE" == "Darwin" ]; then
|
||||
LIBTOOLIZE=glibtoolize
|
||||
else
|
||||
LIBTOOLIZE=libtoolize
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Check Autoconf version
|
||||
if [ -x `which autoconf` ]; then
|
||||
AC_VER=`autoconf --version | head -n 1 | sed 's/^[^0-9]*//'`
|
||||
AC_VER_MAJOR=`echo $AC_VER | cut -f1 -d'.'`
|
||||
AC_VER_MINOR=`echo $AC_VER | cut -f2 -d'.' | sed 's/[^0-9]*$//'`
|
||||
|
||||
if [ "$AC_VER_MAJOR" -lt "2" ]; then
|
||||
echo "Autoconf 2.13 or greater needed to build configure."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$AC_VER_MINOR" -lt "13" ]; then
|
||||
echo "Autoconf 2.13 or greater needed to build configure."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$AC_VER_MINOR" -lt "50" ]; then
|
||||
if [ ! -e configure.in ]; then
|
||||
ln -s configure.ac configure.in
|
||||
fi
|
||||
echo "If you see some warnings about cross-compiling, don't worry; this is normal."
|
||||
else
|
||||
rm -f configure.in
|
||||
fi
|
||||
else
|
||||
echo autoconf not found. DtexToExr requires autoconf to bootstrap itself.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run_cmd() {
|
||||
echo running $* ...
|
||||
if ! $*; then
|
||||
echo failed!
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if /usr/local/share/aclocal exists
|
||||
if [ -d /usr/local/share/aclocal ]; then
|
||||
ACLOCAL_INCLUDE="$ACLOCAL_INCLUDE -I /usr/local/share/aclocal"
|
||||
fi
|
||||
|
||||
run_cmd aclocal -I m4 $ACLOCAL_INCLUDE
|
||||
run_cmd $LIBTOOLIZE --automake --copy
|
||||
run_cmd automake --add-missing --copy --foreign
|
||||
run_cmd autoconf
|
||||
echo
|
||||
echo "Now type './configure' to configure DtexToExr."
|
||||
echo
|
||||
@@ -1,228 +0,0 @@
|
||||
dnl
|
||||
dnl SPDX-License-Identifier: BSD-3-Clause
|
||||
dnl Copyright (c) Contributors to the OpenEXR Project.
|
||||
dnl
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(DtexToExr, 1.0.0)
|
||||
AC_SUBST(DTEXTOEXR_VERSION, 1.0.0)
|
||||
AC_CANONICAL_HOST
|
||||
AC_CONFIG_SRCDIR(DtexToExr.cpp)
|
||||
AM_INIT_AUTOMAKE(1.6.3) dnl Require automake 1.6.3 or better
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
|
||||
LIBTOOL_CURRENT=6
|
||||
LIBTOOL_REVISION=0
|
||||
LIBTOOL_AGE=0
|
||||
LIBTOOL_VERSION=$LIBTOOL_CURRENT:$LIBTOOL_REVISION:$LIBTOOL_AGE
|
||||
AC_SUBST(LIBTOOL_VERSION)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl
|
||||
dnl PKGCONFIG preparations
|
||||
dnl
|
||||
|
||||
if test -z "${PKG_CONFIG_PATH}"; then
|
||||
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
|
||||
fi
|
||||
|
||||
export PKG_CONFIG_PATH
|
||||
|
||||
LIB64_IF_EXISTS=""
|
||||
if [[ -e /usr/lib64 ]]; then
|
||||
LIB64_IF_EXISTS="-L/usr/lib64"
|
||||
fi
|
||||
|
||||
|
||||
dnl
|
||||
dnl get ccflags and libs from openexr and prmansdk packages
|
||||
dnl
|
||||
|
||||
dnl
|
||||
dnl get ccflags and libs from other packages in use and check
|
||||
dnl whether test programs compile.
|
||||
dnl OpenEXR is required. IlmBase is required.
|
||||
dnl
|
||||
|
||||
dnl
|
||||
dnl check openexr
|
||||
dnl
|
||||
AM_PATH_PKGCONFIG(
|
||||
[OPENEXR_CXXFLAGS],
|
||||
[OPENEXR_LDFLAGS],
|
||||
[OPENEXR_LIBS],
|
||||
[OpenEXR],
|
||||
[OpenEXR],
|
||||
[$LIB64_IF_EXISTS -L/usr/local/lib],
|
||||
[-lOpenEXR -lImath -lIex -lHalf -lz -lpthread],
|
||||
[openexr-prefix])
|
||||
|
||||
|
||||
PRMANSDK_CXXFLAGS=""
|
||||
PRMANSDK_LDFLAGS=""
|
||||
PRMANSDK_LIBS=""
|
||||
PRMANSDK_LIBNAME="prman"
|
||||
|
||||
AC_ARG_WITH(
|
||||
[prmansdk-include-dir],
|
||||
[AS_HELP_STRING([--with-prmansdk-include-dir],
|
||||
[prman sdk include directory])],
|
||||
[PRMANSDK_CXXFLAGS="-I$withval"])
|
||||
|
||||
AC_ARG_WITH(
|
||||
[prmansdk-lib-dir],
|
||||
[AS_HELP_STRING([--with-prmansdk-lib-dir],
|
||||
[prman sdk library directory])],
|
||||
[PRMANSDK_LDFLAGS="-L$withval -Wl,-rpath $withval"])
|
||||
|
||||
AC_ARG_WITH(
|
||||
[prmansdk-libname],
|
||||
[AS_HELP_STRING([--with-prmansdk-libname],
|
||||
[prman sdk library name (default:prman)])],
|
||||
[PRMANSDK_LIBNAME="$withval"])
|
||||
|
||||
PRMANSDK_LIBS="-l$PRMANSDK_LIBNAME"
|
||||
|
||||
export PRMANSDK_CXXFLAGS
|
||||
export PRMANSDK_LDFLAGS
|
||||
export PRMANSDK_LIBS
|
||||
export PRMANSDK_LIBNAME
|
||||
|
||||
AC_SUBST([PRMANSDK_CXXFLAGS])
|
||||
AC_SUBST([PRMANSDK_LDFLAGS])
|
||||
AC_SUBST([PRMANSDK_LIBS])
|
||||
AC_SUBST([PRMANSDK_LIBNAME])
|
||||
|
||||
CXXFLAGS="$CXXFLAGS $PRMANSDK_CXXFLAGS $OPENEXR_CXXFLAGS"
|
||||
LDFLAGS="$LDFLAGS $PRMANSDK_LDFLAGS $OPENEXR_LDFLAGS"
|
||||
|
||||
dnl
|
||||
dnl OpenEXR test program
|
||||
dnl
|
||||
|
||||
AM_COMPILELINKRUN(
|
||||
[OpenEXR],
|
||||
[openexrtest],
|
||||
[$OPENEXR_CXXFLAGS],
|
||||
[$OPENEXR_LDFLAGS],
|
||||
[$OPENEXR_LIBS],[[
|
||||
#include <stdlib.h>
|
||||
#include <ImfTestFile.h>
|
||||
#include <OpenEXRConfig.h>
|
||||
]],
|
||||
[[OPENEXR_IMF_NAMESPACE::isOpenExrFile("notExist");]],
|
||||
AC_MSG_RESULT([Compiled and ran OpenEXR test program.]),
|
||||
AC_MSG_ERROR([Could not compile OpenEXR test program.]))
|
||||
|
||||
dnl
|
||||
dnl Dtex test program
|
||||
dnl
|
||||
|
||||
AM_COMPILELINKRUN(
|
||||
[PrmanSDK],
|
||||
[prmansdktest],
|
||||
[$PRMANSDK_CXXFLAGS],
|
||||
[$PRMANSDK_LDFLAGS],
|
||||
[$PRMANSDK_LIBS],
|
||||
[[
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <dtex.h>
|
||||
]],
|
||||
[[
|
||||
DtexCache* dtexCache = DtexCreateCache( 10000, NULL );
|
||||
if ( dtexCache ) { DtexDestroyCache( dtexCache ); }
|
||||
]],
|
||||
AC_MSG_RESULT([Compiled and ran PrmanSDK test program.]),
|
||||
AC_MSG_ERROR([Could not compile PrmanSDK test program.]))
|
||||
|
||||
|
||||
dnl
|
||||
dnl if some autoconf expert knows how to get the actual prefix used, please
|
||||
dnl tell us. Until then...
|
||||
dnl
|
||||
if test "x$prefix" != "xNONE"; then
|
||||
ACTUAL_PREFIX=$prefix
|
||||
else
|
||||
ACTUAL_PREFIX=/usr/local
|
||||
fi
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(limits.h unistd.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
dnl gcc optimization
|
||||
AC_MSG_CHECKING(for gcc optimization flags)
|
||||
old_cflags=$CFLAGS
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
AC_TRY_COMPILE([#include <stdio.h>],
|
||||
[ printf ("hello, world"); ],
|
||||
[ EXTRA_OPT_CFLAGS="-pipe"],[ EXTRA_OPT_CFLAGS=""])
|
||||
CFLAGS=$old_cflags
|
||||
AC_MSG_RESULT([$EXTRA_OPT_CFLAGS])
|
||||
|
||||
dnl Platform-specific stuff
|
||||
case "$host" in
|
||||
*darwin*)
|
||||
AC_DEFINE(HAVE_DARWIN)
|
||||
|
||||
dnl OS X universal binary support, requires --disable-dependency-tracking
|
||||
AC_ARG_ENABLE(osx-universal-binaries,
|
||||
AC_HELP_STRING([--enable-osx-universal-binaries],
|
||||
[build universal binaries on OS X [[default=no]]]),
|
||||
[build_osxuniversal="${enableval}"], [build_osxuniversal=no])
|
||||
|
||||
if test "${build_osxuniversal}" != no ; then
|
||||
if test "$enable_dependency_tracking" != no ; then
|
||||
AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
|
||||
Please re-run configure with these options:
|
||||
--disable-dependency-tracking --enable-osx-universal-binary
|
||||
])
|
||||
fi
|
||||
CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
|
||||
dnl LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
|
||||
fi
|
||||
|
||||
CXXFLAGS="$CXXFLAGS"
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CFLAGS="$EXTRA_OPT_CFLAGS"
|
||||
AM_CXXFLAGS="$EXTRA_OPT_CFLAGS"
|
||||
|
||||
AC_SUBST(AM_CFLAGS)
|
||||
AC_SUBST(AM_CXXFLAGS)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
])
|
||||
|
||||
if test "x$build_osxuniversal" = xyes; then
|
||||
AC_MSG_RESULT([
|
||||
---------------------------------------------
|
||||
Summary for DtexToExr features:
|
||||
|
||||
build OS X universal binaries $build_osxuniversal
|
||||
---------------------------------------------
|
||||
])
|
||||
else
|
||||
AC_MSG_RESULT([
|
||||
---------------------------------------------
|
||||
Summary for DtexToExr features:
|
||||
|
||||
---------------------------------------------
|
||||
])
|
||||
fi
|
||||
@@ -1,117 +0,0 @@
|
||||
REM @echo off
|
||||
|
||||
Echo LIB Windows Build NuGet
|
||||
|
||||
REM # Build Vars #
|
||||
set _SCRIPT_DRIVE=%~d0
|
||||
set _SCRIPT_FOLDER=%~dp0
|
||||
set INITDIR=%_SCRIPT_FOLDER%
|
||||
set SRC=%INITDIR%\..\..\
|
||||
set BUILDTREE=%SRC%\build-win\
|
||||
SET tbs_arch=x64
|
||||
SET vcvar_arg=x86_amd64
|
||||
SET cmake_platform="Visual Studio 15 2017 Win64"
|
||||
|
||||
REM # VC Vars #
|
||||
SET VCVAR="%programfiles(x86)%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
if exist %VCVAR% call %VCVAR% %vcvar_arg%
|
||||
SET VCVAR="%programfiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
if exist %VCVAR% call %VCVAR% %vcvar_arg%
|
||||
|
||||
REM # Clean Build Tree #
|
||||
rd /s /q %BUILDTREE%
|
||||
mkdir %BUILDTREE%
|
||||
mkdir %BUILDTREE%\deps
|
||||
|
||||
REM # Change to Build Tree drive #
|
||||
%_SCRIPT_DRIVE%
|
||||
REM # Change to Build Tree directory #
|
||||
cd %BUILDTREE%
|
||||
|
||||
:nuget_Dep
|
||||
REM # packages from nuget #
|
||||
mkdir %BUILDTREE%\deps
|
||||
cd %BUILDTREE%\deps
|
||||
SET VER=1.2.11.8899
|
||||
set ZLIBDIR=%BUILDTREE%\deps\zlib-msvc-%tbs_arch%.%VER%\build\native
|
||||
nuget install zlib-msvc-%tbs_arch% -Version %VER%
|
||||
SET VER=1.3.4.8788
|
||||
set FLTKDIR=%BUILDTREE%\deps\FLTK-msvc-%tbs_arch%.%VER%\build\native
|
||||
nuget install FLTK-msvc-%tbs_arch% -Version %VER%
|
||||
|
||||
:copy_files
|
||||
set BINDIR=%SRC%\build-nuget\
|
||||
rd /s /q %BINDIR%
|
||||
mkdir %BINDIR%
|
||||
mkdir %BINDIR%\lib
|
||||
set PATH=%BINDIR%\lib;%PATH%
|
||||
echo %BINDIR%
|
||||
|
||||
:static_LIB
|
||||
REM # LIB STATIC #
|
||||
ECHO %cmake_platform% STATIC
|
||||
|
||||
rd /s /q %BUILDTREE%\OpenEXR
|
||||
mkdir %BUILDTREE%\OpenEXR
|
||||
cd %BUILDTREE%\OpenEXR
|
||||
cmake -G %cmake_platform% ^
|
||||
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
|
||||
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_TOOLS:BOOL=ON ^
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
|
||||
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
|
||||
-DZLIB_LIBRARY=%ZLIBDIR%\lib_release\zlibstatic.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
|
||||
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
|
||||
-DCMAKE_BUILD_TYPE="Release" %SRC%
|
||||
cmake --build . --config Release --target install
|
||||
|
||||
move %BINDIR%lib %BINDIR%lib_release
|
||||
move %BINDIR%bin %BINDIR%bin_release
|
||||
|
||||
REM # DEBUG #
|
||||
REM # Clean Build Tree #
|
||||
rd /s /q %BUILDTREE%\OpenEXR
|
||||
mkdir %BUILDTREE%\OpenEXR
|
||||
cd %BUILDTREE%\OpenEXR
|
||||
cmake -G %cmake_platform% ^
|
||||
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
|
||||
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_TOOLS:BOOL=ON ^
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
|
||||
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
|
||||
-DZLIB_LIBRARY=%ZLIBDIR%\lib_debug\zlibstaticd.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
|
||||
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
|
||||
-DCMAKE_BUILD_TYPE="DEBUG" %SRC%
|
||||
cmake --build . --config DEBUG --target install
|
||||
|
||||
move %BINDIR%lib %BINDIR%lib_debug
|
||||
move %BINDIR%bin %BINDIR%bin_debug
|
||||
|
||||
GOTO:nuget_req
|
||||
mkdir %BINDIR%\static\
|
||||
move /Y %BINDIR%\lib %BINDIR%\static\
|
||||
|
||||
:shared_LIB
|
||||
REM # LIB SHARED #
|
||||
ECHO %cmake_platform% SHARED
|
||||
|
||||
|
||||
:nuget_req
|
||||
cd %BINDIR%
|
||||
REM # make nuget packages from binaries #
|
||||
copy %INITDIR%\OpenEXR-msvc-%tbs_arch%.targets %BINDIR%\OpenEXR-msvc-%tbs_arch%.targets
|
||||
cd %BUILDTREE%
|
||||
nuget pack %INITDIR%\OpenEXR-msvc-%tbs_arch%.nuspec
|
||||
cd %INITDIR%
|
||||
REM --- exit ----
|
||||
GOTO:eof
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>openexr-msvc-x64</id>
|
||||
<version>2.3.0.8788</version>
|
||||
<authors>administrator</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Visual Studio 2017 Release OpenEXR as NuGet package.</description>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\..\LICENSE" target="LICENSE" />
|
||||
<file src="..\..\README.md" target="README.md" />
|
||||
<file src="..\..\build-nuget\**\*.*" target="build\native" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemDefinitionGroup Label="Release and x64" Condition="( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And '$(Platform.ToLower())' == 'x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAS_OpenEXR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(MSBuildThisFileDirectory)../..//build/native/lib_release/*.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Label="Debug and x64" Condition="( $(Configuration.ToLower().IndexOf('debug')) > -1 ) And '$(Platform.ToLower())' == 'x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAS_OpenEXR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(MSBuildThisFileDirectory)../..//build/native/lib_debug/*.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Target Name="openexr-msvc">
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,122 +0,0 @@
|
||||
REM @echo off
|
||||
|
||||
Echo LIB Windows Build NuGet
|
||||
|
||||
REM # Build Vars #
|
||||
set _SCRIPT_DRIVE=%~d0
|
||||
set _SCRIPT_FOLDER=%~dp0
|
||||
set INITDIR=%_SCRIPT_FOLDER%
|
||||
set SRC=%INITDIR%\..\..\
|
||||
set BUILDTREE=%SRC%\build-win\
|
||||
SET tbs_arch=x86
|
||||
SET vcvar_arg=x86
|
||||
SET cmake_platform="Visual Studio 15 2017"
|
||||
|
||||
REM # VC Vars #
|
||||
SET VCVAR="%programfiles(x86)%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
if exist %VCVAR% call %VCVAR% %vcvar_arg%
|
||||
SET VCVAR="%programfiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
if exist %VCVAR% call %VCVAR% %vcvar_arg%
|
||||
|
||||
REM # Clean Build Tree #
|
||||
rd /s /q %BUILDTREE%
|
||||
mkdir %BUILDTREE%
|
||||
mkdir %BUILDTREE%\deps
|
||||
|
||||
REM # Change to Build Tree drive #
|
||||
%_SCRIPT_DRIVE%
|
||||
REM # Change to Build Tree directory #
|
||||
cd %BUILDTREE%
|
||||
|
||||
:nuget_Dep
|
||||
REM # packages from nuget #
|
||||
mkdir %BUILDTREE%\deps
|
||||
cd %BUILDTREE%\deps
|
||||
SET VER=1.2.11.8899
|
||||
set ZLIBDIR=%BUILDTREE%\deps\zlib-msvc-%tbs_arch%.%VER%\build\native
|
||||
nuget install zlib-msvc-%tbs_arch% -Version %VER%
|
||||
SET VER=1.3.4.8788
|
||||
set FLTKDIR=%BUILDTREE%\deps\FLTK-msvc-%tbs_arch%.%VER%\build\native
|
||||
nuget install FLTK-msvc-%tbs_arch% -Version %VER%
|
||||
|
||||
:copy_files
|
||||
set BINDIR=%SRC%\build-nuget\
|
||||
rd /s /q %BINDIR%
|
||||
mkdir %BINDIR%
|
||||
mkdir %BINDIR%\lib
|
||||
set PATH=%BINDIR%\lib;%PATH%
|
||||
echo %BINDIR%
|
||||
|
||||
:static_LIB
|
||||
REM # LIB STATIC #
|
||||
ECHO %cmake_platform% STATIC
|
||||
|
||||
rd /s /q %BUILDTREE%\OpenEXR
|
||||
mkdir %BUILDTREE%\OpenEXR
|
||||
cd %BUILDTREE%\OpenEXR
|
||||
cmake -G %cmake_platform% ^
|
||||
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_ILMBASE:BOOL=ON ^
|
||||
-DOPENEXR_BUILD_OPENEXR:BOOL=ON ^
|
||||
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
|
||||
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_TOOLS:BOOL=ON ^
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
|
||||
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
|
||||
-DZLIB_LIBRARY=%ZLIBDIR%\lib_release\zlibstatic.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
|
||||
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
|
||||
-DCMAKE_BUILD_TYPE="Release" %SRC%
|
||||
cmake --build . --config Release --target install
|
||||
|
||||
move %BINDIR%lib %BINDIR%lib_release
|
||||
move %BINDIR%bin %BINDIR%bin_release
|
||||
|
||||
REM # DEBUG #
|
||||
REM # Clean Build Tree #
|
||||
rd /s /q %BUILDTREE%\OpenEXR
|
||||
mkdir %BUILDTREE%\OpenEXR
|
||||
cd %BUILDTREE%\OpenEXR
|
||||
cmake -G %cmake_platform% ^
|
||||
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_ILMBASE:BOOL=ON ^
|
||||
-DOPENEXR_BUILD_OPENEXR:BOOL=ON ^
|
||||
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_VIEWERS:BOOL=ON ^
|
||||
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
|
||||
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
|
||||
-DOPENEXR_BUILD_TOOLS:BOOL=ON ^
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
|
||||
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
|
||||
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
|
||||
-DZLIB_LIBRARY=%ZLIBDIR%\lib_debug\zlibstaticd.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
|
||||
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
|
||||
-DCMAKE_BUILD_TYPE="DEBUG" %SRC%
|
||||
cmake --build . --config DEBUG --target install
|
||||
|
||||
move %BINDIR%lib %BINDIR%lib_debug
|
||||
move %BINDIR%bin %BINDIR%bin_debug
|
||||
|
||||
GOTO:nuget_req
|
||||
mkdir %BINDIR%\static\
|
||||
move /Y %BINDIR%\lib %BINDIR%\static\
|
||||
|
||||
:shared_LIB
|
||||
REM # LIB SHARED #
|
||||
ECHO %cmake_platform% SHARED
|
||||
|
||||
|
||||
:nuget_req
|
||||
cd %BINDIR%
|
||||
REM # make nuget packages from binaries #
|
||||
copy %INITDIR%\OpenEXR-msvc-%tbs_arch%.targets %BINDIR%\OpenEXR-msvc-%tbs_arch%.targets
|
||||
cd %BUILDTREE%
|
||||
nuget pack %INITDIR%\OpenEXR-msvc-%tbs_arch%.nuspec
|
||||
cd %INITDIR%
|
||||
REM --- exit ----
|
||||
GOTO:eof
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>openexr-msvc-x86</id>
|
||||
<version>2.3.0.8788</version>
|
||||
<authors>administrator</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Visual Studio 2017 Release OpenEXR as NuGet package.</description>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\..\LICENSE" target="LICENSE" />
|
||||
<file src="..\..\README.md" target="README.md" />
|
||||
<file src="..\..\build-nuget\**\*.*" target="build\native" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemDefinitionGroup Label="Release and win32" Condition="( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And '$(Platform.ToLower())' == 'win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAS_OpenEXR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(MSBuildThisFileDirectory)../..//build/native/lib_release/*.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Label="Debug and win32" Condition="( $(Configuration.ToLower().IndexOf('debug')) > -1 ) And '$(Platform.ToLower())' == 'win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAS_OpenEXR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/OpenEXR;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(MSBuildThisFileDirectory)../..//build/native/lib_debug/*.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Target Name="openexr-msvc">
|
||||
</Target>
|
||||
</Project>
|
||||
-154
@@ -1,154 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
# OpenEXR Project Roles and Responsibilities
|
||||
|
||||
OpenEXR is a project of the Academy Software Foundation and relies on
|
||||
the ASWF governance policies, supported by the Linux Foundation.
|
||||
|
||||
There are three primary project roles: a "contributor" submits code to the
|
||||
project; a "committer" approves code to be included into the project; and
|
||||
the "Technical Steering Committee" (TSC) provides overall high-level
|
||||
project guidance.
|
||||
|
||||
* [Contributors](#Contributors)
|
||||
* [Committers](#Committers)
|
||||
* [Technical Steering Committee](#Technical-Steering-Committee)
|
||||
|
||||
## Contributors
|
||||
|
||||
The OpenEXR project grows and thrives from assistance from
|
||||
contributors. A contributor is anyone in the community who submits
|
||||
code, bug fixes, documentation, or other technical artifacts to the
|
||||
project. However, such contributions must be approved by a project
|
||||
committer before they become a part of the project.
|
||||
|
||||
Anyone can be a contributor. You need no formal approval from the
|
||||
project, beyond the legal forms.
|
||||
|
||||
### How to Become a Contributor
|
||||
|
||||
* Review the coding standards to ensure your contribution is in line
|
||||
with the project's coding and styling guidelines.
|
||||
|
||||
* Sign the Individual CLA, or have your organization sign the Corporate CLA.
|
||||
|
||||
* Submit your code as a PR with the appropriate DCO sign-off.
|
||||
|
||||
## Committers
|
||||
|
||||
Project committers have merge access on the OpenEXR GitHub repositories
|
||||
and are responsible for approving submissions by contributors.
|
||||
|
||||
### Committer Responsibilities
|
||||
|
||||
Typical activities of a committer include:
|
||||
|
||||
* Helping users and novice contributors.
|
||||
|
||||
* Ensuring a response to questions posted to the
|
||||
openexr-dev@lists.aswf.io mailing list.
|
||||
|
||||
* Contributing code and documentation changes that improve the
|
||||
project.
|
||||
|
||||
* Reviewing and commenting on issues and pull requests.
|
||||
|
||||
* Ensuring that changes and new code meet acceptable standards and are
|
||||
in the long-term interest of the project.
|
||||
|
||||
* Participating in working groups.
|
||||
|
||||
* Merging pull requests.
|
||||
|
||||
### How to Become a Committer
|
||||
|
||||
Any existing committer can nominate an individual making significant
|
||||
and valuable contributions to the OpenEXR project to become a new
|
||||
committer. New committers are approved by vote of the TSC.
|
||||
|
||||
If you are interested in becoming a committer, contact the TSC at
|
||||
info@openexr.com.
|
||||
|
||||
## Technical Steering Committee
|
||||
|
||||
The Technical Steering Committee (TSC) oversees the overall technical
|
||||
direction of OpenEXR, as defined in the project
|
||||
[charter](ASWF/charter/OpenEXR-Technical-Charter.md). This
|
||||
charter defines the TSC member terms and succession policies.
|
||||
|
||||
The responsibilities of the TSC include:
|
||||
|
||||
* Coordinating technical direction of the project.
|
||||
|
||||
* Project governance and contribution policy.
|
||||
|
||||
* GitHub repository administration.
|
||||
|
||||
* Maintaining the list of additional committers.
|
||||
|
||||
* Appointing representatives to work with other open source or open
|
||||
standards communities.
|
||||
|
||||
* Discussions, seeking consensus, and where necessary, voting on
|
||||
technical matters relating to the code base that affect multiple
|
||||
projects.
|
||||
|
||||
* Coordinating any marketing, events, or communications regarding the
|
||||
project.
|
||||
|
||||
The TSC elects a Chair person, who acts as the project manager,
|
||||
organizing meetings and providing oversight to project
|
||||
administration. The Chair is elected by the TSC. The Chair also
|
||||
serves as the OpenEXR representative on the Academy Software
|
||||
Foundation (ASWF) Technical Advisory Council (TAC). The chair
|
||||
represents the project at ASWF TAC meetings.
|
||||
|
||||
### Current TSC Members
|
||||
|
||||
* Cary Phillips (chair) - Industrial Light & Magic
|
||||
* Rod Bogart - Epic Games
|
||||
* Larry Gritz - Sony Pictures ImageWorks
|
||||
* Peter Hillman - Weta Digital, Ltd.
|
||||
* Kimball Thurston - Weta Digital, Ltd.
|
||||
* Nick Porcino - Pixar Animation Studios
|
||||
* Christina Tempelaar-Lietz - Industrial Light & Magic
|
||||
* Joseph Goldstone - ARRI
|
||||
* John Mertic - The Linux Foundation
|
||||
|
||||
### TSC Meetings
|
||||
|
||||
All meetings of the TSC are open to participation by any member of the
|
||||
OpenEXR community. Meeting times are listed in the [ASWF technical
|
||||
community calendar](https://lists.aswf.io/g/tac/calendar), currently
|
||||
each Thursday at 1:30pm Pacific Time via Zoom video conference. The
|
||||
TSC Chair moderates the meeting, or appoints another TSC member to
|
||||
moderate in his or her absence.
|
||||
|
||||
Items are added to the TSC agenda which are considered contentious or
|
||||
are modifications of governance, contribution policy, TSC membership,
|
||||
or release process, in addition to topics involving the high-level
|
||||
technical direction of the project.
|
||||
|
||||
The intention of the agenda is not to approve or review all
|
||||
patches. That should happen continuously on GitHub and be handled by
|
||||
the larger group of committers.
|
||||
|
||||
Any community member or contributor can ask that something be reviewed
|
||||
by the TSC at the meeting by logging a GitHub issue. Any committer,
|
||||
TSC member, or the meeting chair can bring the issue to the TSC's
|
||||
attention by applying the `TSC` label.
|
||||
|
||||
Prior to each TSC meeting, the meeting chair will share the agenda with members
|
||||
of the TSC. TSC members can also add items to the agenda at the beginning of
|
||||
each meeting. The meeting chair and the TSC cannot veto or remove items.
|
||||
|
||||
The TSC may invite additional persons to participate in a non-voting capacity.
|
||||
|
||||
The meeting chair is responsible for archiving the minutes, stored at
|
||||
https://wiki.aswf.io/display/OEXR/TSC+Meetings.
|
||||
|
||||
Due to the challenges of scheduling a global meeting with participants
|
||||
in several time zones, the TSC will seek to resolve as many agenda
|
||||
items as possible outside of meetings on the public mailing list.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Define and set to 1 if the target system has POSIX thread support
|
||||
// and you want IlmBase to use it for multithreaded file I/O.
|
||||
//
|
||||
|
||||
#undef HAVE_PTHREAD
|
||||
|
||||
//
|
||||
// Define and set to 1 if the target system supports POSIX semaphores
|
||||
// and you want OpenEXR to use them; otherwise, OpenEXR will use its
|
||||
// own semaphore implementation.
|
||||
//
|
||||
|
||||
#undef HAVE_POSIX_SEMAPHORES
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
configincludedir = $(includedir)/OpenEXR
|
||||
|
||||
configinclude_HEADERS = IlmBaseConfig.h
|
||||
|
||||
EXTRA_DIST = IlmBaseConfig.h.in
|
||||
@@ -1,7 +1,4 @@
|
||||
dnl
|
||||
dnl SPDX-License-Identifier: BSD-3-Clause
|
||||
dnl Copyright (c) Contributors to the OpenEXR Project.
|
||||
dnl
|
||||
|
||||
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
dnl
|
||||
dnl Modified by Wojciech Jarosz (2005) to include check for POSIX
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
Copyright (c) Contributors to the OpenEXR Project. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the copyright holder 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 HOLDER 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.
|
||||
@@ -1,9 +0,0 @@
|
||||
module(
|
||||
name = "openexr",
|
||||
version = "0.0.0", # The version "0.0.0" is set here and will be patched within the Bazel Central Registry
|
||||
compatibility_level = 1,
|
||||
)
|
||||
|
||||
bazel_dep(name = "bazel_skylib", version = "1.4.2")
|
||||
bazel_dep(name = "imath", version = "3.1.9")
|
||||
bazel_dep(name = "libdeflate", version = "1.18")
|
||||
@@ -1,8 +1,4 @@
|
||||
dnl
|
||||
dnl SPDX-License-Identifier: BSD-3-Clause
|
||||
dnl Copyright (c) Contributors to the OpenEXR Project.
|
||||
dnl
|
||||
dnl
|
||||
dnl
|
||||
dnl compilelinkrun.m4 - used to check whether a required package is properly
|
||||
dnl installed. Compiles, links and runs a c++ test program that uses the
|
||||
@@ -26,10 +22,10 @@ dnl $6: body section of sourcecode for a c++ test program
|
||||
dnl The test program should make use of a library that is supposed to
|
||||
dnl be tested.
|
||||
dnl
|
||||
dnl $7: the action to be performed if the test succeeds
|
||||
dnl $7: the action to be perfomed if the test succeeds
|
||||
dnl (e.g. AC_MSG_RESULT("OpenEXR test program succeeded"))
|
||||
dnl
|
||||
dnl $8 the action to be performed if the test fails
|
||||
dnl $8 the action to be perfomed if the test fails
|
||||
dnl (e.g. AC_MSG_ERROR("OpenEXR test program failed"))
|
||||
dnl
|
||||
|
||||
@@ -41,11 +37,10 @@ define([arg_pkg_name],$1)
|
||||
define([arg_disable],$2)
|
||||
define([arg_cxxflags],$3)
|
||||
define([arg_ldflags],$4)
|
||||
define([arg_libs],$5)
|
||||
define([arg_include_source],$6)
|
||||
define([arg_body_source],$7)
|
||||
define([arg_do_yes],$8)
|
||||
define([arg_do_no],$9)
|
||||
define([arg_include_source],$5)
|
||||
define([arg_body_source],$6)
|
||||
define([arg_do_yes],$7)
|
||||
define([arg_do_no],$8)
|
||||
|
||||
|
||||
dnl check arguments
|
||||
@@ -64,10 +59,8 @@ dnl
|
||||
dnl save settings and setup c++ before we start
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CXXFLAGS="$CXXFLAGS arg_cxxflags"
|
||||
LDFLAGS="$LDFLAGS arg_ldflags"
|
||||
LIBS="$LIBS arg_libs"
|
||||
AC_REQUIRE_CPP()
|
||||
AC_LANG_PUSH([C++])
|
||||
rm -f conf.testprogram
|
||||
@@ -152,7 +145,6 @@ dnl
|
||||
AC_LANG_POP([C++])
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
|
||||
dnl
|
||||
dnl clean up
|
||||
@@ -166,7 +158,6 @@ undefine([arg_pkg_name])
|
||||
undefine([arg_disable])
|
||||
undefine([arg_cxxflags])
|
||||
undefine([arg_ldflags])
|
||||
undefine([arg_libs])
|
||||
undefine([arg_include_source])
|
||||
undefine([arg_body_source])
|
||||
undefine([arg_do_yes])
|
||||
@@ -1,13 +1,8 @@
|
||||
dnl
|
||||
dnl SPDX-License-Identifier: BSD-3-Clause
|
||||
dnl Copyright (c) Contributors to the OpenEXR Project.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([AM_PATH_PKGCONFIG],
|
||||
[
|
||||
|
||||
dnl sets cflags and ldflags
|
||||
dnl TEST_CXXFLAGS and TEST_LDFLAGS, by trying the following
|
||||
dnl TEST_CXXFLAGS and TEST_LDFLAGS, by trying thes following
|
||||
dnl until something works:
|
||||
dnl
|
||||
dnl 1 - try the test_prefix
|
||||
@@ -21,14 +16,14 @@ dnl $1: arg_cxxflags - CXXFLAGS variable to set
|
||||
dnl
|
||||
dnl $2: arg-ldflags - LDFLAGS variable to set
|
||||
dnl
|
||||
dnl $3: package name (the package being checked), as required by pkg-config
|
||||
dnl $3: package name (the package being checked), as requried by pkg-config
|
||||
dnl
|
||||
dnl $4: arg_include_subdir
|
||||
dnl the name of the subdirectory name that is tacked on to
|
||||
dnl the end of the include path e.g. "OpenEXR" in
|
||||
dnl /usr/local/include/OpenEXR
|
||||
dnl
|
||||
dnl $5: arg_default_libs - default libraries, used if pkgconfig doesn't work
|
||||
dnl $5: arg_default_libs - default libraries, used if pkgconfig doesnt work
|
||||
dnl
|
||||
dnl $6: arg_test_prefix
|
||||
dnl the argument passed to configure specifying a directory to
|
||||
@@ -41,16 +36,13 @@ dnl
|
||||
dnl create some local m4 "variables" so that we don't have to use numbers
|
||||
define([arg_cxxflags],$1)
|
||||
define([arg_ldflags],$2)
|
||||
define([arg_libs],$3)
|
||||
define([arg_pkg_name],$4)
|
||||
define([arg_include_subdir],$5)
|
||||
define([arg_default_ldflags],$6)
|
||||
define([arg_default_libs],$7)
|
||||
define([arg_test_prefix],$8)
|
||||
define([arg_pkg_name],$3)
|
||||
define([arg_include_subdir],$4)
|
||||
define([arg_default_libs],$5)
|
||||
define([arg_test_prefix],$6)
|
||||
|
||||
TEST_CXXFLAGS=""
|
||||
TEST_LDFLAGS=""
|
||||
TEST_LIBS=""
|
||||
|
||||
AC_ARG_WITH(arg_test_prefix,[ --with-arg_test_prefix=PFX Prefix where tested libraries are supposed to be installed (optional)], test_prefix="$withval", test_prefix="NONE")
|
||||
echo "test_prefix = $test_prefix"
|
||||
@@ -61,40 +53,33 @@ AC_ARG_WITH(pkg-config,[ --with-pkg-config=PATH Specify which pkg-config to use
|
||||
|
||||
|
||||
if test "x$test_prefix" != "xNONE" ; then
|
||||
echo "using arg_test_prefix to set arg_cxxflags, arg_ldflags and arg_libs:"
|
||||
echo "using arg_test_prefix to set arg_cxxflags and arg_ldflags:"
|
||||
for inc_dir in arg_include_subdir
|
||||
do
|
||||
TEST_CXXFLAGS="$TEST_CXXFLAGS -I$test_prefix/include/$inc_dir"
|
||||
done
|
||||
TEST_LDFLAGS="-L$test_prefix/lib"
|
||||
TEST_LDFLAGS="$TEST_LDFLAGS arg_default_ldflags"
|
||||
TEST_LIBS="arg_default_libs"
|
||||
TEST_LDFLAGS="$TEST_LDFLAGS arg_default_libs"
|
||||
else
|
||||
dnl
|
||||
dnl Get the cflags and libraries from the arg_pkg_name package using
|
||||
dnl pkg-config
|
||||
dnl
|
||||
dnl Note: the TEST_LIBS contains both the -L and the -l flags. This means
|
||||
dnl the -L flags will appear twice on the command line, but we can not
|
||||
dnl limit it to --libs-only-l because it may include the "-pthread" flag.
|
||||
dnl
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
echo "using pkg-config to set arg_cxxflags and arg_ldflags:"
|
||||
TEST_CXXFLAGS="`$PKG_CONFIG --cflags arg_pkg_name`"
|
||||
TEST_LDFLAGS="`$PKG_CONFIG --libs-only-L arg_pkg_name`"
|
||||
TEST_LIBS="`$PKG_CONFIG --libs arg_pkg_name`"
|
||||
TEST_LDFLAGS="`$PKG_CONFIG --libs arg_pkg_name`"
|
||||
else
|
||||
echo "Not using pkg-config."
|
||||
TEST_CXXFLAGS=""
|
||||
TEST_LDFLAGS=""
|
||||
TEST_LIBS=""
|
||||
echo "unsetting flags:"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl if the flags are still not set, try a prefix and finally a default
|
||||
dnl if the flags are still not set, try a prefix an finally a default
|
||||
dnl
|
||||
if test -z "${TEST_CXXFLAGS}"; then
|
||||
TEST_CXXFLAGS=""
|
||||
TEST_CXXFLAGS="-pthread"
|
||||
if test "x$prefix" != "xNONE"; then
|
||||
echo "using prefix to set arg_cxxflags and arg_ldflags:"
|
||||
for inc_dir in arg_include_subdir
|
||||
@@ -108,29 +93,25 @@ else
|
||||
do
|
||||
TEST_CXXFLAGS="$TEST_CXXFLAGS -I/usr/local/include/$inc_dir"
|
||||
done
|
||||
TEST_LDFLAGS="arg_default_ldflags"
|
||||
TEST_LDFLAGS="-L/usr/local/lib"
|
||||
fi
|
||||
TEST_LIBS="arg_default_libs"
|
||||
TEST_LDFLAGS="$TEST_LDFLAGS arg_default_libs"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo " arg_cxxflags = $TEST_CXXFLAGS"
|
||||
echo " arg_ldflags = $TEST_LDFLAGS"
|
||||
echo " arg_libs = $TEST_LIBS"
|
||||
|
||||
|
||||
AC_SUBST(arg_cxxflags, $TEST_CXXFLAGS)
|
||||
AC_SUBST(arg_ldflags, $TEST_LDFLAGS)
|
||||
AC_SUBST(arg_libs, $TEST_LIBS)
|
||||
|
||||
|
||||
dnl clean up local "variables"
|
||||
undefine([arg_cxxflags])
|
||||
undefine([arg_ldflags])
|
||||
undefine([arg_libs])
|
||||
undefine([arg_pkg_name])
|
||||
undefine([arg_include_subdir])
|
||||
undefine([arg_default_ldflags])
|
||||
undefine([arg_default_libs])
|
||||
undefine([arg_test_prefix])
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
configincludedir = $(includedir)/OpenEXR
|
||||
|
||||
configinclude_HEADERS = OpenEXR_ViewersConfig.h
|
||||
|
||||
EXTRA_DIST = OpenEXR_ViewersConfig.h.in
|
||||
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// Define and set to 1 if the target system includes the NVIDIA Cg
|
||||
// runtime. The exrdisplay program will use a fragment shader to
|
||||
// accelerate the display of OpenEXR images.
|
||||
//
|
||||
|
||||
#undef HAVE_FRAGMENT_SHADERS
|
||||
@@ -0,0 +1,166 @@
|
||||
dnl
|
||||
dnl
|
||||
dnl compilelinkrun.m4 - used to check whether a required package is properly
|
||||
dnl installed. Compiles, links and runs a c++ test program that uses the
|
||||
dnl package to verify that the package is properly installed
|
||||
dnl
|
||||
dnl Expected arguments:
|
||||
dnl $1: the name of the package we are testing, e.g. "OpenEXR"
|
||||
dnl used for informational messages, warnings & errors
|
||||
dnl
|
||||
dnl $2: the argument passed to configure specifying how to disable this test
|
||||
dnl for example:
|
||||
dnl $3 = "openexrtest" and
|
||||
dnl "configure --disable-openexrtest" will skip the test
|
||||
dnl
|
||||
dnl $3: CXXFLAGS used by the test
|
||||
dnl
|
||||
dnl $4: LDFLAGS used by the test
|
||||
dnl
|
||||
dnl $5: include section of sourcecode for a c++ test program
|
||||
dnl $6: body section of sourcecode for a c++ test program
|
||||
dnl The test program should make use of a library that is supposed to
|
||||
dnl be tested.
|
||||
dnl
|
||||
dnl $7: the action to be perfomed if the test succeeds
|
||||
dnl (e.g. AC_MSG_RESULT("OpenEXR test program succeeded"))
|
||||
dnl
|
||||
dnl $8 the action to be perfomed if the test fails
|
||||
dnl (e.g. AC_MSG_ERROR("OpenEXR test program failed"))
|
||||
dnl
|
||||
|
||||
AC_DEFUN([AM_COMPILELINKRUN],
|
||||
[
|
||||
|
||||
dnl create some local m4 "variables" so that we don't have to use numbers
|
||||
define([arg_pkg_name],$1)
|
||||
define([arg_disable],$2)
|
||||
define([arg_cxxflags],$3)
|
||||
define([arg_ldflags],$4)
|
||||
define([arg_include_source],$5)
|
||||
define([arg_body_source],$6)
|
||||
define([arg_do_yes],$7)
|
||||
define([arg_do_no],$8)
|
||||
|
||||
|
||||
dnl check arguments
|
||||
AC_ARG_ENABLE(arg_disable, [ --disable-arg_disable Do not try to compile and run a test arg_pkg_name program],, enable_programtest=yes)
|
||||
|
||||
|
||||
dnl
|
||||
dnl if the test hasn't been disabled, then compile, link and run test program
|
||||
dnl
|
||||
if test "x$enable_programtest" = "xyes" ; then
|
||||
|
||||
dnl basic preliminary checks
|
||||
AC_MSG_CHECKING(for arg_pkg_name)
|
||||
test_runs="yes"
|
||||
|
||||
dnl save settings and setup c++ before we start
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS arg_cxxflags"
|
||||
LDFLAGS="$LDFLAGS arg_ldflags"
|
||||
AC_REQUIRE_CPP()
|
||||
AC_LANG_PUSH([C++])
|
||||
rm -f conf.testprogram
|
||||
|
||||
dnl
|
||||
dnl first try a complete test - compile, link run
|
||||
dnl
|
||||
AC_RUN_IFELSE([AC_LANG_PROGRAM(arg_include_source,
|
||||
arg_body_source; [[system("touch conf.testprogram"); ]])],
|
||||
test_runs=yes,
|
||||
test_runs=no,
|
||||
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
|
||||
if test "x$test_runs" = "xyes" || test -f conf.testprogram ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([arg_do_yes], , :, [arg_do_yes])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
echo "*** Could not run the arg_pkg_name test program, checking why..."
|
||||
|
||||
test_compiles="yes"
|
||||
test_links="yes"
|
||||
|
||||
dnl
|
||||
dnl if the program did not run, attempt to compile only
|
||||
dnl
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(arg_include_source,
|
||||
arg_body_source ; )],
|
||||
test_compiles=yes,
|
||||
test_compiles=no)
|
||||
|
||||
if test "x$test_compiles" = "xno" ; then
|
||||
echo "*** The test program could not be compiled. Is arg_pkg_name installed?"
|
||||
echo "*** Check that the cflags (below) includes the arg_pkg_name include directory"
|
||||
|
||||
else
|
||||
dnl
|
||||
dnl if the program did compile, try linking
|
||||
dnl
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(arg_include_source,
|
||||
arg_body_source ; )],
|
||||
test_links=yes,
|
||||
test_links=no)
|
||||
|
||||
if test "x$test_links" = "xyes"; then
|
||||
echo "*** The test program compiled and staticly linked, but did not run. This "
|
||||
echo "*** usually means that the run-time linker is not finding arg_pkg_name or finding"
|
||||
echo "*** the wrong version of arg_pkg_name."
|
||||
echo "***"
|
||||
echo "*** If the linker is not finding arg_pkg_name, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system."
|
||||
else
|
||||
echo "*** The arg_pkg_name test program could be compiled, but could not be dynamically."
|
||||
echo "*** or statically linked."
|
||||
echo "***"
|
||||
echo "*** Make sure the LDFLAGS points to the location of the arg_pkg_name library."
|
||||
echo "*** (e.g. -L/usr/local/lib)."
|
||||
echo "*** If the run-time linker is not finding arg_pkg_name, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system."
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl The test failed for some reason. Print out more info,
|
||||
dnl unset flags and signal an error.
|
||||
dnl
|
||||
echo "***"
|
||||
echo "*** Flags used by the test:"
|
||||
echo "*** cflags: $CXXFLAGS "
|
||||
echo "*** ldflags: $LDFLAGS"
|
||||
echo "***"
|
||||
echo "*** You can also run configure with --disable-arg_disable to skip this test."
|
||||
|
||||
ifelse([arg_do_no], , :, [arg_do_no])
|
||||
fi
|
||||
|
||||
AC_LANG_POP([C++])
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
|
||||
dnl
|
||||
dnl clean up
|
||||
dnl
|
||||
rm -f conf.testprogram
|
||||
fi
|
||||
|
||||
|
||||
dnl clean up local "variables"
|
||||
undefine([arg_pkg_name])
|
||||
undefine([arg_disable])
|
||||
undefine([arg_cxxflags])
|
||||
undefine([arg_ldflags])
|
||||
undefine([arg_include_source])
|
||||
undefine([arg_body_source])
|
||||
undefine([arg_do_yes])
|
||||
undefine([arg_do_no])
|
||||
|
||||
])
|
||||
@@ -0,0 +1,65 @@
|
||||
|
||||
dnl
|
||||
dnl Cg support
|
||||
dnl
|
||||
|
||||
AC_DEFUN([AM_PATH_CG],
|
||||
[dnl
|
||||
dnl Get the cflags
|
||||
dnl
|
||||
AC_ARG_WITH(cg-prefix,[ --with-cg-prefix=PFX Prefix where Cg is installed (optional)],
|
||||
cg_prefix="$withval", cg_prefix="")
|
||||
|
||||
if test x$cg_prefix != x ; then
|
||||
CG_CXXFLAGS="-I$cg_prefix/include"
|
||||
CG_LDFLAGS="-L$cg_prefix/lib -lGL -lCg -lCgGL -lGLU -lpthread"
|
||||
else
|
||||
CG_CXXFLAGS=""
|
||||
CG_LDFLAGS="-lGL -lCg -lCgGL -lGLU -lpthread"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for Cg)
|
||||
no_cg=""
|
||||
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $CG_CXXFLAGS"
|
||||
LDFLAGS="$CG_LDFLAGS"
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_LINK([
|
||||
#include <GL/gl.h>
|
||||
#include <Cg/cg.h>
|
||||
#include <Cg/cgGL.h>],
|
||||
[
|
||||
cgCreateContext ();
|
||||
],, no_cg=yes)
|
||||
AC_LANG_RESTORE
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
|
||||
if test "x$no_cg" = "x" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$1], , :, [$1])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
echo "*** The Cg test program could not be compiled."
|
||||
echo "*** Possible reasons:"
|
||||
echo "*** - The Cg libraries and includes are not installed."
|
||||
echo "*** - configure cannot find Cg (use the"
|
||||
echo "*** --with-cg-prefix option to tell configure where"
|
||||
echo "*** to find it)."
|
||||
echo "*** - Your version of Cg is out of date. Please update it"
|
||||
echo "*** to the latest version."
|
||||
echo "***"
|
||||
echo "*** The exrdisplay program will not be built with fragment shader"
|
||||
echo "*** support because the fragment shader support depends on Cg."
|
||||
CG_CXXFLAGS=""
|
||||
CG_LDFLAGS=""
|
||||
ifelse([$2], , :, [$2])
|
||||
fi
|
||||
AC_SUBST(CG_CXXFLAGS)
|
||||
AC_SUBST(CG_LDFLAGS)
|
||||
])
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
dnl
|
||||
dnl FLTK with GL support
|
||||
dnl
|
||||
|
||||
AC_DEFUN([AM_PATH_FLTK],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries
|
||||
dnl
|
||||
AC_ARG_VAR(FLTK_CONFIG, Path to fltk-config command)
|
||||
AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
|
||||
AC_ARG_WITH(fltk-config,[ --with-fltk-config=PATH Specify which fltk-config to use (optional)], FLTK_CONFIG="$withval",)
|
||||
|
||||
if test x$FLTK_CONFIG != xno ; then
|
||||
FLTK_CXXFLAGS="`$FLTK_CONFIG --use-gl --cxxflags`"
|
||||
FLTK_LDFLAGS="`$FLTK_CONFIG --use-gl --ldflags`"
|
||||
else
|
||||
FLTK_CXXFLAGS=""
|
||||
FLTK_LDFLAGS=""
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for FLTK with GL support)
|
||||
no_fltk=""
|
||||
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $FLTK_CXXFLAGS"
|
||||
LDFLAGS="$LDFLAGS $FLTK_LDFLAGS"
|
||||
|
||||
dnl
|
||||
dnl Now check if the installed FLTK has GL support
|
||||
dnl
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_LINK([
|
||||
#include <stdlib.h>
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Gl_Window.H>],
|
||||
[
|
||||
Fl_Gl_Window foo ();
|
||||
],, no_fltk=yes)
|
||||
AC_LANG_RESTORE
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
|
||||
if test "x$no_fltk" = "x" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$1], , :, [$1])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
echo "*** The fltk test program could not be compiled. Possible reasons:"
|
||||
echo "***"
|
||||
echo "*** - FLTK is not installed."
|
||||
echo "*** - Your version of FLTK does not support OpenGL."
|
||||
echo "*** - configure cannot find your 'fltk-config' program (use"
|
||||
echo "*** the --with-fltk-config option to tell configure where"
|
||||
echo "*** to find it)."
|
||||
echo "*** - Your version of FLTK is too old. The exrdisplay"
|
||||
echo "*** program requires FLTK 1.1 or higher."
|
||||
echo "*** - Your FLTK library was compiled with a different C++"
|
||||
echo "*** compiler than the one you're using to compile OpenEXR."
|
||||
echo "***"
|
||||
echo "*** The exrdisplay program will not be built because it depends on"
|
||||
echo "*** a working FLTK install with OpenGL support."
|
||||
FLTK_CXXFLAGS=""
|
||||
FLTK_LDFLAGS=""
|
||||
ifelse([$2], , :, [$2])
|
||||
fi
|
||||
AC_SUBST(FLTK_CXXFLAGS)
|
||||
AC_SUBST(FLTK_LDFLAGS)
|
||||
])
|
||||
@@ -0,0 +1,18 @@
|
||||
dnl
|
||||
dnl Alternate OpenGL headers (e.g. for Nvidia headers)
|
||||
dnl
|
||||
|
||||
AC_DEFUN([AM_PATH_GL],
|
||||
[dnl
|
||||
dnl Get the cflags
|
||||
dnl
|
||||
AC_ARG_WITH(gl-includes,[ --with-gl-includes=PFX Specify which OpenGL headers to use],
|
||||
gl_includes="$withval", gl_includes="")
|
||||
if test x$gl_includes != x ; then
|
||||
GL_CXXFLAGS="-I$gl_includes"
|
||||
else
|
||||
GL_CXXFLAGS=""
|
||||
fi
|
||||
|
||||
AC_SUBST(GL_CXXFLAGS)
|
||||
])
|
||||
@@ -0,0 +1,120 @@
|
||||
AC_DEFUN([AM_PATH_PKGCONFIG],
|
||||
[
|
||||
|
||||
dnl sets cflags and ldflags
|
||||
dnl TEST_CXXFLAGS and TEST_LDFLAGS, by trying thes following
|
||||
dnl until something works:
|
||||
dnl
|
||||
dnl 1 - try the test_prefix
|
||||
dnl 2 - check whether pkgconfig can find values (unless --with-pkg-config=no)
|
||||
dnl 3 - use the prefix, if it is not the default
|
||||
dnl 4 - use defaults, /usr/local/include/OpenEXR and /usr/local/lib
|
||||
dnl
|
||||
dnl
|
||||
dnl Expected arguments
|
||||
dnl $1: arg_cxxflags - CXXFLAGS variable to set
|
||||
dnl
|
||||
dnl $2: arg-ldflags - LDFLAGS variable to set
|
||||
dnl
|
||||
dnl $3: package name (the package being checked), as requried by pkg-config
|
||||
dnl
|
||||
dnl $4: arg_include_subdir
|
||||
dnl the name of the subdirectory name that is tacked on to
|
||||
dnl the end of the include path e.g. "OpenEXR" in
|
||||
dnl /usr/local/include/OpenEXR
|
||||
dnl
|
||||
dnl $5: arg_default_libs - default libraries, used if pkgconfig doesnt work
|
||||
dnl
|
||||
dnl $6: arg_test_prefix
|
||||
dnl the argument passed to configure specifying a directory to
|
||||
dnl be used in the CXX and LD flags for example:
|
||||
dnl $2 = "openexr-prefix" and
|
||||
dnl "configure --openexr-prefix=/usr/lib"
|
||||
dnl leads to CXX including "-I/usr/lib/OpenEXR"
|
||||
dnl
|
||||
|
||||
dnl create some local m4 "variables" so that we don't have to use numbers
|
||||
define([arg_cxxflags],$1)
|
||||
define([arg_ldflags],$2)
|
||||
define([arg_pkg_name],$3)
|
||||
define([arg_include_subdir],$4)
|
||||
define([arg_default_libs],$5)
|
||||
define([arg_test_prefix],$6)
|
||||
|
||||
TEST_CXXFLAGS=""
|
||||
TEST_LDFLAGS=""
|
||||
|
||||
AC_ARG_WITH(arg_test_prefix,[ --with-arg_test_prefix=PFX Prefix where tested libraries are supposed to be installed (optional)], test_prefix="$withval", test_prefix="NONE")
|
||||
echo "test_prefix = $test_prefix"
|
||||
|
||||
AC_ARG_VAR(PKG_CONFIG, Path to pkg-config command)
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
AC_ARG_WITH(pkg-config,[ --with-pkg-config=PATH Specify which pkg-config to use (optional)], PKG_CONFIG="$withval",)
|
||||
|
||||
|
||||
if test "x$test_prefix" != "xNONE" ; then
|
||||
echo "using arg_test_prefix to set arg_cxxflags and arg_ldflags:"
|
||||
for inc_dir in arg_include_subdir
|
||||
do
|
||||
TEST_CXXFLAGS="$TEST_CXXFLAGS -I$test_prefix/include/$inc_dir"
|
||||
done
|
||||
TEST_LDFLAGS="-L$test_prefix/lib"
|
||||
TEST_LDFLAGS="$TEST_LDFLAGS arg_default_libs"
|
||||
else
|
||||
dnl
|
||||
dnl Get the cflags and libraries from the arg_pkg_name package using
|
||||
dnl pkg-config
|
||||
dnl
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
echo "using pkg-config to set arg_cxxflags and arg_ldflags:"
|
||||
TEST_CXXFLAGS="`$PKG_CONFIG --cflags arg_pkg_name`"
|
||||
TEST_LDFLAGS="`$PKG_CONFIG --libs arg_pkg_name`"
|
||||
else
|
||||
TEST_CXXFLAGS=""
|
||||
TEST_LDFLAGS=""
|
||||
echo "unsetting flags:"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl if the flags are still not set, try a prefix an finally a default
|
||||
dnl
|
||||
if test -z "${TEST_CXXFLAGS}"; then
|
||||
TEST_CXXFLAGS="-pthread"
|
||||
if test "x$prefix" != "xNONE"; then
|
||||
echo "using prefix to set arg_cxxflags and arg_ldflags:"
|
||||
for inc_dir in arg_include_subdir
|
||||
do
|
||||
TEST_CXXFLAGS="$TEST_CXXFLAGS -I$prefix/include/$inc_dir"
|
||||
done
|
||||
TEST_LDFLAGS="-L$prefix/lib"
|
||||
else
|
||||
echo "using default as guess for arg_cxxflags and arg_ldflags:"
|
||||
for inc_dir in arg_include_subdir
|
||||
do
|
||||
TEST_CXXFLAGS="$TEST_CXXFLAGS -I/usr/local/include/$inc_dir"
|
||||
done
|
||||
TEST_LDFLAGS="-L/usr/local/lib"
|
||||
fi
|
||||
TEST_LDFLAGS="$TEST_LDFLAGS arg_default_libs"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo " arg_cxxflags = $TEST_CXXFLAGS"
|
||||
echo " arg_ldflags = $TEST_LDFLAGS"
|
||||
|
||||
|
||||
AC_SUBST(arg_cxxflags, $TEST_CXXFLAGS)
|
||||
AC_SUBST(arg_ldflags, $TEST_LDFLAGS)
|
||||
|
||||
|
||||
dnl clean up local "variables"
|
||||
undefine([arg_cxxflags])
|
||||
undefine([arg_ldflags])
|
||||
undefine([arg_pkg_name])
|
||||
undefine([arg_include_subdir])
|
||||
undefine([arg_default_libs])
|
||||
undefine([arg_test_prefix])
|
||||
|
||||
])
|
||||
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
DreamWorks permits the DreamWorks Lossy Compression files to be used, at the
|
||||
licensee's option, under either:
|
||||
|
||||
(1) the BSD-3-Clause license in /LICENSE.md, together with the Additional IP
|
||||
Rights Grant (Patents) specified below; or
|
||||
|
||||
(2) the Apache-2.0 license, a copy of which appears below.
|
||||
|
||||
The files to which this choice applies are:
|
||||
|
||||
* /src/lib/OpenEXR/ImfDwaCompressor.h
|
||||
* /src/lib/OpenEXR/ImfDwaCompressor.cpp
|
||||
* /src/lib/OpenEXR/ImfDwaCompressorSimd.h
|
||||
* /src/test/OpenEXRTest/compareDwa.h
|
||||
* /src/test/OpenEXRTest/compareDwa.cpp
|
||||
* /src/test/OpenEXRTest/testDwaCompressorSimd.h
|
||||
* /src/test/OpenEXRTest/testDwaCompressorSimd.cpp
|
||||
|
||||
= = = = =
|
||||
|
||||
Additional IP Rights Grant (Patents) "DreamWorks Lossy Compression" means the
|
||||
copyrightable works distributed by DreamWorks Animation as part of the OpenEXR
|
||||
Project. Within the OpenEXR project, DreamWorks Animation hereby grants to you
|
||||
a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made, use,
|
||||
import, sell products which incorporate this IP as part of the OpenEXR
|
||||
standard, transfer, and otherwise run, modify and propagate the contents of
|
||||
this implementation of DreamWorks Lossy Compression within the OpenEXR standard,
|
||||
where such license applies only to those patent claims, both currently owned by
|
||||
DreamWorks Animation and acquired in the future, licensable by DreamWorks
|
||||
Animation that are necessarily infringed by this implementation of DreamWorks
|
||||
Lossy Compression. This grant does not include use of DreamWorks Lossy
|
||||
Compression outside of the OpenEXR standard. This grant does not include claims
|
||||
that would be infringed only as a consequence of further modification of this
|
||||
implementation. If you or your agent or exclusive licensee institute or order
|
||||
or agree to the institution of patent litigation against any entity (including
|
||||
a cross-claim or counterclaim in a lawsuit) alleging that this implementation
|
||||
of DreamWorks Lossy Compression or any code incorporated within this
|
||||
implementation of DreamWorks Lossy Compression constitutes direct or
|
||||
contributory patent infringement, or inducement of patent infringement, then
|
||||
any patent rights granted to you under this License for this implementation
|
||||
of DreamWorks Lossy Compression shall terminate as of the date such litigation
|
||||
is filed.
|
||||
|
||||
= = = = =
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2014 DreamWorks Animation L.L.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
@@ -1,156 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
[](LICENSE.md)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/2799)
|
||||
[](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3ACI)
|
||||
[](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3AAnalysis)
|
||||
[](https://sonarcloud.io/dashboard?id=AcademySoftwareFoundation_openexr)
|
||||
|
||||
# OpenEXR
|
||||
|
||||
<img align="right" src="docs/technical/images/windowExample1.png">
|
||||
|
||||
OpenEXR provides the specification and reference implementation of the
|
||||
EXR file format, the professional-grade image storage format of the
|
||||
motion picture industry.
|
||||
|
||||
The purpose of EXR format is to accurately and efficiently represent
|
||||
high-dynamic-range scene-linear image data and associated metadata,
|
||||
with strong support for multi-part, multi-channel use cases.
|
||||
|
||||
OpenEXR is widely used in host application software where accuracy is
|
||||
critical, such as photorealistic rendering, texture access, image
|
||||
compositing, deep compositing, and DI.
|
||||
|
||||
## OpenEXR Project Mission
|
||||
|
||||
The goal of the OpenEXR project is to keep the EXR format reliable and
|
||||
modern and to maintain its place as the preferred image format for
|
||||
entertainment content creation.
|
||||
|
||||
Major revisions are infrequent, and new features will be carefully
|
||||
weighed against increased complexity. The principal priorities of the
|
||||
project are:
|
||||
|
||||
* Robustness, reliability, security
|
||||
* Backwards compatibility, data longevity
|
||||
* Performance - read/write/compression/decompression time
|
||||
* Simplicity, ease of use, maintainability
|
||||
* Wide adoption, multi-platform support - Linux, Windows, macOS, and others
|
||||
|
||||
OpenEXR is intended solely for 2D data. It is not appropriate for
|
||||
storage of volumetric data, cached or lit 3D scenes, or more complex
|
||||
3D data such as light fields.
|
||||
|
||||
The goals of the Imath project are simplicity, ease of use,
|
||||
correctness and verifiability, and breadth of adoption. Imath is not
|
||||
intended to be a comprehensive linear algebra or numerical analysis
|
||||
package.
|
||||
|
||||
## Project Governance
|
||||
|
||||
OpenEXR is a project of the [Academy Software
|
||||
Foundation](https://www.aswf.io). See the project's [governance
|
||||
policies](GOVERNANCE.md), [contribution guidelines](CONTRIBUTING.md), and [code of conduct](CODE_OF_CONDUCT)
|
||||
for more information.
|
||||
|
||||
# Quick Start
|
||||
|
||||
See the [technical documentation](https://openexr.readthedocs.io) for
|
||||
complete details, but to get started, the "hello, world" `.exr` writer program is:
|
||||
|
||||
#include <ImfRgbaFile.h>
|
||||
#include <ImfArray.h>
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try {
|
||||
int width = 10;
|
||||
int height = 10;
|
||||
|
||||
Imf::Array2D<Imf::Rgba> pixels(width, height);
|
||||
for (int y=0; y<height; y++)
|
||||
for (int x=0; x<width; x++)
|
||||
pixels[y][x] = Imf::Rgba(0, x / (width-1.0f), y / (height-1.0f));
|
||||
|
||||
Imf::RgbaOutputFile file ("hello.exr", width, height, Imf::WRITE_RGBA);
|
||||
file.setFrameBuffer (&pixels[0][0], 1, width);
|
||||
file.writePixels (height);
|
||||
} catch (const std::exception &e) {
|
||||
std::cerr << "Unable to read image file hello.exr:" << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
The `CMakeLists.txt` to build:
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(exrwriter)
|
||||
find_package(OpenEXR REQUIRED)
|
||||
|
||||
add_executable(${PROJECT_NAME} writer.cpp)
|
||||
target_link_libraries(${PROJECT_NAME} OpenEXR::OpenEXR)
|
||||
|
||||
To build:
|
||||
|
||||
$ mkdir _build
|
||||
$ cmake -S . -B _build
|
||||
$ make --build _build
|
||||
|
||||
For more details, see [The OpenEXR
|
||||
API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
|
||||
|
||||
# Community
|
||||
|
||||
* **Ask a question:**
|
||||
|
||||
- Email: openexr-dev@lists.aswf.io
|
||||
|
||||
- Slack: [academysoftwarefdn#openexr](https://academysoftwarefdn.slack.com/archives/CMLRW4N73)
|
||||
|
||||
* **Attend a meeting:**
|
||||
|
||||
- Technical Steering Committee meetings are open to the
|
||||
public, fortnightly on Thursdays, 1:30pm Pacific Time.
|
||||
|
||||
- Calendar: https://lists.aswf.io/g/openexr-dev/calendar
|
||||
|
||||
* **Report a bug:**
|
||||
|
||||
- Submit an Issue: https://github.com/AcademySoftwareFoundation/openexr/issues
|
||||
|
||||
* **Report a security vulnerability:**
|
||||
|
||||
- Email to security@openexr.com
|
||||
|
||||
* **Contribute a Fix, Feature, or Improvement:**
|
||||
|
||||
- Read the [Contribution Guidelines](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md)
|
||||
|
||||
- Sign the [Contributor License
|
||||
Agreement](https://contributor.easycla.lfx.linuxfoundation.org/#/cla/project/2e8710cb-e379-4116-a9ba-964f83618cc5/user/564e571e-12d7-4857-abd4-898939accdd7)
|
||||
|
||||
- Submit a Pull Request: https://github.com/AcademySoftwareFoundation/openexr/pulls
|
||||
|
||||
# Resources
|
||||
|
||||
- Website: http://www.openexr.com
|
||||
- Technical documentation: https://openexr.readthedocs.io
|
||||
- Porting help: [OpenEXR/Imath Version 2.x to 3.x Porting Guide](https://openexr.readthedocs.io/en/latest/PortingGuide.html)
|
||||
- Reference images: https://github.com/AcademySoftwareFoundation/openexr-images
|
||||
- Security policy: [SECURITY.md](SECURITY.md)
|
||||
- Release notes: [CHANGES.md](CHANGES.md)
|
||||
- Contributors: [CONTRIBUTORS.md](CONTRIBUTORS.md)
|
||||
|
||||
# License
|
||||
|
||||
OpenEXR is licensed under the [BSD-3-Clause license](LICENSE.md).
|
||||
|
||||
|
||||
---
|
||||
|
||||

|
||||
-59
@@ -1,59 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you think you've found a potential vulnerability in OpenEXR, please
|
||||
report it by emailing security@openexr.com. Only Technical Steering
|
||||
Committee members and Academy Software Foundation project management
|
||||
have access to these messages. Include detailed steps to reproduce the
|
||||
issue, and any other information that could aid an investigation. Our
|
||||
policy is to respond to vulnerability reports within 14 days.
|
||||
|
||||
Our policy is to address critical security vulnerabilities rapidly and
|
||||
post patches as quickly as possible.
|
||||
|
||||
## Known Vulnerabilities
|
||||
|
||||
These vulnerabilities are present in the given versions:
|
||||
|
||||
* [CVE-2021-45942](https://nvd.nist.gov/vuln/detail/CVE-2021-45942) 3.1.0, 3.1.1, 3.1.2, 3.1.3
|
||||
* [CVE-2021-20296](https://nvd.nist.gov/vuln/detail/CVE-2021-20296) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3479](https://nvd.nist.gov/vuln/detail/CVE-2021-3479) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3478](https://nvd.nist.gov/vuln/detail/CVE-2021-3478) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3477](https://nvd.nist.gov/vuln/detail/CVE-2021-3477) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3476](https://nvd.nist.gov/vuln/detail/CVE-2021-3476) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3475](https://nvd.nist.gov/vuln/detail/CVE-2021-3475) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3474](https://nvd.nist.gov/vuln/detail/CVE-2021-3474) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2020-16589](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16589) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2020-16588](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16588) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2020-16587](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16587) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2020-15306](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15306) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1
|
||||
* [CVE-2020-15305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15305) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1
|
||||
* [CVE-2020-15304](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15304) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1
|
||||
* [CVE-2020-11765](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11765) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11764](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11764) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11763](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11763) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11762](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11762) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11761](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11761) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11760](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11760) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11759](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11759) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11758](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11758) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2018-18444](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-18444) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2018-18443](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-18443) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2017-9116](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9116) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9115](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9115) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9114](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9114) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9113](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9113) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9112](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9112) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9111](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9111) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9110](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9110) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-12596](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12596) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2009-1722](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1722) 1.0.*, 1.1.*, 1.2.*, 1.3.*, 1.4.*, 1.5.*, 1.6.*
|
||||
* [CVE-2009-1721](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1721) 1.0.*, 1.1.*, 1.2.*, 1.3.*, 1.4.*, 1.5.*, 1.6.*
|
||||
* [CVE-2009-1720](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1720) 1.0.*, 1.1.*, 1.2.*, 1.3.*, 1.4.*, 1.5.*, 1.6.*
|
||||
|
||||
See the [release notes](CHANGES.md) for more information.
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
workspace(name = "com_openexr")
|
||||
|
||||
load("//:bazel/third_party/openexr_deps.bzl", "openexr_deps")
|
||||
|
||||
openexr_deps()
|
||||
|
||||
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
||||
|
||||
bazel_skylib_workspace()
|
||||
Vendored
-76
@@ -1,76 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
|
||||
|
||||
expand_template(
|
||||
name = "ImathConfig",
|
||||
out = "src/Imath/ImathConfig.h",
|
||||
substitutions = {
|
||||
"@IMATH_INTERNAL_NAMESPACE@": "Imath_3_1",
|
||||
"@IMATH_LIB_VERSION@": "3.1.9",
|
||||
"@IMATH_NAMESPACE_CUSTOM@": "0",
|
||||
"@IMATH_NAMESPACE@": "Imath",
|
||||
"@IMATH_PACKAGE_NAME@": "Imath 3.1.9",
|
||||
"@Imath_VERSION_MAJOR@": "3",
|
||||
"@Imath_VERSION_MINOR@": "1",
|
||||
"@Imath_VERSION_PATCH@": "9",
|
||||
"@IMATH_VERSION@": "3.1.9",
|
||||
"#cmakedefine IMATH_HALF_USE_LOOKUP_TABLE": "#define IMATH_HALF_USE_LOOKUP_TABLE",
|
||||
"#cmakedefine IMATH_ENABLE_API_VISIBILITY": "#define IMATH_ENABLE_API_VISIBILITY",
|
||||
"#cmakedefine IMATH_HAVE_LARGE_STACK": "/* #undef IMATH_HAVE_LARGE_STACK */",
|
||||
"#cmakedefine01 IMATH_USE_NOEXCEPT": "#define IMATH_USE_NOEXCEPT 1",
|
||||
},
|
||||
template = "config/ImathConfig.h.in",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "Imath",
|
||||
srcs = [
|
||||
"src/Imath/ImathColorAlgo.cpp",
|
||||
"src/Imath/ImathFun.cpp",
|
||||
"src/Imath/ImathMatrixAlgo.cpp",
|
||||
"src/Imath/ImathRandom.cpp",
|
||||
"src/Imath/half.cpp",
|
||||
"src/Imath/toFloat.h",
|
||||
],
|
||||
hdrs = [
|
||||
"src/Imath/ImathBox.h",
|
||||
"src/Imath/ImathBoxAlgo.h",
|
||||
"src/Imath/ImathColor.h",
|
||||
"src/Imath/ImathColorAlgo.h",
|
||||
"src/Imath/ImathConfig.h",
|
||||
"src/Imath/ImathEuler.h",
|
||||
"src/Imath/ImathExport.h",
|
||||
"src/Imath/ImathForward.h",
|
||||
"src/Imath/ImathFrame.h",
|
||||
"src/Imath/ImathFrustum.h",
|
||||
"src/Imath/ImathFrustumTest.h",
|
||||
"src/Imath/ImathFun.h",
|
||||
"src/Imath/ImathGL.h",
|
||||
"src/Imath/ImathGLU.h",
|
||||
"src/Imath/ImathInt64.h",
|
||||
"src/Imath/ImathInterval.h",
|
||||
"src/Imath/ImathLine.h",
|
||||
"src/Imath/ImathLineAlgo.h",
|
||||
"src/Imath/ImathMath.h",
|
||||
"src/Imath/ImathMatrix.h",
|
||||
"src/Imath/ImathMatrixAlgo.h",
|
||||
"src/Imath/ImathNamespace.h",
|
||||
"src/Imath/ImathPlane.h",
|
||||
"src/Imath/ImathPlatform.h",
|
||||
"src/Imath/ImathQuat.h",
|
||||
"src/Imath/ImathRandom.h",
|
||||
"src/Imath/ImathRoots.h",
|
||||
"src/Imath/ImathShear.h",
|
||||
"src/Imath/ImathSphere.h",
|
||||
"src/Imath/ImathTypeTraits.h",
|
||||
"src/Imath/ImathVec.h",
|
||||
"src/Imath/ImathVecAlgo.h",
|
||||
"src/Imath/half.h",
|
||||
"src/Imath/halfFunction.h",
|
||||
"src/Imath/halfLimits.h",
|
||||
],
|
||||
includes = ["src/Imath"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Vendored
-55
@@ -1,55 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
cc_library(
|
||||
name = "deflate",
|
||||
srcs = [
|
||||
"common_defs.h",
|
||||
"lib/adler32.c",
|
||||
"lib/adler32_vec_template.h",
|
||||
"lib/arm/adler32_impl.h",
|
||||
"lib/arm/cpu_features.c",
|
||||
"lib/arm/cpu_features.h",
|
||||
"lib/arm/crc32_impl.h",
|
||||
"lib/arm/crc32_pmull_helpers.h",
|
||||
"lib/arm/crc32_pmull_wide.h",
|
||||
"lib/arm/matchfinder_impl.h",
|
||||
"lib/bt_matchfinder.h",
|
||||
"lib/cpu_features_common.h",
|
||||
"lib/crc32.c",
|
||||
"lib/crc32_multipliers.h",
|
||||
"lib/crc32_tables.h",
|
||||
"lib/decompress_template.h",
|
||||
"lib/deflate_compress.c",
|
||||
"lib/deflate_compress.h",
|
||||
"lib/deflate_constants.h",
|
||||
"lib/deflate_decompress.c",
|
||||
"lib/gzip_compress.c",
|
||||
"lib/gzip_constants.h",
|
||||
"lib/gzip_decompress.c",
|
||||
"lib/hc_matchfinder.h",
|
||||
"lib/ht_matchfinder.h",
|
||||
"lib/lib_common.h",
|
||||
"lib/matchfinder_common.h",
|
||||
"lib/utils.c",
|
||||
"lib/x86/adler32_impl.h",
|
||||
"lib/x86/cpu_features.c",
|
||||
"lib/x86/cpu_features.h",
|
||||
"lib/x86/crc32_impl.h",
|
||||
"lib/x86/crc32_pclmul_template.h",
|
||||
"lib/x86/decompress_impl.h",
|
||||
"lib/x86/matchfinder_impl.h",
|
||||
"lib/zlib_compress.c",
|
||||
"lib/zlib_constants.h",
|
||||
"lib/zlib_decompress.c",
|
||||
],
|
||||
hdrs = ["libdeflate.h"],
|
||||
includes = ["."],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "libdeflate",
|
||||
actual = ":deflate",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Vendored
-38
@@ -1,38 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
"""External dependencies for openexr."""
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
|
||||
|
||||
def openexr_deps():
|
||||
"""Fetches dependencies (libdeflate and Imath) of OpenEXR and Skylib for header generation."""
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "libdeflate",
|
||||
build_file = "@com_openexr//:bazel/third_party/libdeflate.BUILD",
|
||||
sha256 = "225d982bcaf553221c76726358d2ea139bb34913180b20823c782cede060affd",
|
||||
strip_prefix = "libdeflate-1.18",
|
||||
urls = ["https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.18.tar.gz"],
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "Imath",
|
||||
build_file = "@com_openexr//:bazel/third_party/Imath.BUILD",
|
||||
strip_prefix = "Imath-3.1.9",
|
||||
sha256 = "f1d8aacd46afed958babfced3190d2d3c8209b66da451f556abd6da94c165cf3",
|
||||
urls = ["https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.9.tar.gz"],
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "bazel_skylib",
|
||||
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
|
||||
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
|
||||
],
|
||||
)
|
||||
@@ -1,259 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckStructHasMember)
|
||||
include(CheckCXXSourceCompiles)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/JoinPaths.cmake")
|
||||
|
||||
#################### Config headers and interface libs ######################
|
||||
|
||||
###################################################
|
||||
####### OpenEXRConfig.h and OpenEXRConfigInternal.h
|
||||
|
||||
if (NOT CMAKE_CROSSCOMPILING AND EXISTS "/proc/self/exe")
|
||||
set(OPENEXR_IMF_HAVE_LINUX_PROCFS TRUE)
|
||||
endif()
|
||||
|
||||
check_cxx_source_compiles(
|
||||
"
|
||||
#include <unistd.h>
|
||||
int main()
|
||||
{
|
||||
sysconf(_SC_NPROCESSORS_ONLN);
|
||||
}
|
||||
" OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN
|
||||
)
|
||||
|
||||
check_cxx_source_compiles(
|
||||
"
|
||||
int main()
|
||||
{
|
||||
#if defined(__SSE2__)
|
||||
int n = 0;
|
||||
int eax = 0;
|
||||
int edx = 0;
|
||||
__asm__(
|
||||
\"xgetbv ;\"
|
||||
\"vzeroupper \"
|
||||
: \"=a\"(eax), \"=d\"(edx) : \"c\"(n) : );
|
||||
#else
|
||||
# error No SSE support enabled to query AVX support
|
||||
#endif
|
||||
}
|
||||
" OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
|
||||
)
|
||||
|
||||
|
||||
# This is no longer something that needs to be tested if we have
|
||||
# C++14 support...
|
||||
set(OPENEXR_IMF_HAVE_COMPLETE_IOMANIP TRUE)
|
||||
|
||||
if(APPLE)
|
||||
set(OPENEXR_IMF_HAVE_DARWIN TRUE)
|
||||
endif()
|
||||
|
||||
if (OPENEXR_ENABLE_LARGE_STACK)
|
||||
set(OPENEXR_HAVE_LARGE_STACK ON)
|
||||
endif()
|
||||
if (OPENEXR_USE_DEFAULT_VISIBILITY)
|
||||
set(OPENEXR_ENABLE_API_VISIBILITY OFF)
|
||||
else()
|
||||
set(OPENEXR_ENABLE_API_VISIBILITY ON)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(OPENEXR_EXTRA_MATH_LIB m)
|
||||
mark_as_advanced(OPENEXR_EXTRA_MATH_LIB)
|
||||
endif()
|
||||
|
||||
configure_file(OpenEXRConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h)
|
||||
configure_file(OpenEXRConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfigInternal.h)
|
||||
# make a temp copy in the binary dir for OpenEXRConfig.h to include
|
||||
configure_file(../src/lib/OpenEXRCore/openexr_version.h ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRCore/openexr_version.h COPYONLY)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
###################################################
|
||||
####### IexConfig.h and IexConfigInternal.h
|
||||
|
||||
check_include_files(ucontext.h IEX_HAVE_UCONTEXT_H)
|
||||
if(IEX_HAVE_UCONTEXT_H)
|
||||
# TODO: remove this once we cleanly have IEX_ prefix on all #defines
|
||||
set(HAVE_UCONTEXT_H ON)
|
||||
check_struct_has_member("struct _libc_fpstate" mxcsr ucontext.h IEX_HAVE_CONTROL_REGISTER_SUPPORT)
|
||||
if(NOT IEX_HAVE_CONTROL_REGISTER_SUPPORT)
|
||||
check_include_files(asm/sigcontext.h IEX_HAVE_SIGCONTEXT_H)
|
||||
if(IEX_HAVE_SIGCONTEXT_H)
|
||||
check_struct_has_member("struct _fpstate" mxcsr asm/sigcontext.h IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###check_include_files(pthread.h ILMTHREAD_HAVE_PTHREAD)
|
||||
if(OPENEXR_ENABLE_THREADING AND Threads_FOUND)
|
||||
set(ILMTHREAD_THREADING_ENABLED ON)
|
||||
|
||||
# we have threads, but do we have posix semaphores for sem_init?
|
||||
# should be in pthreads
|
||||
if(NOT (APPLE OR (WIN32 AND (NOT MINGW))))
|
||||
if(MINGW)
|
||||
check_include_files("pthread_unistd.h;semaphore.h" ILMTHREAD_HAVE_SEMAPHORE_H)
|
||||
else()
|
||||
check_include_files(semaphore.h ILMTHREAD_HAVE_SEMAPHORE_H)
|
||||
endif()
|
||||
if(ILMTHREAD_HAVE_SEMAPHORE_H)
|
||||
# should just be in libc, so no need for check_library_exists
|
||||
if(CMAKE_HAVE_LIBC_PTHREAD)
|
||||
set(ILMTHREAD_HAVE_POSIX_SEMAPHORES ON)
|
||||
else()
|
||||
set(CMAKE_REQUIRED_FLAGS ${CMAKE_THREAD_LIBS_INIT})
|
||||
check_library_exists(pthread sem_init "" ILMTHREAD_HAVE_POSIX_SEMAPHORES)
|
||||
set(CMAKE_REQUIRED_FLAGS)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
configure_file(IexConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfig.h)
|
||||
configure_file(IexConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfigInternal.h)
|
||||
configure_file(IlmThreadConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmThreadConfig.h)
|
||||
|
||||
###################################################
|
||||
####### Install public config headers
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/IexConfig.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/IlmThreadConfig.h
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
###################################################
|
||||
####### Interface libraries for configs
|
||||
|
||||
add_library(OpenEXRConfig INTERFACE)
|
||||
target_include_directories(OpenEXRConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS OpenEXRConfig EXPORT ${PROJECT_NAME})
|
||||
endif()
|
||||
add_library(${PROJECT_NAME}::Config ALIAS OpenEXRConfig)
|
||||
|
||||
add_library(IexConfig INTERFACE)
|
||||
target_include_directories(IexConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS IexConfig EXPORT ${PROJECT_NAME})
|
||||
endif()
|
||||
add_library(${PROJECT_NAME}::Config ALIAS IexConfig)
|
||||
|
||||
add_library(IlmThreadConfig INTERFACE)
|
||||
target_include_directories(IlmThreadConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS IlmThreadConfig EXPORT ${PROJECT_NAME})
|
||||
endif()
|
||||
add_library(${PROJECT_NAME}::Config ALIAS IlmThreadConfig)
|
||||
|
||||
###################################################
|
||||
####### Install pkg-config files if requested
|
||||
|
||||
if(OPENEXR_INSTALL_PKG_CONFIG)
|
||||
|
||||
# Prepend prefix for includedir only if CMAKE_INSTALL_INCLUDEDIR is relative
|
||||
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(PKG_CONFIG_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
else()
|
||||
set(PKG_CONFIG_INSTALL_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
# Prepend exec_prefix for libdir only if CMAKE_INSTALL_LIBDIR is relative
|
||||
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
|
||||
set(PKG_CONFIG_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
|
||||
else()
|
||||
set(PKG_CONFIG_INSTALL_LIBDIR "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
# use a helper function to avoid variable pollution, but pretty simple
|
||||
function(openexr_pkg_config_help pcinfile)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
|
||||
set(LIB_SUFFIX_DASH ${OPENEXR_LIB_SUFFIX}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX})
|
||||
if(OPENEXR_ENABLE_THREADING AND TARGET Threads::Threads)
|
||||
# hrm, can't use properties as they end up as generator expressions
|
||||
# which don't seem to evaluate
|
||||
if(THREADS_HAVE_PTHREAD_ARG OR CMAKE_HAVE_LIBC_PTHREAD)
|
||||
set(exr_pthread_cflags "-pthread")
|
||||
else()
|
||||
set(exr_pthread_cflags "")
|
||||
endif()
|
||||
set(exr_pthread_libs ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
string(REPLACE ".in" "" pcout ${pcinfile})
|
||||
configure_file(${pcinfile} ${CMAKE_CURRENT_BINARY_DIR}/${pcout} @ONLY)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${pcout}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||
)
|
||||
endfunction()
|
||||
openexr_pkg_config_help(OpenEXR.pc.in)
|
||||
else()
|
||||
message(STATUS "-- pkg-config generation disabled")
|
||||
endif()
|
||||
|
||||
###################################################
|
||||
####### Install cmake Config files
|
||||
|
||||
# The main export of the configuration - This is the
|
||||
# moral equivalent of a pkg-config file for cmake
|
||||
# and replaces the Find*.cmake of the "old" cmake
|
||||
|
||||
# The main export of the configuration - This is the
|
||||
# moral equivalent of a pkg-config file for cmake
|
||||
# and replaces the Find*.cmake of the "old" cmake
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
configure_package_config_file(${PROJECT_NAME}Config.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
)
|
||||
write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
install(EXPORT ${PROJECT_NAME}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
||||
FILE ${PROJECT_NAME}Targets.cmake
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
EXPORT_LINK_INTERFACE_LIBRARIES
|
||||
)
|
||||
endif()
|
||||
@@ -1,79 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate a Python package
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# <package>_FOUND
|
||||
#
|
||||
# Usage:
|
||||
# find_python_package(Jinja2 2.10.1)
|
||||
#
|
||||
# If the package is not installed in a standard path, add it to the PYTHONPATH
|
||||
# environment variable before running CMake.
|
||||
#
|
||||
|
||||
find_package(Python QUIET COMPONENTS Interpreter)
|
||||
|
||||
macro(find_python_package package)
|
||||
# Some Python packages have "-" in the PyPi name, but are replaced with "_"
|
||||
# in the actual package name.
|
||||
string(REPLACE "-" "_" _PKG_IMPORT ${package})
|
||||
|
||||
# Parse options
|
||||
foreach(_ARG ${ARGN})
|
||||
if(_ARG STREQUAL "REQUIRED")
|
||||
set(_PKG_REQUIRED TRUE)
|
||||
endif()
|
||||
if(_PREV_ARG STREQUAL "REQUIRES")
|
||||
set(_PKG_REQUIRES ${_ARG})
|
||||
endif()
|
||||
set(_PREV_ARG ${_ARG})
|
||||
endforeach()
|
||||
|
||||
if(NOT TARGET ${package})
|
||||
add_custom_target(${package})
|
||||
if(_PKG_REQUIRES)
|
||||
add_dependencies(${package} ${_PKG_REQUIRES})
|
||||
unset(_PKG_REQUIRES)
|
||||
endif()
|
||||
set(_${package}_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
set(_PKG_INSTALL TRUE)
|
||||
|
||||
# Try importing Python package
|
||||
execute_process(
|
||||
COMMAND
|
||||
"${Python_EXECUTABLE}" -c "import ${_PKG_IMPORT}"
|
||||
RESULT_VARIABLE
|
||||
_PKG_IMPORT_RESULT
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
)
|
||||
|
||||
if(_PKG_IMPORT_RESULT EQUAL 0)
|
||||
set(${package}_FOUND TRUE)
|
||||
|
||||
# Get the package's location
|
||||
execute_process(
|
||||
COMMAND
|
||||
"${Python_EXECUTABLE}" -c
|
||||
"import ${_PKG_IMPORT}, os; print(os.path.dirname(${_PKG_IMPORT}.__file__))"
|
||||
OUTPUT_VARIABLE
|
||||
_PKG_DIR
|
||||
ERROR_QUIET
|
||||
)
|
||||
string(STRIP "${_PKG_DIR}" _PKG_DIR)
|
||||
message(STATUS "Found ${package}: ${_PKG_DIR}")
|
||||
|
||||
else()
|
||||
set(${package}_FOUND FALSE)
|
||||
set(_FIND_ERR "Could NOT find ${package} (import ${_PKG_IMPORT} failed)")
|
||||
|
||||
if(_PKG_REQUIRED)
|
||||
message(FATAL_ERROR "${_FIND_ERR}")
|
||||
endif()
|
||||
message(STATUS "${_FIND_ERR}")
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
@@ -1,15 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
#Look for an executable called sphinx-build
|
||||
find_program(SPHINX_EXECUTABLE
|
||||
NAMES sphinx-build
|
||||
DOC "Path to sphinx-build executable")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
#Handle standard arguments to find_package like REQUIRED and QUIET
|
||||
find_package_handle_standard_args(Sphinx
|
||||
"Failed to find sphinx-build executable"
|
||||
SPHINX_EXECUTABLE)
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
// This file is auto-generated by the cmake configure step
|
||||
|
||||
#ifndef INCLUDED_IEX_CONFIG_H
|
||||
#define INCLUDED_IEX_CONFIG_H 1
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
//
|
||||
// C++ namespace configuration / options
|
||||
|
||||
// automated formatting does not handle the cmake tags well
|
||||
// clang-format off
|
||||
|
||||
//
|
||||
// Current internal library namespace name
|
||||
//
|
||||
#define IEX_INTERNAL_NAMESPACE_CUSTOM @IEX_NAMESPACE_CUSTOM@
|
||||
#define IEX_INTERNAL_NAMESPACE @IEX_INTERNAL_NAMESPACE@
|
||||
|
||||
//
|
||||
// Current public user namespace name
|
||||
//
|
||||
|
||||
#define IEX_NAMESPACE_CUSTOM @IEX_NAMESPACE_CUSTOM@
|
||||
#define IEX_NAMESPACE @IEX_NAMESPACE@
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // INCLUDED_IEX_CONFIG_H
|
||||
@@ -1,17 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// Dealing with FPEs
|
||||
//
|
||||
|
||||
// automated formatting does not handle the cmake tags well
|
||||
// clang-format off
|
||||
|
||||
#cmakedefine HAVE_UCONTEXT_H 1
|
||||
#cmakedefine IEX_HAVE_CONTROL_REGISTER_SUPPORT 1
|
||||
#cmakedefine IEX_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT 1
|
||||
|
||||
// clang-format on
|
||||
@@ -1,48 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
// This file is auto-generated by the cmake configure step
|
||||
|
||||
#ifndef INCLUDED_ILMTHREAD_CONFIG_H
|
||||
#define INCLUDED_ILMTHREAD_CONFIG_H 1
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
//
|
||||
// C++ namespace configuration / options
|
||||
|
||||
// automated formatting does not handle the cmake tags well
|
||||
// clang-format off
|
||||
|
||||
#cmakedefine01 ILMTHREAD_THREADING_ENABLED
|
||||
#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES
|
||||
|
||||
//
|
||||
// Current internal library namespace name
|
||||
//
|
||||
#define ILMTHREAD_INTERNAL_NAMESPACE_CUSTOM @ILMTHREAD_NAMESPACE_CUSTOM@
|
||||
#define ILMTHREAD_INTERNAL_NAMESPACE @ILMTHREAD_INTERNAL_NAMESPACE@
|
||||
|
||||
//
|
||||
// Current public user namespace name
|
||||
//
|
||||
|
||||
#define ILMTHREAD_NAMESPACE_CUSTOM @ILMTHREAD_NAMESPACE_CUSTOM@
|
||||
#define ILMTHREAD_NAMESPACE @ILMTHREAD_NAMESPACE@
|
||||
|
||||
// clang-format on
|
||||
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201402L)
|
||||
# define ILMTHREAD_DEPRECATED(msg) [[deprecated (msg)]]
|
||||
#endif
|
||||
|
||||
#ifndef ILMTHREAD_DEPRECATED
|
||||
# ifdef _MSC_VER
|
||||
# define ILMTHREAD_DEPRECATED(msg) __declspec(deprecated (msg))
|
||||
# else
|
||||
# define ILMTHREAD_DEPRECATED(msg) __attribute__ ((deprecated (msg)))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif // INCLUDED_ILMTHREAD_CONFIG_H
|
||||
@@ -1,23 +0,0 @@
|
||||
# This module provides function for joining paths
|
||||
# known from from most languages
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
# https://github.com/jtojnar/cmake-snips
|
||||
#
|
||||
# Modelled after Python’s os.path.join
|
||||
# https://docs.python.org/3.7/library/os.path.html#os.path.join
|
||||
# Windows not supported
|
||||
function(join_paths joined_path first_path_segment)
|
||||
set(temp_path "${first_path_segment}")
|
||||
foreach(current_segment IN LISTS ARGN)
|
||||
if(NOT ("${current_segment}" STREQUAL ""))
|
||||
if(IS_ABSOLUTE "${current_segment}")
|
||||
set(temp_path "${current_segment}")
|
||||
else()
|
||||
set(temp_path "${temp_path}/${current_segment}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
set(${joined_path} "${temp_path}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -1,101 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# NB: This function has a number of Imath-specific names/variables
|
||||
# in it, so be careful copying...
|
||||
function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
set(options)
|
||||
set(oneValueArgs PRIV_EXPORT CURDIR CURBINDIR)
|
||||
set(multiValueArgs SOURCES HEADERS DEPENDENCIES PRIVATE_DEPS)
|
||||
cmake_parse_arguments(OPENEXR_CURLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (MSVC)
|
||||
set(_openexr_extra_flags "/EHsc")
|
||||
endif()
|
||||
set(objlib ${libname})
|
||||
add_library(${objlib}
|
||||
${OPENEXR_CURLIB_HEADERS}
|
||||
${OPENEXR_CURLIB_SOURCES})
|
||||
|
||||
# Use ${OPENEXR_CXX_STANDARD} to determine the standard we use to compile
|
||||
# OpenEXR itself. But the headers only require C++11 features, so that's
|
||||
# all we need to pass on as interface requirements to downstream projects.
|
||||
# For example, it's fine for an OpenEXR built with C++14 to be called from
|
||||
# an app that is compiled with C++11; OpenEXR needn't force the app to
|
||||
# also use C++14.
|
||||
target_compile_features(${objlib}
|
||||
PRIVATE cxx_std_${OPENEXR_CXX_STANDARD}
|
||||
INTERFACE cxx_std_11 )
|
||||
|
||||
# we are embedding libdeflate
|
||||
target_include_directories(${objlib} PRIVATE ${EXR_DEFLATE_INCLUDE_DIR})
|
||||
|
||||
if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIV_EXPORT})
|
||||
if(WIN32)
|
||||
target_compile_definitions(${objlib} PUBLIC OPENEXR_DLL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(OPENEXR_CURLIB_CURDIR)
|
||||
target_include_directories(${objlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURDIR}>)
|
||||
endif()
|
||||
if(OPENEXR_CURLIB_CURBINDIR)
|
||||
target_include_directories(${objlib} PRIVATE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURBINDIR}>)
|
||||
endif()
|
||||
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES})
|
||||
if(OPENEXR_CURLIB_PRIVATE_DEPS)
|
||||
target_link_libraries(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIVATE_DEPS})
|
||||
endif()
|
||||
set_target_properties(${objlib} PROPERTIES
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
if (NOT OPENEXR_USE_DEFAULT_VISIBILITY)
|
||||
set_target_properties(${objlib} PROPERTIES
|
||||
C_VISIBILITY_PRESET hidden
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
VISIBILITY_INLINES_HIDDEN ON
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(${objlib} PUBLIC OPENEXR_USE_DEFAULT_VISIBILITY)
|
||||
endif()
|
||||
if (_openexr_extra_flags)
|
||||
target_compile_options(${objlib} PUBLIC ${_openexr_extra_flags})
|
||||
endif()
|
||||
set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS})
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set_target_properties(${libname} PROPERTIES
|
||||
SOVERSION ${OPENEXR_LIB_SOVERSION}
|
||||
VERSION ${OPENEXR_LIB_VERSION}
|
||||
)
|
||||
endif()
|
||||
set_target_properties(${libname} PROPERTIES
|
||||
OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS ${libname}
|
||||
EXPORT ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
PUBLIC_HEADER
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
|
||||
)
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "") AND NOT WIN32)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
|
||||
set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${OPENEXR_LIB_SUFFIX}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})")
|
||||
install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_LIBDIR}/${baselibname} -> ${verlibname}\")")
|
||||
set(verlibname)
|
||||
set(baselibname)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,20 +0,0 @@
|
||||
##
|
||||
## SPDX-License-Identifier: BSD-3-Clause
|
||||
## Copyright (c) Contributors to the OpenEXR Project.
|
||||
##
|
||||
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=@PKG_CONFIG_INSTALL_LIBDIR@
|
||||
includedir=@PKG_CONFIG_INSTALL_INCLUDEDIR@
|
||||
OpenEXR_includedir=${includedir}/OpenEXR
|
||||
libsuffix=@LIB_SUFFIX_DASH@
|
||||
|
||||
Name: OpenEXR
|
||||
Description: OpenEXR image library
|
||||
Version: @OPENEXR_VERSION@
|
||||
|
||||
Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix}
|
||||
Cflags: -I${includedir} -I${OpenEXR_includedir} @exr_pthread_cflags@
|
||||
Requires: Imath
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
set(openexr_needthreads @OPENEXR_ENABLE_THREADING@)
|
||||
if (openexr_needthreads)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_dependency(Threads REQUIRED)
|
||||
endif()
|
||||
unset(openexr_needthreads)
|
||||
|
||||
find_dependency(Imath REQUIRED)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
@@ -1,182 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
// This file is auto-generated by the configure step
|
||||
|
||||
#ifndef INCLUDED_OPENEXR_CONFIG_H
|
||||
#define INCLUDED_OPENEXR_CONFIG_H 1
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// The OpenEXR release version is defined officially in
|
||||
// src/lib/OpenEXRCore/openexr_version.h, but CMake doesn't readily allow
|
||||
// that to be included here, so duplicate the settings for
|
||||
// backwards-compatibility with applications that may expect to get the
|
||||
// defines from this include.
|
||||
//
|
||||
|
||||
#ifndef INCLUDED_OPENEXR_VERSION_H
|
||||
#define OPENEXR_VERSION_MAJOR @OpenEXR_VERSION_MAJOR@
|
||||
#define OPENEXR_VERSION_MINOR @OpenEXR_VERSION_MINOR@
|
||||
#define OPENEXR_VERSION_PATCH @OpenEXR_VERSION_PATCH@
|
||||
#endif
|
||||
|
||||
//
|
||||
// Options / configuration based on O.S. / compiler
|
||||
/////////////////////
|
||||
|
||||
// automated formatting does not handle the cmake tags well
|
||||
// clang-format off
|
||||
|
||||
//
|
||||
// Define and set to 1 if the target system has support for large
|
||||
// stack sizes.
|
||||
//
|
||||
#cmakedefine OPENEXR_HAVE_LARGE_STACK 1
|
||||
|
||||
//////////////////////
|
||||
//
|
||||
// C++ namespace configuration / options
|
||||
|
||||
//
|
||||
// Current internal library namespace name
|
||||
//
|
||||
#define OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM @OPENEXR_NAMESPACE_CUSTOM@
|
||||
#define OPENEXR_IMF_INTERNAL_NAMESPACE @OPENEXR_INTERNAL_IMF_NAMESPACE@
|
||||
|
||||
//
|
||||
// Current public user namespace name
|
||||
//
|
||||
|
||||
#define OPENEXR_IMF_NAMESPACE_CUSTOM @OPENEXR_NAMESPACE_CUSTOM@
|
||||
#define OPENEXR_IMF_NAMESPACE @OPENEXR_IMF_NAMESPACE@
|
||||
|
||||
//
|
||||
// Version string for runtime access
|
||||
//
|
||||
|
||||
#define OPENEXR_VERSION_STRING "@OPENEXR_VERSION@"
|
||||
#define OPENEXR_PACKAGE_STRING "@OPENEXR_PACKAGE_NAME@"
|
||||
|
||||
#define OPENEXR_VERSION_RELEASE_TYPE "@OPENEXR_VERSION_RELEASE_TYPE@"
|
||||
// Deprecated, for back compatibility:
|
||||
#define OPENEXR_VERSION_EXTRA "@OPENEXR_VERSION_RELEASE_TYPE@"
|
||||
|
||||
#define OPENEXR_LIB_VERSION_STRING "@OPENEXR_LIB_VERSION@"
|
||||
|
||||
// clang-format on
|
||||
|
||||
// Version as a single hex number, e.g. 0x01000300 == 1.0.3
|
||||
#define OPENEXR_VERSION_HEX \
|
||||
((uint32_t (OPENEXR_VERSION_MAJOR) << 24) | \
|
||||
(uint32_t (OPENEXR_VERSION_MINOR) << 16) | \
|
||||
(uint32_t (OPENEXR_VERSION_PATCH) << 8))
|
||||
|
||||
// On modern versions of gcc & clang, __has_attribute can test support for
|
||||
// __attribute__((attr)). Make sure it's safe for other compilers.
|
||||
#ifndef __has_attribute
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
|
||||
// Whether the user configured the library to have symbol visibility
|
||||
// tagged
|
||||
#cmakedefine OPENEXR_ENABLE_API_VISIBILITY
|
||||
|
||||
/// \defgroup ExportMacros Macros to manage symbol visibility
|
||||
///
|
||||
/// See website/SymbolVisibility.rst for more discussion about the
|
||||
/// motivation for these macros
|
||||
///
|
||||
/// If we are compiling a DLL for Windows, there needs to be custom
|
||||
/// rules for each library such that the macro swaps between doing a
|
||||
/// dllexport and a dllimport, so the defines here are less
|
||||
/// useful. Further, MSVC does not have this concept at all currently,
|
||||
/// so is elided.
|
||||
///
|
||||
/// The top level macros which start with OPENEXR can act as simple
|
||||
/// ways to combine the logic however for non-DLL or non-windows
|
||||
/// platforms, but until the current patterns change, one should check
|
||||
/// the specific library export.h (i.e. @sa IexExport.h,
|
||||
/// @sa IlmThreadExport.h, @sa ImfExport.h, @sa ImfUtilExport.h )
|
||||
///
|
||||
/// These per-library exports define a subset which are used by that
|
||||
/// library.
|
||||
///
|
||||
/// Iex is simple and does not need to do more than expose class types
|
||||
/// and functions, and does not have any private members to hide, so
|
||||
/// only provides a couple of the possible macros.
|
||||
///
|
||||
/// Similarly, IlmThread is also reasonably simple.
|
||||
///
|
||||
/// OpenEXR and OpenEXRUtil have much more logic and have to deal with
|
||||
/// templates and template instantiation, and so define more of the
|
||||
/// macros.
|
||||
///
|
||||
/// @{
|
||||
|
||||
#if defined(OPENEXR_ENABLE_API_VISIBILITY) && \
|
||||
!(defined(OPENEXR_DLL) || defined(_MSC_VER))
|
||||
# define OPENEXR_PUBLIC_SYMBOL_ATTRIBUTE \
|
||||
__attribute__ ((__visibility__ ("default")))
|
||||
# define OPENEXR_PRIVATE_SYMBOL_ATTRIBUTE \
|
||||
__attribute__ ((__visibility__ ("hidden")))
|
||||
// clang differs from gcc and has type visibility which is needed
|
||||
// for enums and templates, and isn't well documented, but causes
|
||||
// the vtable and typeinfo to be made visible, but not necessarily
|
||||
// all the members
|
||||
# if __has_attribute(__type_visibility__)
|
||||
# define OPENEXR_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE \
|
||||
__attribute__ ((__type_visibility__ ("default")))
|
||||
# endif
|
||||
|
||||
// these are always the same, at least in current compilers
|
||||
# define OPENEXR_EXPORT OPENEXR_PUBLIC_SYMBOL_ATTRIBUTE
|
||||
# define OPENEXR_HIDDEN OPENEXR_PRIVATE_SYMBOL_ATTRIBUTE
|
||||
// currently define this as the same between compilers to export
|
||||
// things like default copy ctors etc, and do not use the type
|
||||
// visibility which only exports the typeinfo / vtable
|
||||
# define OPENEXR_EXPORT_TYPE OPENEXR_EXPORT
|
||||
# define OPENEXR_EXPORT_EXTERN_TEMPLATE OPENEXR_EXPORT
|
||||
|
||||
# ifdef OPENEXR_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE
|
||||
# define OPENEXR_EXPORT_ENUM OPENEXR_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE
|
||||
# define OPENEXR_EXPORT_TEMPLATE_TYPE \
|
||||
OPENEXR_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE
|
||||
// clang (well, type_visibility) seems empirically need the
|
||||
// default/public symbol tag when specifying explicit template
|
||||
// instantiations, where gcc (no type_visibility) complains if
|
||||
// you set that
|
||||
# define OPENEXR_EXPORT_TEMPLATE_INSTANCE OPENEXR_EXPORT
|
||||
# else
|
||||
# define OPENEXR_EXPORT_ENUM
|
||||
# define OPENEXR_EXPORT_TEMPLATE_TYPE OPENEXR_EXPORT
|
||||
# define OPENEXR_EXPORT_TEMPLATE_INSTANCE
|
||||
# endif
|
||||
|
||||
#else // msvc or api visibility disabled, just clear all this out (DLLs will define a set anyway)
|
||||
|
||||
# define OPENEXR_EXPORT
|
||||
# define OPENEXR_HIDDEN
|
||||
# define OPENEXR_EXPORT_TYPE
|
||||
# define OPENEXR_EXPORT_EXTERN_TEMPLATE
|
||||
# define OPENEXR_EXPORT_ENUM
|
||||
# define OPENEXR_EXPORT_TEMPLATE_TYPE
|
||||
# define OPENEXR_EXPORT_TYPE
|
||||
# define OPENEXR_EXPORT_TEMPLATE_INSTANCE
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201402L)
|
||||
# define OPENEXR_DEPRECATED(msg) [[deprecated (msg)]]
|
||||
#endif
|
||||
|
||||
#ifndef OPENEXR_DEPRECATED
|
||||
# ifdef _MSC_VER
|
||||
# define OPENEXR_DEPRECATED(msg) __declspec(deprecated (msg))
|
||||
# else
|
||||
# define OPENEXR_DEPRECATED(msg) __attribute__ ((deprecated (msg)))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif // INCLUDED_OPENEXR_CONFIG_H
|
||||
@@ -1,59 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
// This file is auto-generated by the configure step
|
||||
|
||||
#ifndef INCLUDED_OPENEXR_INTERNAL_CONFIG_H
|
||||
#define INCLUDED_OPENEXR_INTERNAL_CONFIG_H 1
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// Define and set to 1 if the target system supports a proc filesystem
|
||||
// compatible with the Linux kernel's proc filesystem. Note that this
|
||||
// is only used by a program in the OpenEXRTest test suite, it's not
|
||||
// used by any OpenEXR library or application code.
|
||||
//
|
||||
|
||||
// automated formatting does not handle the cmake tags well
|
||||
// clang-format off
|
||||
|
||||
#cmakedefine OPENEXR_IMF_HAVE_LINUX_PROCFS 1
|
||||
|
||||
//
|
||||
// Define and set to 1 if the target system is a Darwin-based system
|
||||
// (e.g., OS X).
|
||||
//
|
||||
|
||||
#cmakedefine OPENEXR_IMF_HAVE_DARWIN 1
|
||||
|
||||
//
|
||||
// Define and set to 1 if the target system has a complete <iomanip>
|
||||
// implementation, specifically if it supports the std::right
|
||||
// formatter.
|
||||
//
|
||||
|
||||
#cmakedefine OPENEXR_IMF_HAVE_COMPLETE_IOMANIP 1
|
||||
|
||||
//
|
||||
// Define if we can use sysconf(_SC_NPROCESSORS_ONLN) to get CPU count
|
||||
//
|
||||
|
||||
#cmakedefine OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN 1
|
||||
|
||||
//
|
||||
// Define if we can support GCC style inline asm with AVX instructions
|
||||
//
|
||||
|
||||
#cmakedefine OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX 1
|
||||
|
||||
//
|
||||
// Define if we need to shim in our own implementation of vld1q_f32_x2 for
|
||||
// older compilers that are missing x2 Neon intrinsics on aarch64
|
||||
//
|
||||
|
||||
#cmakedefine OPENEXR_MISSING_ARM_VLD1 0
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // INCLUDED_OPENEXR_INTERNAL_CONFIG_H
|
||||
@@ -1,78 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# NB: This function has a number of specific names / variables
|
||||
# in it, so be careful copying...
|
||||
function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
set(options)
|
||||
set(oneValueArgs PRIV_EXPORT CURDIR CURBINDIR)
|
||||
set(multiValueArgs SOURCES HEADERS DEPENDENCIES PRIVATE_DEPS)
|
||||
cmake_parse_arguments(OPENEXR_CURLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
set(objlib ${libname})
|
||||
add_library(${objlib}
|
||||
${OPENEXR_CURLIB_HEADERS}
|
||||
${OPENEXR_CURLIB_SOURCES})
|
||||
|
||||
# we use atomics internally for the core library, so need C11, but
|
||||
# is only a private requirement
|
||||
target_compile_features(${objlib} PRIVATE c_std_11)
|
||||
target_compile_features(${objlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
|
||||
if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIV_EXPORT})
|
||||
if(WIN32)
|
||||
target_compile_definitions(${objlib} PUBLIC OPENEXR_DLL)
|
||||
endif()
|
||||
endif()
|
||||
if(OPENEXR_CURLIB_CURDIR)
|
||||
target_include_directories(${objlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURDIR}>)
|
||||
endif()
|
||||
if(OPENEXR_CURLIB_CURBINDIR)
|
||||
target_include_directories(${objlib} PRIVATE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURBINDIR}>)
|
||||
endif()
|
||||
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES})
|
||||
if(OPENEXR_CURLIB_PRIVATE_DEPS)
|
||||
target_link_libraries(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIVATE_DEPS})
|
||||
endif()
|
||||
set_target_properties(${objlib} PROPERTIES
|
||||
C_STANDARD_REQUIRED ON
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS})
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set_target_properties(${libname} PROPERTIES
|
||||
SOVERSION ${OPENEXR_LIB_SOVERSION}
|
||||
VERSION ${OPENEXR_LIB_VERSION}
|
||||
)
|
||||
endif()
|
||||
set_target_properties(${libname} PROPERTIES
|
||||
OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS ${libname}
|
||||
EXPORT ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
PUBLIC_HEADER
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
|
||||
)
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "") AND NOT WIN32)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
|
||||
set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${OPENEXR_LIB_SUFFIX}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})")
|
||||
install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_DIR}/${baselibname} -> ${verlibname}\")")
|
||||
set(verlibname)
|
||||
set(baselibname)
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
@@ -1,299 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(NOT "${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
|
||||
set(OPENEXR_IS_SUBPROJECT ON)
|
||||
message(STATUS "OpenEXR is configuring as a cmake subproject")
|
||||
endif()
|
||||
|
||||
########################
|
||||
## Target configuration
|
||||
|
||||
# What C++ standard to compile for
|
||||
# VFX Platform 18 is c++14, so let's enable that by default
|
||||
set(tmp 14)
|
||||
if(CMAKE_CXX_STANDARD)
|
||||
set(tmp ${CMAKE_CXX_STANDARD})
|
||||
endif()
|
||||
set(OPENEXR_CXX_STANDARD "${tmp}" CACHE STRING "C++ standard to compile against")
|
||||
set(tmp)
|
||||
|
||||
set(OPENEXR_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)")
|
||||
set(OPENEXR_INTERNAL_IMF_NAMESPACE "Imf_${OPENEXR_VERSION_API}" CACHE STRING "Real namespace for OpenEXR that will end up in compiled symbols")
|
||||
set(OPENEXR_IMF_NAMESPACE "Imf" CACHE STRING "Public namespace alias for OpenEXR")
|
||||
set(OPENEXR_PACKAGE_NAME "OpenEXR ${OPENEXR_VERSION}${OPENEXR_VERSION_RELEASE_TYPE}" CACHE STRING "Public string / label for displaying package")
|
||||
|
||||
# Namespace-related settings, allows one to customize the
|
||||
# namespace generated, and to version the namespaces
|
||||
set(ILMTHREAD_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)")
|
||||
set(ILMTHREAD_INTERNAL_NAMESPACE "IlmThread_${OPENEXR_VERSION_API}" CACHE STRING "Real namespace for IlmThread that will end up in compiled symbols")
|
||||
set(ILMTHREAD_NAMESPACE "IlmThread" CACHE STRING "Public namespace alias for IlmThread")
|
||||
|
||||
set(IEX_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)")
|
||||
set(IEX_INTERNAL_NAMESPACE "Iex_${OPENEXR_VERSION_API}" CACHE STRING "Real namespace for Iex that will end up in compiled symbols")
|
||||
set(IEX_NAMESPACE "Iex" CACHE STRING "Public namespace alias for Iex")
|
||||
|
||||
# Whether to generate and install a pkg-config file OpenEXR.pc
|
||||
if (WIN32)
|
||||
option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" OFF)
|
||||
else()
|
||||
option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" ON)
|
||||
endif()
|
||||
|
||||
# Whether to enable threading. This can be disabled, although thread pool and tasks
|
||||
# are still used, just processed immediately
|
||||
option(OPENEXR_ENABLE_THREADING "Enables threaded processing of requests" ON)
|
||||
|
||||
option(OPENEXR_USE_DEFAULT_VISIBILITY "Makes the compile use default visibility (by default compiles tidy, hidden-by-default)" OFF)
|
||||
|
||||
# This is primarily for the auto array that enables a stack
|
||||
# object (if you enable this) that contains member to avoid double allocations
|
||||
option(OPENEXR_ENABLE_LARGE_STACK "Enables code to take advantage of large stack support" OFF)
|
||||
|
||||
########################
|
||||
## Build related options
|
||||
|
||||
# Whether to build & install the various command line utility programs
|
||||
option(OPENEXR_BUILD_TOOLS "Enables building of utility programs" ON)
|
||||
|
||||
# This is a variable here for use in controlling where include files are
|
||||
# installed. Care must be taken when changing this, as many things
|
||||
# probably assume this is OpenEXR
|
||||
set(OPENEXR_OUTPUT_SUBDIR OpenEXR CACHE STRING "Destination sub-folder of the include path for install")
|
||||
|
||||
# This does not seem to be available as a per-target property,
|
||||
# but is pretty harmless to set globally
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
# Suffix for debug configuration libraries
|
||||
# (if you should choose to install those)
|
||||
set(CMAKE_DEBUG_POSTFIX "_d" CACHE STRING "Suffix for debug builds")
|
||||
|
||||
if(NOT OPENEXR_IS_SUBPROJECT)
|
||||
# Usual cmake option to build shared libraries or not, only overridden if OpenEXR is a top level project,
|
||||
# in general this setting should be explicitly configured by the end user
|
||||
option(BUILD_SHARED_LIBS "Build shared library" ON)
|
||||
endif()
|
||||
|
||||
# Suffix to append to root name, this helps with version management
|
||||
# but can be turned off if you don't care, or otherwise customized
|
||||
set(OPENEXR_LIB_SUFFIX "-${OPENEXR_VERSION_API}" CACHE STRING "string added to the end of all the libraries")
|
||||
# when building both dynamic and static, the additional string to
|
||||
# add to the library name, such that to get static linkage, you
|
||||
# would use -lOpenEXR_static (or target_link_libraries(xxx OpenEXR::OpenEXR_static))
|
||||
set(OPENEXR_STATIC_LIB_SUFFIX "_static" CACHE STRING "When building both static and shared, name to append to static library (in addition to normal suffix)")
|
||||
|
||||
# rpath related setup
|
||||
# make sure we force an rpath to the rpath we're compiling
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
# adds the automatically determined parts of the rpath
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
if(APPLE)
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
endif()
|
||||
# if the user sets an install rpath
|
||||
# then just use that, or otherwise set one for them
|
||||
if(NOT CMAKE_INSTALL_RPATH)
|
||||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
||||
if("${isSystemDir}" STREQUAL "-1")
|
||||
if("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
get_filename_component(tmpSysPath "${CMAKE_INSTALL_FULL_LIBDIR}" NAME)
|
||||
if(NOT tmpSysPath)
|
||||
set(tmpSysPath "lib")
|
||||
endif()
|
||||
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../${tmpSysPath};${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
set(tmpSysPath)
|
||||
elseif(APPLE)
|
||||
set(CMAKE_INSTALL_RPATH "@loader_path/../lib;@executable_path/../lib;${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
endif()
|
||||
endif()
|
||||
set(isSystemDir)
|
||||
endif()
|
||||
|
||||
########################
|
||||
|
||||
# set a default build type if not set
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to 'Release' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
# Code check related features
|
||||
option(OPENEXR_USE_CLANG_TIDY "Check if clang-tidy is available, and enable that" OFF)
|
||||
if(OPENEXR_USE_CLANG_TIDY)
|
||||
find_program(OPENEXR_CLANG_TIDY_BIN clang-tidy)
|
||||
if(OPENEXR_CLANG_TIDY_BIN-NOTFOUND)
|
||||
message(FATAL_ERROR "clang-tidy processing requested, but no clang-tidy found")
|
||||
endif()
|
||||
# TODO: Need to define the list of valid checks and add a file with said list
|
||||
set(CMAKE_CXX_CLANG_TIDY
|
||||
${OPENEXR_CLANG_TIDY_BIN};
|
||||
-header-filter=.;
|
||||
-checks=*;
|
||||
)
|
||||
endif()
|
||||
|
||||
###############################
|
||||
# Dependent libraries
|
||||
|
||||
# so we know how to add the thread stuff to the pkg-config package
|
||||
# which is the only (but good) reason.
|
||||
if(OPENEXR_ENABLE_THREADING)
|
||||
if(NOT TARGET Threads::Threads)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads)
|
||||
if(NOT Threads_FOUND)
|
||||
message(FATAL_ERROR "Unable to find a threading library, disable with OPENEXR_ENABLE_THREADING=OFF")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(OPENEXR_FORCE_INTERNAL_DEFLATE "Force using an internal libdeflate" OFF)
|
||||
set(OPENEXR_DEFLATE_REPO "https://github.com/ebiggers/libdeflate.git" CACHE STRING "Repo path for libdeflate source")
|
||||
set(OPENEXR_DEFLATE_TAG "v1.18" CACHE STRING "Tag to use for libdeflate source repo (defaults to primary if empty)")
|
||||
|
||||
if(NOT OPENEXR_FORCE_INTERNAL_DEFLATE)
|
||||
#TODO: ^^ Release should not clone from main, this is a place holder
|
||||
set(CMAKE_IGNORE_PATH "${CMAKE_CURRENT_BINARY_DIR}/_deps/deflate-src/config;${CMAKE_CURRENT_BINARY_DIR}/_deps/deflate-build/config")
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(deflate IMPORTED_TARGET GLOBAL libdeflate)
|
||||
set(CMAKE_IGNORE_PATH)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND)
|
||||
if(OPENEXR_FORCE_INTERNAL_DEFLATE)
|
||||
message(STATUS "libdeflate forced internal, installing from ${OPENEXR_DEFLATE_REPO} (${OPENEXR_DEFLATE_TAG})")
|
||||
else()
|
||||
message(STATUS "libdeflate was not found, installing from ${OPENEXR_DEFLATE_REPO} (${OPENEXR_DEFLATE_TAG})")
|
||||
endif()
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(Deflate
|
||||
GIT_REPOSITORY "${OPENEXR_DEFLATE_REPO}"
|
||||
GIT_TAG "${OPENEXR_DEFLATE_TAG}"
|
||||
GIT_SHALLOW ON
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(Deflate)
|
||||
if(NOT Deflate_POPULATED)
|
||||
FetchContent_Populate(Deflate)
|
||||
endif()
|
||||
|
||||
# Rather than actually compile something, just embed the sources
|
||||
# into exrcore. This could in theory cause issues when compiling as
|
||||
# a static library into another application which also uses
|
||||
# libdeflate but we switch the export symbol to hidden which should
|
||||
# hide the symbols when linking...
|
||||
set(EXR_DEFLATE_SOURCES
|
||||
lib/arm/cpu_features.c
|
||||
lib/x86/cpu_features.c
|
||||
lib/utils.c
|
||||
lib/deflate_compress.c
|
||||
lib/deflate_decompress.c
|
||||
lib/adler32.c
|
||||
lib/zlib_compress.c
|
||||
lib/zlib_decompress.c)
|
||||
# don't need these
|
||||
# lib/crc32.c
|
||||
# lib/gzip_compress.c
|
||||
# lib/gzip_decompress.c
|
||||
file(READ ${deflate_SOURCE_DIR}/lib/lib_common.h DEFLATE_HIDE)
|
||||
string(REPLACE "visibility(\"default\")" "visibility(\"hidden\")" DEFLATE_HIDE "${DEFLATE_HIDE}")
|
||||
string(REPLACE "__declspec(dllexport)" "/**/" DEFLATE_HIDE "${DEFLATE_HIDE}")
|
||||
file(WRITE ${deflate_SOURCE_DIR}/lib/lib_common.h "${DEFLATE_HIDE}")
|
||||
|
||||
# cmake makes fetch content name lowercase for the properties (to deflate)
|
||||
list(TRANSFORM EXR_DEFLATE_SOURCES PREPEND ${deflate_SOURCE_DIR}/)
|
||||
set(EXR_DEFLATE_INCLUDE_DIR ${deflate_SOURCE_DIR})
|
||||
set(EXR_DEFLATE_LIB)
|
||||
else()
|
||||
set(EXR_DEFLATE_INCLUDE_DIR)
|
||||
set(EXR_DEFLATE_LIB PkgConfig::deflate)
|
||||
set(EXR_DEFLATE_SOURCES)
|
||||
endif()
|
||||
|
||||
#######################################
|
||||
# Find or install Imath
|
||||
#######################################
|
||||
|
||||
option(OPENEXR_FORCE_INTERNAL_IMATH "Force using an internal imath" OFF)
|
||||
# Check to see if Imath is installed outside of the current build directory.
|
||||
set(OPENEXR_IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING
|
||||
"Repo for auto-build of Imath")
|
||||
set(OPENEXR_IMATH_TAG "v3.1.9" CACHE STRING
|
||||
"Tag for auto-build of Imath (branch, tag, or SHA)")
|
||||
if(NOT OPENEXR_FORCE_INTERNAL_IMATH)
|
||||
#TODO: ^^ Release should not clone from main, this is a place holder
|
||||
set(CMAKE_IGNORE_PATH "${CMAKE_CURRENT_BINARY_DIR}/_deps/imath-src/config;${CMAKE_CURRENT_BINARY_DIR}/_deps/imath-build/config")
|
||||
find_package(Imath 3.1)
|
||||
set(CMAKE_IGNORE_PATH)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
|
||||
if(OPENEXR_FORCE_INTERNAL_IMATH)
|
||||
message(STATUS "Imath forced internal, installing from ${OPENEXR_IMATH_REPO} (${OPENEXR_IMATH_TAG})")
|
||||
else()
|
||||
message(STATUS "Imath was not found, installing from ${OPENEXR_IMATH_REPO} (${OPENEXR_IMATH_TAG})")
|
||||
endif()
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(Imath
|
||||
GIT_REPOSITORY "${OPENEXR_IMATH_REPO}"
|
||||
GIT_TAG "${OPENEXR_IMATH_TAG}"
|
||||
GIT_SHALLOW ON
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(Imath)
|
||||
if(NOT Imath_POPULATED)
|
||||
FetchContent_Populate(Imath)
|
||||
# hrm, cmake makes Imath lowercase for the properties (to imath)
|
||||
add_subdirectory(${imath_SOURCE_DIR} ${imath_BINARY_DIR})
|
||||
endif()
|
||||
# the install creates this but if we're using the library locally we
|
||||
# haven't installed the header files yet, so need to extract those
|
||||
# and make a variable for header only usage
|
||||
if(NOT TARGET Imath::ImathConfig)
|
||||
get_target_property(imathinc Imath INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(imathconfinc ImathConfig INTERFACE_INCLUDE_DIRECTORIES)
|
||||
list(APPEND imathinc ${imathconfinc})
|
||||
set(IMATH_HEADER_ONLY_INCLUDE_DIRS ${imathinc})
|
||||
message(STATUS "Imath interface dirs ${IMATH_HEADER_ONLY_INCLUDE_DIRS}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using Imath from ${Imath_DIR}")
|
||||
# local build
|
||||
# add_subdirectory(${IMATH_ROOT} Imath)
|
||||
# add_subdirectory(${OPENEXR_ROOT} OpenEXR)
|
||||
if(NOT TARGET Imath::ImathConfig AND TARGET Imath AND TARGET ImathConfig)
|
||||
get_target_property(imathinc Imath INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(imathconfinc ImathConfig INTERFACE_INCLUDE_DIRECTORIES)
|
||||
list(APPEND imathinc ${imathconfinc})
|
||||
set(IMATH_HEADER_ONLY_INCLUDE_DIRS ${imathinc})
|
||||
message(STATUS "Imath interface dirs ${IMATH_HEADER_ONLY_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###########################################
|
||||
# Check if we need to emulate vld1q_f32_x2
|
||||
###########################################
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
include(CheckCSourceCompiles)
|
||||
check_c_source_compiles("#include <arm_neon.h>
|
||||
int main() {
|
||||
float a[] = {1.0, 1.0};
|
||||
vld1q_f32_x2(a);
|
||||
return 0;
|
||||
}" HAS_VLD1)
|
||||
|
||||
if(NOT HAS_VLD1)
|
||||
set(OPENEXR_MISSING_ARM_VLD1 TRUE)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,62 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# This is a sample cmake test script that can be used to integrate into
|
||||
# a larger CI setup if you are building your own versions of OpenEXR
|
||||
# and also use a cdash (or cdash compliant) results server.
|
||||
#
|
||||
# There are also settings in the CMakeLists.txt you may wish to
|
||||
# just set in there, or replicate here.
|
||||
|
||||
# Running ctest -S thisscript.cmake will build into the binary directory
|
||||
# and run a few different tests based on what commands are specified
|
||||
# (and the steps below). It is best to read the ctest docs to
|
||||
# understand all these settings, and how to control it, this is merely
|
||||
# provided as a sample
|
||||
|
||||
# An edited version (or multiple) are intended to be placed in the CI
|
||||
# system, and putting O.S. / configuration specific control to this file
|
||||
# instead of having to put it into the make CMakeLists.txt tree
|
||||
# somehow.
|
||||
|
||||
# this contains the path to the source tree. This may come in as an
|
||||
# environment variable from the CI system, but you are free to have
|
||||
# any path in here
|
||||
set(CTEST_SOURCE_DIRECTORY "$ENV{PATH_TO_OPENEXR_TREE}")
|
||||
# Similarly, this is scratch space used to configure, build
|
||||
# and run the various tests.
|
||||
# For CI builds, it is recommended to make sure this is a
|
||||
# unique tree for each build
|
||||
set(CTEST_BINARY_DIRECTORY "/tmp/ctest")
|
||||
|
||||
# set an override for any compile flags to enable coverage
|
||||
# NB: This can make some of the auxiliary binaries such as the
|
||||
# dwa lookup table generator quite slow
|
||||
#set(ENV{CXXFLAGS} "--coverage")
|
||||
|
||||
# If you have alternate build systems, you can control that here
|
||||
#set(CTEST_CMAKE_GENERATOR "Ninja")
|
||||
set(CTEST_USE_LAUNCHERS 1)
|
||||
|
||||
# The various paths to programs to run coverage and memory checks
|
||||
set(CTEST_COVERAGE_COMMAND "gcov")
|
||||
set(CTEST_MEMORYCHECK_COMMAND "valgrind")
|
||||
#set(CTEST_MEMORYCHECK_TYPE "ThreadSanitizer")
|
||||
#
|
||||
|
||||
# any of the usual configurations (Debug, Release, etc).
|
||||
# We do not attempt to create any alternate configurations
|
||||
set(CTEST_CONFIGURATION_TYPE "RelWithDebInfo")
|
||||
|
||||
# can be Continuous, Nightly, or Experimental (see the cmake docs)
|
||||
ctest_start("Continuous")
|
||||
|
||||
# applies the various ctest steps
|
||||
ctest_configure()
|
||||
ctest_build()
|
||||
ctest_test()
|
||||
ctest_coverage()
|
||||
ctest_memcheck()
|
||||
|
||||
# This uploads the results to the server you configured
|
||||
ctest_submit()
|
||||
@@ -1,38 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# This is only an example of a theoretical toolchain file
|
||||
# that might be used for compiling to target a VFX
|
||||
# reference platform (https://vfxplatform.com) that is
|
||||
# consistent with the CY2015 spec.
|
||||
#
|
||||
# A toolchain file is loaded early in the cmake configure
|
||||
# process to enable compiler checks to use the appropriate
|
||||
# compilers.
|
||||
#
|
||||
# Read the docs to understand more:
|
||||
# https://cmake.org/cmake/help/v3.12/manual/cmake-toolchains.7.html
|
||||
#
|
||||
# Then to run, do something like
|
||||
# mkdir vfx_2015
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-Linux-VFX_Platform15.cmake -DCMAKE_INSTALL_PREFIX=/path/to/vfx_2015 ..
|
||||
# (plus any other settings you'd like)
|
||||
# make
|
||||
# make test
|
||||
# make install
|
||||
|
||||
# by not setting this, it will assume it's a mostly standard linux environment
|
||||
#set(CMAKE_SYSTEM_NAME Linux)
|
||||
|
||||
set(CMAKE_C_COMPILER gcc-4.8.2)
|
||||
set(CMAKE_CXX_COMPILER g++-4.8.2)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH /my/vfx_2015/libraries)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
# read the docs to understand whether this is what you want
|
||||
# if you use system libraries for some things, it may not be!!!
|
||||
#set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
#set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
#set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
@@ -1,32 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# This is only an example of cross compiling, but to compile for windows
|
||||
# under linux, have the relevant bits installed, and
|
||||
# validate the find path below
|
||||
#
|
||||
# Then to run, do something like
|
||||
# mkdir win32_cross
|
||||
# cd win32_cross
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw.cmake -DCMAKE_INSTALL_PREFIX=/tmp/win32 ..
|
||||
# or for static libs only
|
||||
# cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw.cmake -DCMAKE_INSTALL_PREFIX=/tmp/win32 ..
|
||||
# make
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
set(CMAKE_CROSSCOMPILING_EMULATOR wine)
|
||||
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
@@ -1,51 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# This module was partially adapted from OpenImageIO, also under the
|
||||
# same BSD-3-Clause license.
|
||||
|
||||
###########################################################################
|
||||
# clang-format options
|
||||
#
|
||||
# clang-format is a source code reformatter that is part of the LLVM tools.
|
||||
# It can be used to check adherence to project code formatting rules and
|
||||
# correct any deviations. If clang-format is found on the system, a
|
||||
# "clang-format" build target will trigger a reformatting.
|
||||
#
|
||||
set (CLANG_FORMAT_ROOT "" CACHE PATH "clang-format executable's directory (will search if not specified")
|
||||
set (CLANG_FORMAT_INCLUDES "*.h" "*.cpp"
|
||||
CACHE STRING "Glob patterns to include for clang-format")
|
||||
set (CLANG_FORMAT_EXCLUDES ""
|
||||
CACHE STRING "Glob patterns to exclude for clang-format")
|
||||
|
||||
# Look for clang-format. If not in the ordinary execution path, you can
|
||||
# hint at it with either CLANG_FORMAT_ROOT or LLVM_ROOT (as a CMake variable
|
||||
# or as an environment variable).
|
||||
find_program (CLANG_FORMAT_EXE
|
||||
NAMES clang-format bin/clang-format
|
||||
HINTS ${CLANG_FORMAT_ROOT}
|
||||
ENV CLANG_FORMAT_ROOT
|
||||
LLVM_ROOT
|
||||
ENV LLVM_ROOT
|
||||
DOC "Path to clang-format executable")
|
||||
|
||||
# If clang-format was found, set up a custom `clang-format` target that will
|
||||
# reformat all source code with filenames patterns matching
|
||||
# CLANG_FORMAT_INCLUDES and excluding CLANG_FORMAT_EXCLUDES.
|
||||
if (CLANG_FORMAT_EXE)
|
||||
message (STATUS "clang-format found: ${CLANG_FORMAT_EXE}")
|
||||
# Start with the list of files to include when formatting...
|
||||
file (GLOB_RECURSE FILES_TO_FORMAT ${CLANG_FORMAT_INCLUDES})
|
||||
# ... then process any list of excludes we are given
|
||||
foreach (_pat ${CLANG_FORMAT_EXCLUDES})
|
||||
file (GLOB_RECURSE _excl ${_pat})
|
||||
list (REMOVE_ITEM FILES_TO_FORMAT ${_excl})
|
||||
endforeach ()
|
||||
#message (STATUS "clang-format file list: ${FILES_TO_FORMAT}")
|
||||
file (COPY ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_custom_target (clang-format
|
||||
COMMAND "${CLANG_FORMAT_EXE}" -i -style=file ${FILES_TO_FORMAT} )
|
||||
else ()
|
||||
message (STATUS "clang-format not found.")
|
||||
endif ()
|
||||
@@ -1,60 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
# man pages for the bin programs
|
||||
|
||||
find_program(HELP2MAN help2man)
|
||||
|
||||
set(MANPAGE_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/man)
|
||||
file(MAKE_DIRECTORY ${MANPAGE_OUTPUT_DIR}/man1)
|
||||
|
||||
message(STATUS "MANPAGE_OUTPUT_DIR=${MANPAGE_OUTPUT_DIR}")
|
||||
message(STATUS "CMAKE_INSTALL_MANDIR=${CMAKE_INSTALL_MANDIR}")
|
||||
|
||||
set(manpage_files "")
|
||||
|
||||
function(DEFINE_MANPAGE tool description)
|
||||
|
||||
set(manpage_file ${MANPAGE_OUTPUT_DIR}/man1/${tool}.1)
|
||||
set(manpage_files "${manpage_files};${manpage_file}" PARENT_SCOPE)
|
||||
|
||||
add_custom_command(OUTPUT ${manpage_file}
|
||||
COMMAND
|
||||
${HELP2MAN} -n ${description} --output=${manpage_file} -N
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../bin/${tool}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/../bin/${tool}
|
||||
COMMENT "Generating man page for ${tool}"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
|
||||
# Provide help2man a useful single-line program description. There's
|
||||
# no especially good way to embed this in the program's --help text so
|
||||
# that help2man can detect it.
|
||||
|
||||
define_manpage(exr2aces "convert exr images to ACES format")
|
||||
define_manpage(exrcheck "validate exr files")
|
||||
define_manpage(exrenvmap "convert exr image environment maps")
|
||||
define_manpage(exrheader "print exr image header metadata")
|
||||
define_manpage(exrinfo "print exr image header metadata")
|
||||
define_manpage(exrmakepreview "generate exr preview thumbnail images")
|
||||
define_manpage(exrmaketiled "convert exr images to tiled format")
|
||||
define_manpage(exrmultipart "combine or split multipart exr images")
|
||||
define_manpage(exrmultiview "convert between single/multi-view exr images")
|
||||
define_manpage(exrstdattr "set exr image metadata")
|
||||
|
||||
add_custom_target(docs ALL DEPENDS
|
||||
${manpage_files})
|
||||
|
||||
# Add a target to install the manpages
|
||||
|
||||
if(INSTALL_DOCS)
|
||||
include(GNUInstallDirs)
|
||||
install(DIRECTORY ${MANPAGE_OUTPUT_DIR}/man1 DESTINATION ${CMAKE_INSTALL_MANDIR})
|
||||
endif()
|
||||
|
||||
# build the example code to verify that it compiles
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
set -ex
|
||||
|
||||
VALGRIND_VERSION="3.15.0"
|
||||
|
||||
echo "Updating to Valgrind ${VALGRIND_VERSION}"
|
||||
|
||||
wget -q https://sourceware.org/ftp/valgrind/valgrind-${VALGRIND_VERSION}.tar.bz2
|
||||
tar -xjf valgrind-${VALGRIND_VERSION}.tar.bz2
|
||||
|
||||
cd valgrind-${VALGRIND_VERSION}
|
||||
|
||||
# Build valgrind
|
||||
sed -i 's|/doc/valgrind||' docs/Makefile.in &&
|
||||
./configure --prefix=/usr \
|
||||
--datadir=/usr/share/doc/valgrind-${VALGRIND_VERSION} &&
|
||||
make
|
||||
|
||||
# Test the build - disabled
|
||||
# NOTE: if enabled, must install prerequisites gedb-8.3 and six-1.12.0
|
||||
# make regtest
|
||||
|
||||
# Install valgrind
|
||||
sudo make install
|
||||
|
||||
echo $(which valgrind)
|
||||
|
||||
cd ..
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
set -ex
|
||||
|
||||
LOGDIR="$1"
|
||||
|
||||
if [[ -d ${LOGDIR}/Testing/Temporary ]]; then
|
||||
for log in ${LOGDIR}/Testing/Temporary/MemoryChecker.*.log; do
|
||||
echo "========================== " ${log##*/} " =========================="
|
||||
cat $log
|
||||
echo
|
||||
done
|
||||
else
|
||||
echo "Memcheck log files not found."
|
||||
fi
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
set -ex
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
build=$1 # use explicity-provided build directory
|
||||
coverage="$build/_coverage"
|
||||
else
|
||||
build='../_build' # from with CI, use the _build subdirectory
|
||||
coverage="_coverage"
|
||||
fi
|
||||
|
||||
mkdir -p $coverage
|
||||
cd $coverage
|
||||
|
||||
for gcno in $(find $build -name "*.gcno" -type f); do
|
||||
|
||||
# Identify the original source file (.cpp or .c) from the .gcno
|
||||
# file by examining the .o.d make dependency file. The source
|
||||
# file should be the second line in the .o.d file.
|
||||
|
||||
# gcno = $build/src/bin/exrheader/CMakeFiles/exrheader.dir/main.gcno
|
||||
# object_directory = $build/src/bin/exrheader/CMakeFiles/exrheader.dir
|
||||
# source_base = $build/src/bin/exrheader/CMakeFiles/exrheader.dir/main
|
||||
# dependenty_file = $build/src/bin/exrheader/CMakeFiles/exrheader.dir/main.o.d
|
||||
|
||||
object_directory=$(dirname "$gcno")
|
||||
source_base=$(basename "$gcno" ".gcno")
|
||||
dependency_file=$object_directory/$source_base.o.d
|
||||
|
||||
if [ -f "$dependency_file" ]; then
|
||||
|
||||
source_file=$(head -2 $dependency_file | tail -1 | sed -e 's/ //' -e 's/ \\//')
|
||||
gcov -l -p -o $object_directory $source_file
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
#
|
||||
# Validate the library symlinks:
|
||||
# * The actual elf binary is, e.g. libIlmThread-3_1.so.29.0.0
|
||||
# * The symlinks are:
|
||||
# libIlmThread.so -> libIlmThread-3_1.so
|
||||
# libIlmThread-3_1.so -> libIlmThread-3_1.so.29
|
||||
# libIlmThread-3_1.so.29 -> libIlmThread-3_1.so.29.0.0
|
||||
#
|
||||
# Extract the version by compiling a program that prints the
|
||||
# OPENEXR_VERSION_STRING. This also validates that the program
|
||||
# compiles and executes with the info from pkg-config.
|
||||
#
|
||||
|
||||
if [[ $# == "0" ]]; then
|
||||
echo "usage: $0 BUILD_ROOT [SRC_ROOT]"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
BUILD_ROOT=$1
|
||||
SRC_ROOT=$2
|
||||
|
||||
# Locate OpenEXR.pc and set PKG_CONFIG_PATH accordingly
|
||||
|
||||
pkgconfig=$(find $BUILD_ROOT -name OpenEXR.pc)
|
||||
if [[ "$pkgconfig" == "" ]]; then
|
||||
echo "Can't find OpenEXR.pc"
|
||||
exit -1
|
||||
fi
|
||||
export PKG_CONFIG_PATH=$(dirname $pkgconfig)
|
||||
|
||||
# Build the validation program
|
||||
|
||||
CXX_FLAGS=$(pkg-config OpenEXR --cflags)
|
||||
LD_FLAGS=$(pkg-config OpenEXR --libs --static)
|
||||
|
||||
VALIDATE_CPP=$(mktemp --tmpdir "validate_XXX.cpp")
|
||||
VALIDATE_BIN=$(mktemp --tmpdir "validate_XXX")
|
||||
trap "rm -rf $VALIDATE_CPP $VALIDATE_BIN" exit
|
||||
|
||||
echo -e '#include <ImfHeader.h>\n#include <OpenEXRConfig.h>\n#include <stdio.h>\nint main() { puts(OPENEXR_PACKAGE_STRING); Imf::Header h; return 0; }' > $VALIDATE_CPP
|
||||
|
||||
g++ $CXX_FLAGS $VALIDATE_CPP -o $VALIDATE_BIN $LD_FLAGS
|
||||
|
||||
# Execute the program
|
||||
|
||||
LIB_DIR=$(pkg-config OpenEXR --variable=libdir)
|
||||
export LD_LIBRARY_PATH=$LIB_DIR
|
||||
|
||||
validate=`$VALIDATE_BIN`
|
||||
status=$?
|
||||
|
||||
echo $validate
|
||||
|
||||
if [[ "$status" != "0" ]]; then
|
||||
echo "validate failed: $validate"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Get the suffix, e.g. -2_5_d, and determine if there's also a _d
|
||||
libsuffix=$(pkg-config OpenEXR --variable=libsuffix)
|
||||
if [[ $libsuffix != $(basename ./$libsuffix _d) ]]; then
|
||||
_d="_d"
|
||||
else
|
||||
_d=""
|
||||
fi
|
||||
|
||||
# Validate each of the libs
|
||||
libs=$(pkg-config OpenEXR --libs-only-l | sed -e s/-l//g)
|
||||
for lib in $libs; do
|
||||
|
||||
base=$(echo $lib | cut -d- -f1)
|
||||
suffix=$(echo $lib | cut -d- -f2)
|
||||
|
||||
if [[ -f $LIB_DIR/lib$base$_d.so ]]; then
|
||||
libbase=$(readlink $LIB_DIR/lib$base$_d.so)
|
||||
libcurrent=$(readlink $LIB_DIR/$libbase)
|
||||
libversion=$(readlink $LIB_DIR/$libcurrent)
|
||||
file $LIB_DIR/$libversion | grep -q "ELF"
|
||||
|
||||
if [[ "$?" != 0 ]]; then
|
||||
echo "Broken libs: lib$base.so -> $libbase -> $libcurrent -> $libversion"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "lib$base.so -> $libbase -> $libcurrent -> $libversion"
|
||||
|
||||
elif [[ ! -f $LIB_DIR/lib$lib.a ]]; then
|
||||
echo "No static lib: $LIB_DIR/lib$lib.a"
|
||||
else
|
||||
echo "Static lib lib$lib.a"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# Confirm no broken .so symlinks
|
||||
file $LIB_DIR/lib* | grep -q broken
|
||||
if [[ "$?" == "0" ]]; then
|
||||
echo "Broken symbolic link."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [[ "$SRC_ROOT" != "" ]]; then
|
||||
version=$(pkg-config OpenEXR --modversion)
|
||||
notes=$(grep "\* \[Version $version\]" $SRC_ROOT/CHANGES.md | head -1)
|
||||
if [[ "$notes" == "" ]]; then
|
||||
echo "No release notes."
|
||||
else
|
||||
echo "Release notes: $notes"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "ok."
|
||||
@@ -1,109 +0,0 @@
|
||||
#! /bin/bash
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
buildtype=Debug
|
||||
cflags="-ggdb3 -Og"
|
||||
|
||||
lib_names=(Iex IlmThread OpenEXRCore OpenEXR OpenEXRUtil)
|
||||
|
||||
libver_old=v3.1.7
|
||||
sonames_old=(libIex-3_1_d.so.30.7.1 libIlmThread-3_1_d.so.30.7.1 libOpenEXRCore-3_1_d.so.30.7.1 libOpenEXRUtil-3_1_d.so.30.7.1 libOpenEXR-3_1_d.so.30.7.1)
|
||||
libver_new=RB-3.1
|
||||
sonames_new=(libIex-3_1_d.so.30.8.1 libIlmThread-3_1_d.so.30.8.1 libOpenEXRCore-3_1_d.so.30.8.1 libOpenEXRUtil-3_1_d.so.30.8.1 libOpenEXR-3_1_d.so.30.8.1)
|
||||
|
||||
srcdir=`pwd`
|
||||
|
||||
if [[ "$1" == distclean ]]; then
|
||||
rm -rf abi_check
|
||||
fi
|
||||
|
||||
mkdir -p abi_check
|
||||
export PATH=${srcdir}/abi_check/bin:${PATH}
|
||||
|
||||
cd abi_check
|
||||
|
||||
if [[ ! -e bin/vtable-dumper ]]; then
|
||||
mkdir -p src
|
||||
cd src
|
||||
git clone https://github.com/lvc/vtable-dumper
|
||||
cd vtable-dumper
|
||||
make
|
||||
make install prefix=${srcdir}/abi_check
|
||||
cd ${srcdir}/abi_check
|
||||
fi
|
||||
|
||||
if [[ ! -e bin/abi-dumper ]]; then
|
||||
mkdir -p src
|
||||
cd src
|
||||
git clone https://github.com/lvc/abi-dumper
|
||||
cd abi-dumper
|
||||
perl Makefile.pl -install --prefix=${srcdir}/abi_check
|
||||
cd ${srcdir}/abi_check
|
||||
fi
|
||||
|
||||
if [[ ! -e bin/abi-compliance-checker ]]; then
|
||||
mkdir -p src
|
||||
cd src
|
||||
git clone https://github.com/lvc/abi-compliance-checker
|
||||
cd abi-compliance-checker
|
||||
perl Makefile.pl -install --prefix=${srcdir}/abi_check
|
||||
cd ${srcdir}/abi_check
|
||||
fi
|
||||
|
||||
builddir_v1=build.${libver_old}
|
||||
builddir_v2=build.${libver_new}
|
||||
instdir_v1=inst.${libver_old}
|
||||
instdir_v2=inst.${libver_new}
|
||||
|
||||
if [[ "$1" == clean ]]; then
|
||||
rm -rf ${builddir_v1}
|
||||
rm -rf ${builddir_v2}
|
||||
rm -rf ${instdir_v1}
|
||||
rm -rf ${instdir_v2}
|
||||
rm -rf abidumps
|
||||
fi
|
||||
|
||||
curhash=`git branch --show-current`
|
||||
if [[ "${curhash}" == "" ]]; then
|
||||
curhash=`git rev-parse HEAD`
|
||||
fi
|
||||
|
||||
if [[ ! -e ${instdir_v1} ]]; then
|
||||
rm -rf ${builddir_v1}
|
||||
git checkout ${libver_old} || exit 1
|
||||
cmake -B ${builddir_v1} -S ${srcdir} -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF -DCMAKE_C_FLAGS="${cflags}" -DCMAKE_CXX_FLAGS="${cflags}" -DCMAKE_INSTALL_PREFIX=${srcdir}/abi_check/${instdir_v1} || exit 1
|
||||
ninja -C ${builddir_v1} install || exit 1
|
||||
git checkout ${curhash}
|
||||
fi
|
||||
|
||||
if [[ ! -e ${instdir_v2} ]]; then
|
||||
rm -rf ${builddir_v2}
|
||||
git checkout ${libver_new} || exit 1
|
||||
cmake -B ${builddir_v2} -S ${srcdir} -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF -DCMAKE_C_FLAGS="${cflags}" -DCMAKE_CXX_FLAGS="${cflags}" -DCMAKE_INSTALL_PREFIX=${srcdir}/abi_check/${instdir_v2} || exit 1
|
||||
ninja -C ${builddir_v2} install || exit 1
|
||||
git checkout ${curhash}
|
||||
fi
|
||||
|
||||
len=${#lib_names[@]}
|
||||
|
||||
mkdir -p abidumps/${libver_old}
|
||||
mkdir -p abidumps/${libver_new}
|
||||
for (( i=0; i<$len; i++ ));
|
||||
do
|
||||
name=${lib_names[$i]}
|
||||
echo "Processing ${name}"
|
||||
|
||||
abi-dumper ${instdir_v1}/lib/${sonames_old[$i]} -o abidumps/${libver_old}/ABI-${name}.dump -vnum ${libver_old} -skip-cxx -all-symbols
|
||||
abi-dumper ${instdir_v2}/lib/${sonames_new[$i]} -o abidumps/${libver_new}/ABI-${name}.dump -vnum ${libver_new} -skip-cxx -all-symbols
|
||||
|
||||
abi-compliance-checker -l ${name} -d1 abidumps/${libver_old}/ABI-${name}.dump -v1 ${libver_old} -d2 abidumps/${libver_new}/ABI-${name}.dump -v2 ${libver_new}
|
||||
done
|
||||
|
||||
echo "Reports should be at:"
|
||||
for (( i=0; i<$len; i++ ));
|
||||
do
|
||||
name=${lib_names[$i]}
|
||||
echo "${name}: file://${srcdir}/abi_check/compat_reports/${name}/${libver_old}_to_${libver_new}/compat_report.html"
|
||||
done
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
#! /bin/bash
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
# This script can be used to generate a local test coverage report
|
||||
# using the clang / llvm toolset for doing so
|
||||
# It should hopefully be obvious how to adjust, but should work
|
||||
# on most linux distros
|
||||
|
||||
buildtype=Debug
|
||||
builddir=build.coverage
|
||||
|
||||
haveninja=`which ninja`
|
||||
|
||||
#imathoverride="-DOPENEXR_FORCE_INTERNAL_IMATH=ON -DIMATH_REPO=/home/user/Development/Imath"
|
||||
|
||||
# also turn on most of the warnings because we should look at that
|
||||
# as well...
|
||||
cwarns="-fstack-protector-all -Weverything -Wno-reserved-identifier -Wno-covered-switch-default -Wno-cast-align -Wno-overlength-strings -fprofile-arcs -fprofile-instr-generate -fcoverage-mapping"
|
||||
cxxwarns="-fstack-protector-all -Wno-sign-conversion -Wno-float-equal -Wno-padded -Wno-zero-as-null-pointer-constant -Wno-old-style-cast -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-missing-braces -fprofile-instr-generate -fcoverage-mapping"
|
||||
|
||||
genargs=""
|
||||
if [[ "$haveninja" != "" ]]; then
|
||||
genargs="-G Ninja"
|
||||
fi
|
||||
|
||||
if [[ ! -e "${builddir}" ]]; then
|
||||
export CC=/usr/bin/clang
|
||||
export CXX=/usr/bin/clang++
|
||||
|
||||
cmake -B ${builddir} -S . ${genargs} ${imathoverride} -DCMAKE_C_FLAGS="${cwarns}" -DCMAKE_CXX_FLAGS="${cxxwarns}" -DCMAKE_BUILD_TYPE=${buildtype} || exit 1
|
||||
fi
|
||||
|
||||
if [[ "$haveninja" != "" ]]; then
|
||||
ninja -C ${builddir} || exit 1
|
||||
else
|
||||
nproc=`cat /proc/cpuinfo|grep processor|wc -l`
|
||||
make -j${nproc} -C ${builddir} || exit 1
|
||||
fi
|
||||
|
||||
# archive previous runs????
|
||||
rm -rf coverage
|
||||
|
||||
/usr/bin/env LLVM_PROFILE_FILE=coverage/core.profraw build.coverage/bin/OpenEXRCoreTest || exit 1
|
||||
/usr/bin/env LLVM_PROFILE_FILE=coverage/exr.profraw build.coverage/bin/OpenEXRTest || exit 1
|
||||
/usr/bin/env LLVM_PROFILE_FILE=coverage/util.profraw build.coverage/bin/OpenEXRUtilTest || exit 1
|
||||
|
||||
llvm-profdata merge -sparse -o coverage/exr.profdata coverage/core.profraw coverage/exr.profraw coverage/util.profraw
|
||||
|
||||
llvm-cov show \
|
||||
build.coverage/bin/OpenEXRCoreTest \
|
||||
-object build.coverage/src/lib/OpenEXRCore/libOpenEXRCore-3_2_d.so \
|
||||
-instr-profile=coverage/exr.profdata \
|
||||
-show-regions \
|
||||
-show-expansions \
|
||||
--output-dir=coverage/core_only \
|
||||
--format="html" \
|
||||
-ignore-filename-regex='src/test/.*' \
|
||||
-ignore-filename-regex='build.coverage/.*' \
|
||||
-ignore-filename-regex='src/lib/OpenEXR/Imf*'
|
||||
|
||||
llvm-cov show \
|
||||
build.coverage/bin/OpenEXRTest \
|
||||
-object build.coverage/src/lib/OpenEXR/libOpenEXR-3_2_d.so \
|
||||
-instr-profile=coverage/exr.profdata \
|
||||
-show-regions \
|
||||
-show-expansions \
|
||||
--output-dir=coverage/exr_only \
|
||||
--format="html" \
|
||||
-ignore-filename-regex='src/test/.*' \
|
||||
-ignore-filename-regex='build.coverage/.*' \
|
||||
-ignore-filename-regex='src/lib/OpenEXRCore/*'
|
||||
|
||||
llvm-cov show \
|
||||
build.coverage/bin/OpenEXRUtilTest \
|
||||
-object build.coverage/src/lib/OpenEXRUtil/libOpenEXRUtil-3_2_d.so \
|
||||
-instr-profile=coverage/exr.profdata \
|
||||
-show-regions \
|
||||
-show-expansions \
|
||||
--output-dir=coverage/util_only \
|
||||
--format="html" \
|
||||
-ignore-filename-regex='src/test/.*' \
|
||||
-ignore-filename-regex='build.coverage/.*' \
|
||||
-ignore-filename-regex='src/lib/OpenEXR/Imf*' \
|
||||
-ignore-filename-regex='src/lib/OpenEXRCore/*'
|
||||
|
||||
llvm-cov show \
|
||||
build.coverage/bin/OpenEXRCoreTest \
|
||||
-object build.coverage/bin/OpenEXRTest \
|
||||
-object build.coverage/bin/OpenEXRUtilTest \
|
||||
-object build.coverage/src/lib/OpenEXRCore/libOpenEXRCore-3_2_d.so \
|
||||
-object build.coverage/src/lib/OpenEXR/libOpenEXR-3_2_d.so \
|
||||
-object build.coverage/src/lib/OpenEXRUtil/libOpenEXRUtil-3_2_d.so \
|
||||
-instr-profile=coverage/exr.profdata \
|
||||
-show-regions \
|
||||
-show-expansions \
|
||||
--output-dir=coverage/combined \
|
||||
--format="html" \
|
||||
-ignore-filename-regex='src/test/.*' \
|
||||
-ignore-filename-regex='build.coverage/.*'
|
||||
@@ -1,15 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
cformat=`which clang-format`
|
||||
if [[ "${cformat}" == "" ]]; then
|
||||
echo "ERROR: clang-format not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
scriptpath=`realpath $0`
|
||||
scriptdir=`dirname $scriptpath`
|
||||
basedir=`dirname $scriptdir`
|
||||
echo "Processing files in: ${basedir}"
|
||||
cd ${basedir}
|
||||
find . \( -name '*.cpp' -o -name '*.h' \) -exec ${cformat} -style=file -verbose -i {} \;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# SonarCloud analysis configuration file
|
||||
# https://sonarcloud.io/documentation/analysis/analysis-parameters
|
||||
|
||||
sonar.host.url=https://sonarcloud.io
|
||||
|
||||
# Required metadata
|
||||
sonar.organization=academysoftwarefoundation
|
||||
sonar.projectKey=AcademySoftwareFoundation_openexr
|
||||
sonar.projectName=OpenEXR
|
||||
sonar.projectVersion=2.5
|
||||
|
||||
# Project links
|
||||
sonar.links.homepage=http://openexr.com
|
||||
sonar.links.ci=https://github.com/AcademySoftwareFoundation/openexr/actions
|
||||
sonar.links.scm=https://github.com/AcademySoftwareFoundation/openexr
|
||||
sonar.links.issue=https://github.com/AcademySoftwareFoundation/openexr/issues
|
||||
|
||||
# Source properties
|
||||
sonar.sources=src
|
||||
sonar.sourceEncoding=UTF-8
|
||||
sonar.exclusions=src/bindings/java/**,*.java
|
||||
|
||||
# C/C++ analyzer properties
|
||||
sonar.cfamily.build-wrapper-output=_build/bw_output
|
||||
sonar.cfamily.gcov.reportsPath=_coverage
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
##########################
|
||||
# Binaries / Utilities
|
||||
##########################
|
||||
if(OPENEXR_BUILD_TOOLS)
|
||||
add_subdirectory( exr2aces )
|
||||
add_subdirectory( exrheader )
|
||||
add_subdirectory( exrinfo )
|
||||
add_subdirectory( exrmaketiled )
|
||||
add_subdirectory( exrstdattr )
|
||||
add_subdirectory( exrmakepreview )
|
||||
add_subdirectory( exrenvmap )
|
||||
add_subdirectory( exrmultiview )
|
||||
add_subdirectory( exrmultipart )
|
||||
add_subdirectory( exrcheck )
|
||||
endif()
|
||||
@@ -1,14 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
add_executable(exr2aces main.cpp)
|
||||
target_link_libraries(exr2aces OpenEXR::OpenEXR)
|
||||
set_target_properties(exr2aces PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
if(OPENEXR_INSTALL_TOOLS)
|
||||
install(TARGETS exr2aces DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(exr2aces PRIVATE OPENEXR_DLL)
|
||||
endif()
|
||||
@@ -1,204 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// exr2aces -- a program that converts an
|
||||
// OpenEXR file to an ACES image file.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <ImfAcesFile.h>
|
||||
#include <ImfArray.h>
|
||||
#include <ImfRgbaFile.h>
|
||||
#include <ImfMisc.h>
|
||||
#include <OpenEXRConfig.h>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
|
||||
#include <OpenEXRConfig.h>
|
||||
using namespace OPENEXR_IMF_NAMESPACE;
|
||||
using namespace IMATH_NAMESPACE;
|
||||
using namespace std;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
void
|
||||
usageMessage (ostream& stream, const char* program_name, bool verbose = false)
|
||||
{
|
||||
stream << "Usage: " << program_name << " [options] infile outfile" << endl;
|
||||
|
||||
if (verbose)
|
||||
stream << "\n"
|
||||
"Read an OpenEXR file from infile and save the contents\n"
|
||||
"in ACES image file outfile.\n"
|
||||
"\n"
|
||||
"The ACES image file format is a subset of the OpenEXR file\n"
|
||||
"format. ACES image files are restricted as follows:\n"
|
||||
"\n"
|
||||
" * Images are stored as scanlines; tiles are not allowed.\n"
|
||||
" * Images contain three color channels, either:\n"
|
||||
" R, G, B (red, green, blue)\n"
|
||||
" or:\n"
|
||||
" Y, RY, BY (luminance, sub-sampled chroma)\n"
|
||||
" * Images may optionally contain an alpha channel.\n"
|
||||
" * Only three compression types are allowed:\n"
|
||||
" NO_COMPRESSION (file is not compressed)\n"
|
||||
" PIZ_COMPRESSION (lossless)\n"
|
||||
" B44A_COMPRESSION (lossy)\n"
|
||||
" * The \"chromaticities\" header attribute must specify\n"
|
||||
" the ACES RGB primaries and white point.\n"
|
||||
"\n"
|
||||
"Options:\n"
|
||||
" -v, --verbose verbose mode\n"
|
||||
" -h, --help print this message\n"
|
||||
" --version print version information\n"
|
||||
"\n"
|
||||
"Report bugs via https://github.com/AcademySoftwareFoundation/openexr/issues or email security@openexr.com\n"
|
||||
"";
|
||||
}
|
||||
|
||||
void
|
||||
exr2aces (const char inFileName[], const char outFileName[], bool verbose)
|
||||
{
|
||||
Array2D<Rgba> p;
|
||||
Header h;
|
||||
RgbaChannels ch;
|
||||
Box2i dw;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
{
|
||||
if (verbose) cout << "Reading file " << inFileName << endl;
|
||||
|
||||
AcesInputFile in (inFileName);
|
||||
|
||||
h = in.header ();
|
||||
ch = in.channels ();
|
||||
dw = h.dataWindow ();
|
||||
|
||||
width = dw.max.x - dw.min.x + 1;
|
||||
height = dw.max.y - dw.min.y + 1;
|
||||
p.resizeErase (height, width);
|
||||
|
||||
in.setFrameBuffer (ComputeBasePointer (&p[0][0], dw), 1, width);
|
||||
in.readPixels (dw.min.y, dw.max.y);
|
||||
}
|
||||
|
||||
switch (h.compression ())
|
||||
{
|
||||
case NO_COMPRESSION: break;
|
||||
|
||||
case B44_COMPRESSION:
|
||||
case B44A_COMPRESSION: h.compression () = B44A_COMPRESSION; break;
|
||||
|
||||
default: h.compression () = PIZ_COMPRESSION;
|
||||
}
|
||||
|
||||
{
|
||||
if (verbose) cout << "Writing file " << outFileName << endl;
|
||||
|
||||
AcesOutputFile out (outFileName, h, ch);
|
||||
|
||||
out.setFrameBuffer (ComputeBasePointer (&p[0][0], dw), 1, width);
|
||||
out.writePixels (height);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int
|
||||
main (int argc, char** argv)
|
||||
{
|
||||
const char* inFile = 0;
|
||||
const char* outFile = 0;
|
||||
bool verbose = false;
|
||||
|
||||
//
|
||||
// Parse the command line.
|
||||
//
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
usageMessage (cerr, argv[0], false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int i = 1;
|
||||
|
||||
while (i < argc)
|
||||
{
|
||||
if (!strcmp (argv[i], "-v"))
|
||||
{
|
||||
//
|
||||
// Verbose mode
|
||||
//
|
||||
|
||||
verbose = true;
|
||||
i += 1;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-h") || !strcmp (argv[i], "--help"))
|
||||
{
|
||||
//
|
||||
// Print help message
|
||||
//
|
||||
|
||||
usageMessage (cout, "exr2aces", true);
|
||||
return 0;
|
||||
}
|
||||
else if (!strcmp (argv[i], "--version"))
|
||||
{
|
||||
const char* libraryVersion = getLibraryVersion();
|
||||
|
||||
cout << "exr2aces (OpenEXR) " << OPENEXR_VERSION_STRING;
|
||||
if (strcmp(libraryVersion, OPENEXR_VERSION_STRING))
|
||||
cout << "(OpenEXR version " << libraryVersion << ")";
|
||||
cout << " https://openexr.com" << endl;
|
||||
cout << "Copyright (c) Contributors to the OpenEXR Project" << endl;
|
||||
cout << "License BSD-3-Clause" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Image file name
|
||||
//
|
||||
|
||||
if (inFile == 0)
|
||||
inFile = argv[i];
|
||||
else
|
||||
outFile = argv[i];
|
||||
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (inFile == 0 || outFile == 0)
|
||||
{
|
||||
usageMessage (cerr, argv[0], false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//
|
||||
// Load inFile, and save a tiled version in outFile.
|
||||
//
|
||||
|
||||
try
|
||||
{
|
||||
exr2aces (inFile, outFile, verbose);
|
||||
}
|
||||
catch (const exception& e)
|
||||
{
|
||||
cerr << argv[0] << ": " << e.what () << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
add_executable(exrcheck main.cpp)
|
||||
target_link_libraries(exrcheck OpenEXR::OpenEXR OpenEXR::OpenEXRUtil)
|
||||
set_target_properties(exrcheck PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
# install(TARGETS exrcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(exrcheck PRIVATE OPENEXR_DLL)
|
||||
endif()
|
||||
@@ -1,187 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
#include <ImathConfig.h>
|
||||
#include <ImfCheckFile.h>
|
||||
#include <ImfMisc.h>
|
||||
#include <OpenEXRConfig.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <string.h>
|
||||
#if defined _WIN32 || defined _WIN64
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
using namespace OPENEXR_IMF_NAMESPACE;
|
||||
using namespace std;
|
||||
|
||||
void
|
||||
usageMessage (ostream& stream, const char* program_name, bool verbose = false)
|
||||
{
|
||||
stream << "Usage: " << program_name << " [options] imagefile [imagefile ...]\n";
|
||||
|
||||
if (verbose)
|
||||
stream << "\n"
|
||||
"Read exr files to validate their contents and the correct behavior of the software.\n"
|
||||
"\n"
|
||||
"Options:\n"
|
||||
" -m avoid excessive memory allocation (some files will not be fully checked)\n"
|
||||
" -t avoid spending excessive time (some files will not be fully checked)\n"
|
||||
" -s use stream API instead of file API\n"
|
||||
" -c add core library checks\n"
|
||||
" -h, --help print this message\n"
|
||||
" --version print version information\n"
|
||||
"\n"
|
||||
"Report bugs via https://github.com/AcademySoftwareFoundation/openexr/issues or email security@openexr.com\n"
|
||||
"";
|
||||
}
|
||||
|
||||
bool
|
||||
exrCheck (
|
||||
const char* filename,
|
||||
bool reduceMemory,
|
||||
bool reduceTime,
|
||||
bool useStream,
|
||||
bool enableCoreCheck)
|
||||
{
|
||||
if (useStream)
|
||||
{
|
||||
//
|
||||
// open file as stream, check size
|
||||
//
|
||||
ifstream instream (filename, ifstream::binary);
|
||||
|
||||
if (!instream)
|
||||
{
|
||||
cerr << "internal error: bad file '" << filename
|
||||
<< "' for in-memory stream" << endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
instream.seekg (0, instream.end);
|
||||
streampos length = instream.tellg ();
|
||||
instream.seekg (0, instream.beg);
|
||||
|
||||
const uintptr_t kMaxSize = uintptr_t (-1) / 4;
|
||||
if (length < 0 || length > (streampos) kMaxSize)
|
||||
{
|
||||
cerr << "internal error: bad file length " << length
|
||||
<< " for in-memory stream" << endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// read into memory
|
||||
//
|
||||
vector<char> data (length);
|
||||
instream.read (data.data (), length);
|
||||
if (instream.gcount () != length)
|
||||
{
|
||||
cerr << "internal error: failed to read file " << filename << endl;
|
||||
return true;
|
||||
}
|
||||
return checkOpenEXRFile (
|
||||
data.data (), length, reduceMemory, reduceTime, enableCoreCheck);
|
||||
}
|
||||
else
|
||||
{
|
||||
return checkOpenEXRFile (
|
||||
filename, reduceMemory, reduceTime, enableCoreCheck);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char** argv)
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
usageMessage (cerr, argv[0], false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool reduceMemory = false;
|
||||
bool reduceTime = false;
|
||||
bool enableCoreCheck = false;
|
||||
bool badFileFound = false;
|
||||
bool useStream = false;
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
if (!strcmp (argv[i], "-h") || !strcmp (argv[i], "--help"))
|
||||
{
|
||||
usageMessage (cout, "exrcheck", true);
|
||||
return 0;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-m"))
|
||||
{
|
||||
//
|
||||
// note for further memory reduction, calls to the following could be added here
|
||||
// CompositeDeepScanLine::setMaximumSampleCount();
|
||||
// Header::setMaxImageSize();
|
||||
// Header::setMaxTileSize();
|
||||
|
||||
reduceMemory = true;
|
||||
|
||||
}
|
||||
else if (!strcmp (argv[i], "-t"))
|
||||
{
|
||||
reduceTime = true;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-s"))
|
||||
{
|
||||
useStream = true;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-c"))
|
||||
{
|
||||
enableCoreCheck = true;
|
||||
}
|
||||
else if (!strcmp (argv[i], "--version"))
|
||||
{
|
||||
const char* libraryVersion = getLibraryVersion();
|
||||
|
||||
cout << "exrcheck (OpenEXR) " << OPENEXR_VERSION_STRING;
|
||||
if (strcmp(libraryVersion, OPENEXR_VERSION_STRING))
|
||||
cout << "(OpenEXR version " << libraryVersion << ")";
|
||||
cout << " https://openexr.com" << endl;
|
||||
cout << "Copyright (c) Contributors to the OpenEXR Project" << endl;
|
||||
cout << "License BSD-3-Clause" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#if defined _WIN32 || defined _WIN64
|
||||
if (_access (argv[i], 4) != 0)
|
||||
#else
|
||||
if (access (argv[i], R_OK) != 0)
|
||||
#endif
|
||||
{
|
||||
cerr << "No such file: " << argv[i] << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
cout << " file " << argv[i] << ' ';
|
||||
cout.flush ();
|
||||
|
||||
bool hasError = exrCheck (
|
||||
argv[i], reduceMemory, reduceTime, useStream, enableCoreCheck);
|
||||
if (hasError)
|
||||
{
|
||||
cout << "bad\n";
|
||||
badFileFound = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "OK\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return badFileFound;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
add_executable( exrenvmap
|
||||
blurImage.cpp
|
||||
blurImage.h
|
||||
EnvmapImage.cpp
|
||||
EnvmapImage.h
|
||||
main.cpp
|
||||
makeCubeMap.cpp
|
||||
makeCubeMap.h
|
||||
makeLatLongMap.cpp
|
||||
makeLatLongMap.h
|
||||
namespaceAlias.h
|
||||
readInputImage.cpp
|
||||
readInputImage.h
|
||||
resizeImage.cpp
|
||||
resizeImage.h
|
||||
)
|
||||
|
||||
target_link_libraries(exrenvmap OpenEXR::OpenEXR)
|
||||
set_target_properties(exrenvmap PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
if(OPENEXR_INSTALL_TOOLS)
|
||||
install(TARGETS exrenvmap DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(exrenvmap PRIVATE OPENEXR_DLL)
|
||||
endif()
|
||||
@@ -1,234 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// class EnvmapImage
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "EnvmapImage.h"
|
||||
#include <ImathFun.h>
|
||||
|
||||
#include "namespaceAlias.h"
|
||||
using namespace IMF;
|
||||
using namespace IMATH;
|
||||
|
||||
EnvmapImage::EnvmapImage ()
|
||||
: _type (ENVMAP_LATLONG)
|
||||
, _dataWindow (V2i (0, 0), V2i (0, 0))
|
||||
, _pixels (1, 1)
|
||||
{
|
||||
clear ();
|
||||
}
|
||||
|
||||
EnvmapImage::EnvmapImage (Envmap type, const Box2i& dataWindow)
|
||||
: _type (type)
|
||||
, _dataWindow (dataWindow)
|
||||
, _pixels (
|
||||
dataWindow.max.y - dataWindow.min.y + 1,
|
||||
dataWindow.max.x - dataWindow.min.x + 1)
|
||||
{
|
||||
clear ();
|
||||
}
|
||||
|
||||
void
|
||||
EnvmapImage::resize (Envmap type, const Box2i& dataWindow)
|
||||
{
|
||||
_pixels.resizeEraseUnsafe (
|
||||
dataWindow.max.y - dataWindow.min.y + 1,
|
||||
dataWindow.max.x - dataWindow.min.x + 1);
|
||||
_type = type;
|
||||
_dataWindow = dataWindow;
|
||||
|
||||
clear ();
|
||||
}
|
||||
|
||||
void
|
||||
EnvmapImage::clear ()
|
||||
{
|
||||
int w = _dataWindow.max.x - _dataWindow.min.x + 1;
|
||||
int h = _dataWindow.max.y - _dataWindow.min.y + 1;
|
||||
|
||||
for (int y = 0; y < h; ++y)
|
||||
{
|
||||
for (int x = 0; x < w; ++x)
|
||||
{
|
||||
Rgba& p = _pixels[y][x];
|
||||
|
||||
p.r = 0;
|
||||
p.g = 0;
|
||||
p.b = 0;
|
||||
p.a = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Envmap
|
||||
EnvmapImage::type () const
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
||||
const Box2i&
|
||||
EnvmapImage::dataWindow () const
|
||||
{
|
||||
return _dataWindow;
|
||||
}
|
||||
|
||||
Array2D<Rgba>&
|
||||
EnvmapImage::pixels ()
|
||||
{
|
||||
return _pixels;
|
||||
}
|
||||
|
||||
const Array2D<Rgba>&
|
||||
EnvmapImage::pixels () const
|
||||
{
|
||||
return _pixels;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
V2f
|
||||
dirToPosLatLong (const Box2i& dataWindow, const V3f& dir)
|
||||
{
|
||||
return LatLongMap::pixelPosition (dataWindow, dir);
|
||||
}
|
||||
|
||||
V2f
|
||||
dirToPosCube (const Box2i& dataWindow, const V3f& dir)
|
||||
{
|
||||
CubeMapFace face;
|
||||
V2f posInFace;
|
||||
CubeMap::faceAndPixelPosition (dir, dataWindow, face, posInFace);
|
||||
return CubeMap::pixelPosition (face, dataWindow, posInFace);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Rgba
|
||||
EnvmapImage::filteredLookup (V3f d, float r, int n) const
|
||||
{
|
||||
//
|
||||
// Filtered environment map lookup: Take n by n point samples
|
||||
// from the environment map, clustered around direction d, and
|
||||
// combine the samples with a tent filter.
|
||||
//
|
||||
|
||||
//
|
||||
// Depending on the type of map, pick an appropriate function
|
||||
// to convert 3D directions to 2D pixel poitions.
|
||||
//
|
||||
|
||||
V2f (*dirToPos) (const Box2i&, const V3f&);
|
||||
|
||||
if (_type == ENVMAP_LATLONG)
|
||||
dirToPos = dirToPosLatLong;
|
||||
else
|
||||
dirToPos = dirToPosCube;
|
||||
|
||||
//
|
||||
// Pick two vectors, dx and dy, of length r, that are orthogonal
|
||||
// to the lookup direction, d, and to each other.
|
||||
//
|
||||
|
||||
d.normalize ();
|
||||
V3f dx, dy;
|
||||
|
||||
if (abs (d.x) > 0.707f)
|
||||
dx = (d % V3f (0, 1, 0)).normalized () * r;
|
||||
else
|
||||
dx = (d % V3f (1, 0, 0)).normalized () * r;
|
||||
|
||||
dy = (d % dx).normalized () * r;
|
||||
|
||||
//
|
||||
// Take n by n point samples from the map, and add them up.
|
||||
// The directions for the point samples are all within the pyramid
|
||||
// defined by the vectors d-dy-dx, d-dy+dx, d+dy-dx, d+dy+dx.
|
||||
//
|
||||
|
||||
float wt = 0;
|
||||
|
||||
float cr = 0;
|
||||
float cg = 0;
|
||||
float cb = 0;
|
||||
float ca = 0;
|
||||
|
||||
for (int y = 0; y < n; ++y)
|
||||
{
|
||||
float ry = float (2 * y + 2) / float (n + 1) - 1;
|
||||
float wy = 1 - abs (ry);
|
||||
V3f ddy (ry * dy);
|
||||
|
||||
for (int x = 0; x < n; ++x)
|
||||
{
|
||||
float rx = float (2 * x + 2) / float (n + 1) - 1;
|
||||
float wx = 1 - abs (rx);
|
||||
V3f ddx (rx * dx);
|
||||
|
||||
Rgba s = sample (dirToPos (_dataWindow, d + ddx + ddy));
|
||||
|
||||
float w = wx * wy;
|
||||
wt += w;
|
||||
|
||||
cr += s.r * w;
|
||||
cg += s.g * w;
|
||||
cb += s.b * w;
|
||||
ca += s.a * w;
|
||||
}
|
||||
}
|
||||
|
||||
wt = 1 / wt;
|
||||
|
||||
Rgba c;
|
||||
|
||||
c.r = cr * wt;
|
||||
c.g = cg * wt;
|
||||
c.b = cb * wt;
|
||||
c.a = ca * wt;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
Rgba
|
||||
EnvmapImage::sample (const V2f& pos) const
|
||||
{
|
||||
//
|
||||
// Point-sample the environment map image at 2D position pos.
|
||||
// Interpolate bilinearly between the four nearest pixels.
|
||||
//
|
||||
|
||||
int x1 = IMATH::floor (pos.x);
|
||||
int x2 = x1 + 1;
|
||||
float sx = x2 - pos.x;
|
||||
float tx = 1 - sx;
|
||||
|
||||
x1 = clamp (x1, _dataWindow.min.x, _dataWindow.max.x) - _dataWindow.min.x;
|
||||
x2 = clamp (x2, _dataWindow.min.x, _dataWindow.max.x) - _dataWindow.min.x;
|
||||
|
||||
int y1 = IMATH::floor (pos.y);
|
||||
int y2 = y1 + 1;
|
||||
float sy = y2 - pos.y;
|
||||
float ty = 1 - sy;
|
||||
|
||||
y1 = clamp (y1, _dataWindow.min.y, _dataWindow.max.y) - _dataWindow.min.y;
|
||||
y2 = clamp (y2, _dataWindow.min.y, _dataWindow.max.y) - _dataWindow.min.y;
|
||||
|
||||
Rgba p11 = _pixels[y1][x1];
|
||||
Rgba p12 = _pixels[y1][x2];
|
||||
Rgba p21 = _pixels[y2][x1];
|
||||
Rgba p22 = _pixels[y2][x2];
|
||||
|
||||
Rgba p;
|
||||
p.r = (p11.r * sx + p12.r * tx) * sy + (p21.r * sx + p22.r * tx) * ty;
|
||||
p.g = (p11.g * sx + p12.g * tx) * sy + (p21.g * sx + p22.g * tx) * ty;
|
||||
p.b = (p11.b * sx + p12.b * tx) * sy + (p21.b * sx + p22.b * tx) * ty;
|
||||
p.a = (p11.a * sx + p12.a * tx) * sy + (p21.a * sx + p22.a * tx) * ty;
|
||||
|
||||
return p;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) Contributors to the OpenEXR Project.
|
||||
//
|
||||
|
||||
#ifndef INCLUDED_ENVMAP_IMAGE_H
|
||||
#define INCLUDED_ENVMAP_IMAGE_H
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// class EnvmapImage
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "namespaceAlias.h"
|
||||
|
||||
#include <ImathBox.h>
|
||||
#include <ImfArray.h>
|
||||
#include <ImfEnvmap.h>
|
||||
#include <ImfRgba.h>
|
||||
|
||||
class EnvmapImage
|
||||
{
|
||||
public:
|
||||
EnvmapImage ();
|
||||
EnvmapImage (IMF::Envmap type, const IMATH::Box2i& dataWindow);
|
||||
|
||||
void resize (IMF::Envmap type, const IMATH::Box2i& dataWindow);
|
||||
|
||||
void clear ();
|
||||
|
||||
IMF::Envmap type () const;
|
||||
const IMATH::Box2i& dataWindow () const;
|
||||
|
||||
IMF::Array2D<IMF::Rgba>& pixels ();
|
||||
const IMF::Array2D<IMF::Rgba>& pixels () const;
|
||||
|
||||
IMF::Rgba
|
||||
filteredLookup (IMATH::V3f direction, float radius, int numSamples) const;
|
||||
|
||||
private:
|
||||
IMF::Rgba sample (const IMATH::V2f& pos) const;
|
||||
|
||||
IMF::Envmap _type;
|
||||
IMATH::Box2i _dataWindow;
|
||||
IMF::Array2D<IMF::Rgba> _pixels;
|
||||
};
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user