Compare commits

...
728 Commits
Author SHA1 Message Date
Cary PhillipsandClaude Sonnet 4.6 606394eb6f Fix broken links identified in ASWF Health Check 2026 (#2549)
README.md: CODE_OF_CONDUCT → CODE_OF_CONDUCT.md
CONTRIBUTING.md:
  - website/requirements.txtg → website/requirements.txt
  - #Creating-a-Major/Minor-Release → #creating-a-majorminor-release
  - #required-approvals → #code-review-and-required-approvals

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 20:22:39 -07:00
Cary PhillipsandClaude Sonnet 4.6 b2ed287077 Fix missing INT_MAX cap on deep scanline sample_count_table_size (#2535)
ddata[1] (packed_size) and ddata[2] (unpacked_size) both had
'< 0 || > INT_MAX' guards, but ddata[0] (sample_count_table_size)
only had '< 0'. A value > INT_MAX stored in the uint64_t field then
gets truncated to size_t on ILP32, causing an undersized allocation
followed by a heap overflow when exr_read_deep_chunk writes the full
64-bit byte count into it.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-m5cq-cx25-qw53

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 08:38:00 -07:00
Cary PhillipsandCursor 55888dbd69 Reject oversized exrmetrics vector allocations on ILP32 (#2539)
exrmetrics computed image buffer sizes as uint64_t but passed them to
std::vector::resize(size_type), which silently truncates on 32-bit
builds and left decode writing past undersized channel and sample-count
buffers.

Validate count and size to confirm the cast to size_t does not overflow.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-r8mj-rhfc-38g4
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-pgc2-hppj-q623
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-g5m8-8w79-34q8
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-xc77-xm9h-qxm4

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:13:58 -07:00
Cary PhillipsandCursor 04c52e7371 Reject oversized Array2D allocations on ILP32 (#2540)
Array2D computed sizeX * sizeY in 32-bit arithmetic before new[].
On ILP32, a 65537 x 65537 allocation wraps to a tiny buffer while
decode still writes the full image.

Validate the element count in uint64_t and reject dimensions whose
product exceeds size_t before constructing or resizing Array2D.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-h56j-j82x-w3fp

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-wrw5-mm52-r3h8

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:13:29 -07:00
Cary PhillipsandCursor c33a00625a Reject oversized channelstore allocations in exrmultipart convert (#2541)
The convert path computed pixel_count as int64_t but passed
samplesize * pixel_count to std::vector::resize(size_type), which
truncates on ILP32 and left readPixels() writing past the buffer.

Validate the size fits in size_t before resizing channelstore.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-r24r-74rc-588f

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:13:03 -07:00
Cary PhillipsandCursor 783b654273 Reject short zlib inflates before pixel unpack. (#2547)
DWA UNKNOWN: pass actual_out to exr_uncompress_buffer() and require the
inflated byte count to match UNKNOWN_UNCOMPRESSED_SIZE before copying
planar data to output rows.

ZIP/ZIPS: require actual_out_bytes to equal the expected uncompressed
chunk size before reconstructing and unpacking pixels.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-38j8-88v6-jrm7

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-r864-gwqv-q2hp

Signed-off-by: Cary Phillips <seabeepea@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:12:29 -07:00
Cary PhillipsandCursor c07a0f1ee6 Reject NO_COMPRESSION scanline chunks with short packed size. (#2548)
Mirror the existing tile-path check in exr_read_scanline_chunk_info():
for EXR_COMPRESSION_NONE, require packed_size to equal unpacked_size
before decode allocates an unpack buffer that no decompressor fills.

Covers flat and deep scanline chunk leaders.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-7hgm-jxjc-6hgg

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-fwhm-jj7c-mx7v

Signed-off-by: Cary Phillips <seabeepea@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:11:54 -07:00
Kimball ThurstonandCary Phillips d684e45828 Add check to avoid overflow, add tests for reading / writing many channels (#2525)
Signed-off-by: Kimball Thurston <kthurston@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-13 13:57:05 -07:00
Cary PhillipsandCursor 1dd2da169c Fix exrmultiview heap OOB when union dataWindow misaligns with subsampling (#2530)
* Fix exrmultiview heap OOB when union dataWindow misaligns with subsampling

Validate the combined data window against each input channel's x/y
subsampling before allocating pixel buffers or calling readPixels,
matching ImfHeader checks. Reject misaligned unions with ArgExc instead
of reading past undersized buffers.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-gjf7-wjjw-xq56

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Reject all input with sampling != 1

Subsampling is rare, and exrmultiview not commonly used, so this
solution seems cleaner: just don't handle subsampling at all.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 13:54:47 -07:00
dependabot[bot]andCary Phillips a3ea48ac99 Bump rules_cc from 0.2.20 to 0.2.22 (#2538)
Bumps [rules_cc](https://github.com/bazelbuild/rules_cc) from 0.2.20 to 0.2.22.
- [Release notes](https://github.com/bazelbuild/rules_cc/releases)
- [Commits](https://github.com/bazelbuild/rules_cc/compare/0.2.20...0.2.22)

---
updated-dependencies:
- dependency-name: rules_cc
  dependency-version: 0.2.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-10 21:38:36 -07:00
dependabot[bot] 2d87209886 Bump the codeql group with 3 updates (#2537)
Bumps the codeql group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.36.3 to 4.37.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9)

Updates `github/codeql-action/analyze` from 4.36.3 to 4.37.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9)

Updates `github/codeql-action/upload-sarif` from 4.36.3 to 4.37.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-10 21:37:58 -07:00
Cary PhillipsandCursor 13c2b46686 Group CodeQL GitHub Actions bumps in Dependabot. (#2523)
Keep init, analyze, and upload-sarif on the same version so partial
updates do not break the CodeQL workflow with a version mismatch.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 18:36:37 -07:00
Cary PhillipsandCursor c7ba227885 Fix exrmetrics heap OOB on subsampled scanlines (#2528)
initScanLine() adjusted Slice base pointers using full pixel-space
origin offsets, but OpenEXR addresses subsampled channels with
origin.x / xSampling and origin.y / ySampling. Use Slice::Make()
so the base pointer matches the library's coordinate math.

Fixes https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-7h7v-98cr-8ppw

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 13:16:39 -07:00
Cary PhillipsandCursor d2ccc0b5ce Upgrade all manylinux cibuildwheel images to manylinux_2_28 (#2527)
NumPy 2.5+ no longer ships manylinux_2_17 wheels and requires
GCC >= 10.3 when building from source. The manylinux2014
containers only provides GCC 10.2.1, so cibuildwheel's test phase fails
when pip cannot install numpy.

Use manylinux_2_28 for aarch64, x86_64, and i686 builds (GCC 11, glibc
2.28), which has compatible pre-built numpy wheels and satisfies the
compiler requirement.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 18:53:12 -07:00
Cary PhillipsandClaude Sonnet 4.6 36ff0968de Fix name comparison in deep prefixed RGB channel coalescing (#2522)
setDeepSliceData() used strcmp(c.name(), "G"/"B"/"A") to select the
RGB channel offset, which only matched unprefixed channel names. For
layer-prefixed channels like left.G and left.B the comparison failed,
leaving channels 1 and 2 pointing at their initial (stale heap) data
while channel 0 received all decoded samples.

Fix: check only the final character of the channel name, consistent
with how channelNameToRGBA() already identifies the channel suffix.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-pf59-r2mc-x746

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 16:44:30 -07:00
dependabot[bot]andCary Phillips 6f099ab35d Bump github/codeql-action/analyze from 4.36.2 to 4.36.3 (#2519)
Bumps [github/codeql-action/analyze](https://github.com/github/codeql-action) from 4.36.2 to 4.36.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a)

---
updated-dependencies:
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-03 20:37:53 -07:00
dependabot[bot]andCary Phillips 4838d0e0dc Bump github/codeql-action/upload-sarif from 4.36.2 to 4.36.3 (#2520)
Bumps [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) from 4.36.2 to 4.36.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a)

---
updated-dependencies:
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-03 20:37:22 -07:00
dependabot[bot]andCary Phillips c949d3aded Bump github/codeql-action/init from 4.36.2 to 4.36.3 (#2521)
Bumps [github/codeql-action/init](https://github.com/github/codeql-action) from 4.36.2 to 4.36.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-03 20:36:54 -07:00
Cary Phillips a1cf86438f Update security policy regarding CVE requests (#2512)
* Update security policy regarding CVE requests

Clarify the conditions under which we will/won't request CVEs.

Signed-off-by: Cary Phillips <cary@ilm.com>

* update policy on tool bugs

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove confusing statement

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-07-03 20:28:57 -07:00
dependabot[bot]andCary Phillips 47213f2acd Bump actions/cache from 6.0.0 to 6.1.0 (#2514)
Bumps [actions/cache](https://github.com/actions/cache) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/2c8a9bd7457de244a408f35966fab2fb45fda9c8...55cc8345863c7cc4c66a329aec7e433d2d1c52a9)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-03 20:12:10 -07:00
dependabot[bot]andCary Phillips 0c28bc31fe Bump vmactions/freebsd-vm from 1.4.8 to 1.5.0 (#2513)
Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.4.8 to 1.5.0.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](https://github.com/vmactions/freebsd-vm/compare/b84ab5559b5a1bb4b8ee2737d2506a16e1737636...5a72679103d223925653750faa878a143340fbd0)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-version: 1.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-03 20:11:43 -07:00
AutoJanitorandCary Phillips e198e44cea Core: byte-swap the float vector data, not the attribute struct (#2510)
extract_attr_float_vector reads the float array into attrdata->arr, then
called priv_to_native32(attrdata, n). On big-endian hosts that swaps the
first n 32-bit words of the exr_attr_float_vector_t struct itself (the
arr pointer and length) instead of the n floats in attrdata->arr. The
corrupted pointer and length then crash when the value is read back, for
example a std::bad_alloc or segfault while constructing the FloatVector
in the C++ Context::header path.

Swap attrdata->arr instead. priv_to_native32 is a no-op on little-endian,
so x86_64 and ppc64le are unaffected.

Verified on POWER8: OpenEXR.testAttributes segfaults on big-endian ppc64
before this change and passes after.

Signed-off-by: Scott Boudreaux <121303252+Scottcjn@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-07-03 20:08:21 -07:00
Cary PhillipsandCursor 4aa1b60925 Reject mixed pixel types when coalescing RGB channels in PyOpenEXR. (#2502)
Deep and flat reads with separate_channels=False assumed all coalesced
R/G/B channels share one PixelType, which could undersize NumPy buffers
and cause heap corruption on decode. Validate types before reading and
propagate invalid_argument to Python; add regression tests.

For example, if the file has left.R, left.G, left.B, it's an error to
request an RGB pixel array if "left.R" is FLOAT and "left.G" is HALF.
However, it's OK for all "left" channels to be FLOAT and all "right" channels
to be HALF.

Note also that attempting to combine mixed-type channels causes a
failure to read the entire file, whereas other read errors simply skip
the offending part. This is reasonable behavior since the condition is
not a defect in the data itself, but simply an inability to return the
data in the format the user requested.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-994f-rr2m-9r7x

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 19:29:26 -07:00
Cary PhillipsandClaude Sonnet 4.6 3a4214aa73 Fix ILP32 B44/B44A scratch buffer overflow in decode (#2491)
compute_scratch_buffer_size() returns uint64_t, but
internal_decode_alloc_buffer() takes size_t. On ILP32 builds the
implicit conversion silently truncates scratch sizes above 4 GiB,
causing uncompress_b44_impl() to write far past the undersized
allocation using the attacker-controlled channel width.

Add an explicit truncation check before both the B44 and B44A scratch
buffer allocations: if the required size exceeds SIZE_MAX, return
EXR_ERR_OUT_OF_MEMORY rather than allocating a truncated buffer.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-92pq-9qv4-g68q

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 19:26:44 -07:00
dependabot[bot]andCary Phillips 96fc617cf2 Bump rules_cc from 0.2.19 to 0.2.20 (#2511)
Bumps [rules_cc](https://github.com/bazelbuild/rules_cc) from 0.2.19 to 0.2.20.
- [Release notes](https://github.com/bazelbuild/rules_cc/releases)
- [Commits](https://github.com/bazelbuild/rules_cc/compare/0.2.19...0.2.20)

---
updated-dependencies:
- dependency-name: rules_cc
  dependency-version: 0.2.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-28 20:19:26 -07:00
dependabot[bot]andCary Phillips 19241b90a8 Bump actions/cache from 5.0.5 to 6.0.0 (#2506)
Bumps [actions/cache](https://github.com/actions/cache) from 5.0.5 to 6.0.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/27d5ce7f107fe9357f9df03efb73ab90386fccae...2c8a9bd7457de244a408f35966fab2fb45fda9c8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-28 20:18:30 -07:00
dependabot[bot]andCary Phillips c5ce57d2f7 Bump actions/setup-python from 6.2.0 to 6.3.0 (#2505)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/a309ff8b426b58ec0e2a45f0f869d46889d02405...ece7cb06caefa5fff74198d8649806c4678c61a1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-28 20:18:03 -07:00
peterhillmanandCary Phillips 6494bbc701 fix --help message in exrmetrics (#2504)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-28 20:17:03 -07:00
peterhillmanandCary Phillips 020fced558 prevent warning of potential double-free in ImfTiledMisc (#2503)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-28 20:15:59 -07:00
Cary Phillips f498987dc4 Update SECURITY.md with CVE fixes from v3.4.12 and 3.4.13 (#2501)
Signed-off-by: Cary Phillips <cary@ilm.com>
2026-06-28 20:14:29 -07:00
Cary PhillipsandPeter Hillman 54aa30299c Release notes and news for v3.4.13, v3.3.12, and v3.2.10 (#2497)
* Changes for v3.14.13

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* update notes with additional PRs

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add 2479 to notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix duplicate 3.4.13 security references

Signed-off-by: Cary Phillips <cary@ilm.com>

* 3.4.13 news

Signed-off-by: Cary Phillips <cary@ilm.com>

* update changes for v3.3.12

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* update CHANGES for 3.2.10

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* news & notes for 3.3 and 3.2

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix links

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Peter Hillman <peterh@wetafx.co.nz>
2026-06-28 20:13:45 -07:00
Cary Phillips 6820342930 Fix Name::operator= to null-terminate long strings (#2500)
Name::operator= leaves the string without a terminating null if the
string is longer than MAX_LENGTH. Write a null to ensure there is one.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-06-23 15:24:29 -07:00
Cary PhillipsandCursor 3f6e92b28e Reject NULL channel list entries in exr_attr_chlist_duplicate() (#2473)
Validate num_channels > 0 with entries == NULL before pointer
arithmetic, covering exr_set_channels() and exr_attr_set_channels().

Also, refactor exr_attr_set_channels to call exr_attr_chlist_duplicate()
since it does the same work.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-mqmw-xv8w-5jh4

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 15:23:56 -07:00
Cary PhillipsandCursor 148400460f Reject NULL preview rgba data in exr_attr_set_preview() (#2469)
Validate the source rgba pointer before memcpy in
exr_attr_preview_create() and the same-dimensions update path in
exr_attr_set_preview(), preventing a NULL pointer dereference when
nonzero preview dimensions are supplied without pixel data.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 15:22:41 -07:00
Cary PhillipsandClaude Sonnet 4.6 d9de1caaa6 Fix integer overflow in Array2D::resizeErase() on ILP32/LLP64 builds (#2486)
* Fix integer overflow in Array2D::resizeErase() on ILP32/LLP64 builds

sizeX * sizeY used long arithmetic, which is 32 bits on ILP32 (32-bit
Linux) and on Windows (MSVC LLP64). A tile size of 65537x65537 overflows
to a small positive value, causing new[] to under-allocate and subsequent
tile decoding to write past the buffer.

Cast both operands to size_t before multiplying so the allocation is
always correct regardless of the width of long.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-f667-c4wm-c8gq

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* validate non-negative sizes

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 20:36:19 -07:00
peterhillmanandCary Phillips 8ce07f00fd Avoid memory allocation in idmanifest parsing (#2498)
* Avoid memory allocation in idmanifest parsing

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* check for negative string count, fix table size count

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-22 19:49:21 -07:00
Cary PhillipsandCursor b216124e53 Fix empty multiView crash in viewFromChannelName() (#2496)
Dotless channel names used multiView[0] without checking for an empty
vector. Use defaultViewName() so malformed files return "" instead of
OOB access.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-g8f2-r72m-48vx

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 17:48:16 -07:00
Cary PhillipsandClaude Sonnet 4.6 592a1eecf6 Fix ILP32 deep sample-count table size overflow in decoding (#2492)
In update_pack_unpack_ptrs(), sampsize was computed as size_t, so on
ILP32 builds a tile with width*height >= 2^30 wraps to zero (or four
with the INDIVIDUAL flag), causing the sample-count table to be
allocated too small and unpack_sample_table() to read far past it.

Compute the size in uint64_t, check for truncation before converting
to size_t, and return EXR_ERR_OUT_OF_MEMORY if the required size
exceeds SIZE_MAX.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-p42q-g5c9-mh9w

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 17:47:47 -07:00
dependabot[bot]andCary Phillips d66348eaa3 Bump actions/checkout from 6.0.3 to 7.0.0 (#2481)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-22 06:26:51 -07:00
Cary PhillipsandClaude Sonnet 4.6 9ae8905b00 Fix signed integer overflow in unpack_sample_table() (#2484)
* Fix signed integer overflow in unpack_sample_table()

Declare w and h as int64_t instead of int32_t so that index
arithmetic y*w and w*h in unpack_sample_table() does not overflow
when tile dimensions are large (e.g. 46342x46342).

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-rqp5-pmwm-wj6x

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* declare y as int64_t

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 06:25:03 -07:00
Cary PhillipsandClaude Sonnet 4.6 b78496b324 Fix ILP32 unpacked buffer size truncation in RLE decode (#2493)
In update_pack_unpack_ptrs(), decode->chunk.unpacked_size is uint64_t
but was passed directly to internal_decode_alloc_buffer() which takes
size_t. On ILP32 builds a crafted chunk with unpacked_size > 4 GiB
silently truncates, allocating a tiny buffer while the decompressor
and unpacker iterate over the full declared channel width, causing an
out-of-bounds read.

Add a truncation check before the allocation and return
EXR_ERR_OUT_OF_MEMORY if unpacked_size exceeds SIZE_MAX.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-v6v5-344m-64vm

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 06:23:43 -07:00
Cary PhillipsandCursor d4c767c86b Reject oversized DWAA buffer allocations on ILP32 (#2494)
Check packed AC/DC and RLE buffer sizes against SIZE_MAX before calling
alloc_fn(size_t). Without this, uint64_t sizes above 4 GiB truncate on
32-bit builds while later DWAA decode logic still uses the full size,
leading to heap corruption during AC inflate.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-6662-fq6f-93mp

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 06:23:09 -07:00
dependabot[bot] 492edbfcad Bump vmactions/freebsd-vm from 1.4.6 to 1.4.8 (#2495)
Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.4.6 to 1.4.8.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](https://github.com/vmactions/freebsd-vm/compare/a6de9343ef5747433d9c25784c90e84998b9d69a...b84ab5559b5a1bb4b8ee2737d2506a16e1737636)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-version: 1.4.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-22 06:22:35 -07:00
Cary PhillipsandClaude Sonnet 4.6 4eaf1a9f34 Fix deep pixelmode heap buffer overflow in exrmetrics (#2487)
When --pixelmode float (or --bench) is used, outHeader channels are
rewritten from the input type (e.g. HALF) to FLOAT.  The DeepSlice
framebuffer entries were already built from outHeader, requesting 4-byte
FLOAT writes.  However, the sample data buffers were allocated using the
*input* header's channel types (2 bytes for HALF), so readPixels() wrote
4-byte values into 2-byte buffers — a heap buffer overflow.

Fix: allocate sampleData using outHeader.channels() (the output/requested
type) so that buffer sizes match the per-sample write size.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-6jj8-cxcr-j8hm

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 14:40:22 -07:00
Cary PhillipsandCursor 1d5882b07a Fix OpenEXRUtil row() OOB read with non-zero data window origin (#2488)
The row() method in TypedDeepImageChannel, TypedFlatImageChannel, and
SampleCountChannel is documented as 0-based within the data window,
but used the _base offset meant for absolute (x, y) access. Index the
compact backing arrays instead so row(0) aliases the first pixel when
dataWindow.min is non-zero.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-hwmv-39v6-739m

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 14:39:47 -07:00
Cary PhillipsandCursor d7d4158694 Reject negative pixelDataSize in rawPixelDataToBuffer() (#2490)
A negative int cast to uint64_t bypassed the buffer size check and
allowed exr_read_chunk() to write past a caller buffer.

Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-gjpj-qv64-vwhf

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 14:39:05 -07:00
Cary PhillipsandClaude Sonnet 4.6 71bcf5cf44 Fix CI-old workflow failure due to Node 24 on old VFX platform containers (#2483)
GitHub Actions deprecated Node 20 and now forces Node 24 by default,
which requires glibc >= 2.25. The VFX 2021/2022 containers are CentOS
7 (glibc 2.17) and can't run Node 24, breaking the checkout step.

Set ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true to allow the runner
to use the Node 20 glibc-2.17 build installed in /node20217, which
is the existing workaround for these old containers.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 18:57:59 -07:00
Cary Phillips 545c9a782e Split macOS wheel arches across CI runners (#2479)
Both macOS matrix jobs previously built x86_64, arm64, and universal2,
producing duplicate wheel filenames. Prior to #2433, the workflow
downloaded each built wheel in succession, which would cause the
duplicate wheel to overwrite the original, but it avoided an
error. The new merge-multiple in the publish job corrupt the
files, causing TestPyPI uploads to fail with "Mis-matched data size".

This change builds x86_64 and universal2 on macos-15-intel and arm64
on macos-latest so merged artifacts have unique names.

This also adds a validation step to the python-wheels.yml workflow to
ensure the wheels have the expected structure.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-06-17 18:00:21 -07:00
Cary PhillipsandCursor 7f3ffb87e5 Unlock write context in exr_get_chunk_table_offset() return paths (#2472)
EXR_LOCK_WRITE_AND_DEFINE_PART() acquires the mutex on write contexts
but both success and error returns leaked the lock, deadlocking later
API calls such as exr_get_count().

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 08:27:12 -07:00
dependabot[bot]andCary Phillips 1ac9a7b02e Bump pypa/cibuildwheel from 3.4.1 to 4.1.0 (#2475)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.4.1 to 4.1.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/8d2b08b68458a16aeb24b64e68a09ab1c8e82084...294735312765b09d24a2fbec22660ce817587d55)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-17 08:25:13 -07:00
vlazar-ilm bc7fc07c2d Fix the DWAA size checks (#2476) 2026-06-16 21:12:09 -07:00
Cary Phillips 3794a165d3 Drop support for Python 3.8 (#2477)
3.8 was never actually included in any vfx reference platform year,
and the platform has been at Python 3.9+ since CY2022. And
cibuildwheel 4.0 drops support for 3.8.

This will take effect in OpenEXR v3.5.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-06-16 19:40:27 -07:00
Cary PhillipsandCursor 808e2eb25e Reject NULL bytes type_hint and data in exr_attr_bytes_create() (#2470)
Validate non-null pointers when hint length or data size is non-zero,
and apply the same checks in the in-place exr_attr_set_bytes() path.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 19:39:52 -07:00
Cary PhillipsandCursor c064306b7e Fix infinite loop in SampleCountChannel roundListSizeUp() (#2468)
Reject sample counts above 0x80000000 before rounding up to the next
power of two, since larger values cause the unsigned shift loop to wrap
and never terminate.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 19:37:06 -07:00
dependabot[bot] 176c97870c Bump msys2/setup-msys2 from 2.31.1 to 2.32.0 (#2474)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.31.1 to 2.32.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/e9898307ac31d1a803454791be09ab9973336e1c...66cd2cce69caa17b53920067426061ca1de3a884)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-15 20:02:08 -07:00
Cary Phillips 0565c021ae Add section on CVE Assignment to SECURITY.md (#2471) 2026-06-12 18:18:29 -07:00
dependabot[bot] 5d799be5fa Bump sigstore/gh-action-sigstore-python from 3.3.0 to 3.4.0 (#2467)
Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases)
- [Changelog](https://github.com/sigstore/gh-action-sigstore-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/04cffa1d795717b140764e8b640de88853c92acc...5b79a39c381910c090341a2c9b0bf022c8b387e1)

---
updated-dependencies:
- dependency-name: sigstore/gh-action-sigstore-python
  dependency-version: 3.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-11 21:52:48 -07:00
Cary Phillips 316993443b Fix install manifest for linux build 13 (#2466)
The hard-coded 4_0 release number in the new install manifest should
have been converted to a symbolic value.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-06-12 14:52:48 +12:00
dependabot[bot]andCary Phillips b25f9dc9af Update idna requirement from >=3.17 to >=3.18 in /website (#2462)
Updates the requirements on [idna](https://github.com/kjd/idna) to permit the latest version.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](https://github.com/kjd/idna/compare/v3.17...v3.18)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.18'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-10 07:58:39 -07:00
dependabot[bot]andCary Phillips 0e0f026f92 Bump rules_cc from 0.2.18 to 0.2.19 (#2460)
Bumps [rules_cc](https://github.com/bazelbuild/rules_cc) from 0.2.18 to 0.2.19.
- [Release notes](https://github.com/bazelbuild/rules_cc/releases)
- [Commits](https://github.com/bazelbuild/rules_cc/compare/0.2.18...0.2.19)

---
updated-dependencies:
- dependency-name: rules_cc
  dependency-version: 0.2.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-10 07:57:58 -07:00
dependabot[bot]andCary Phillips accb48b2bc Bump actions/checkout from 6.0.2 to 6.0.3 (#2455)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-10 07:57:10 -07:00
Cary PhillipsandCursor c89008ed31 Initialize B44 tables before B44A decode (#2451)
`internal_exr_undo_b44a()` was missing `exrcore_ensure_b44_tables()`, so
decode-only paths produced empty output. Add the call to mirror
`internal_exr_undo_b44()`.

Addresses #2447

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 07:56:12 -07:00
Cary Phillips 0b04579431 Fix heap out-of-bounds write in SampleCountChannel row setter. (#2464) 2026-06-09 13:16:40 -07:00
Cary Phillips 2433938030 Fix integer overflow and invalid delete in OpenEXRUtil Image::resize() (#2463) 2026-06-09 13:16:14 -07:00
dependabot[bot]andCary Phillips e9133442dd Bump github/codeql-action from 4.36.0 to 4.36.2 (#2459)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.0 to 4.36.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/7211b7c8077ea37d8641b6271f6a365a22a5fbfa...8aad20d150bbac5944a9f9d289da16a4b0d87c1e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-06 17:23:49 -07:00
IjayandCary Phillips 304d9b8c2f Add required includes to website examples (#2428)
* Add required includes to website examples

Signed-off-by: Ijeoma Igboagu <ijeonyi@gmail.com>

* Fix Iex namespace usage in website example

Signed-off-by: Ijeoma Igboagu <ijeonyi@gmail.com>

* Refactor website example includes

Signed-off-by: Ijeoma Igboagu <ijeonyi@gmail.com>

* Address review feedback

Signed-off-by: Ijeoma Igboagu <ijeonyi@gmail.com>

---------

Signed-off-by: Ijeoma Igboagu <ijeonyi@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-06 12:31:32 -07:00
Cary PhillipsandCursor fb638dd072 Fix bundled OpenJPH for static and shared OpenEXRCore builds (#2444)
When a static build of OpenEXR uses the vendered version of OpenJPH,
the cmake config still reports a dependency on OpenJPH, so downstream
applications attempthing to configure against OpenEXR can fail with a
missing OpenJPH dependency where none should exist.

Solution: build the vendored OpenJPH as an OBJECT librry and pull its
object files into OpenEXRCore via `target_sources(... PRIVATE
$<TARGET_OBJECTS:openjph>)`. This removes OpenJPH as a dependent
library altogether, for both shared and static builds. Note this
applies only to th vendored version of OpenJPH, where the intention is
to hide any external dependency.

CMake:

- `OpenEXRSetup.cmake`: add `OPENEXR_USE_INTERNAL_OPENJPH` (0/1 internal
  cache) set when the internal tree is used.

- `OpenEXRConfig.cmake.in`: call `find_dependency(openjph)` only when
  `OPENEXR_USE_INTERNAL_OPENJPH` is false.

Vendored OpenJPH tree:

- `OJPH_INSTALL` option wraps `install(EXPORT)`, `pkg-config`, and
  target/header install so OpenEXR builds with vendored OpenJPH can
  disable all OpenJPH installation steps.

- `OJPH_LIB_TYPE` defaults to `STATIC` but OpenEXRCore forces it to
  `OBJECT`.  bundling; vendor script can reapply STATIC on refresh.

OpenEXRCore:

- Force `OJPH_INSTALL OFF`, `OJPH_LIB_TYPE` to `OBJECT`

- Replace `PRIVATE` link to openjph with `TARGET_OBJECTS` and optional
  INTERFACE compile definitions from openjph.

vendor_openjph.sh:

- Document and reapply OpenEXR patches on vendor code update: remove
  `BUILD_SHARED_LIBS` option, add `OJPH_INSTALL` and `OJPH_LIB_TYPE`, wrap
  install blocks with `if (OJPH_INSTALL)`.

Also adds a CI test to validate the static build w/vendored OpenJPH.

Addresses #2439

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 12:16:22 -07:00
Cary Phillips e17068d5c2 Tighten python publish workflow security/efficiency (#2433)
* Tighten python publish workflow security/efficiency

- Add concurrency control to prevent accidental overlapping publishes
- Add guard to ensure the publish happens only from RB-* release
  branch (not acc identally from main)
- Remove unnecessary top level "environment:"
- Specify top level "contents" read permission
- Remove unnecessary top level "id-token: write" permission
- Install Python only on ubuntu where it's needed for sdist
- Pin pipx build=1.2.2
- Remove CIBW_TEST_SKIP that duplicatest pyproject.toml setting
- Specify job-level "contents/actions" read permission
- Avoid duplicate wheel artifact downloads

Signed-off-by: Cary Phillips <cary@ilm.com>

* Replace "${{ github.ref_name }}" with "$REF_NAME"

and github.event_name with EVENTNAME.

Functionality is the same, but it makes checking syntax with tools
like actionlint easier.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-06-06 12:15:08 -07:00
Moira Shooter 18ceae7022 Add Python bindings for idManifest (IDManifest) header attribute (#2432)
* Expose IDManifest and ChannelGroupManifest in the PyOpenEXR module so Python can read and write the compressed idManifest header attribute.
- Decode IDManifestAttribute on read; encode IDManifest on write
- Bind ChannelGroupManifest (insert, find, erase, merge, << chaining)
- Add test_id_manifest.py and manifest_id.exr

Signed-off-by: Moira Shooter <mshooter@ilm.com>

* fix python3.11 window crash idmanifest iter binding

Signed-off-by: Moira Shooter <mshooter@ilm.com>

* vector reallocation could invalidate ChannelGroupManifest& values returned
from add() when another group was appended. That showed up in Python tests
on macOS and affects any C++ code that keeps those references.

Also simplify test_id_manifest.py

Signed-off-by: Moira Shooter <mshooter@ilm.com>

---------

Signed-off-by: Moira Shooter <mshooter@ilm.com>
2026-06-03 14:49:43 -07:00
Moira ShooterandCary Phillips 7f688f9be6 Imf: Use std::deque for IDManifest storage to keep references stable (#2453)
While working on the new Python bindings #1812, we ran into a crash on
macOS where references to existing ChannelGroupManifest elements were
getting wiped out. This happens because std::vector reallocates its
memory under the hood as it grows, invalidating active references.

Switching to std::deque fixes this by guaranteeing that pointers and
references stay perfectly stable when elements are added. Performance-wise,
std::deque still gives us constant-time O(1) random access, so the public
operator[] won't see any index-traversal slowdowns.

Relates to PR #2432
Fixes: Part of #1812

Signed-off-by: Moira Shooter <mshooter@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-03 08:27:20 -07:00
dependabot[bot]andCary Phillips 1ec850ffe7 Bump vmactions/freebsd-vm from 1.4.5 to 1.4.6 (#2449)
* Bump vmactions/freebsd-vm from 1.4.5 to 1.4.6

Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](https://github.com/vmactions/freebsd-vm/compare/d1e65811565151536c0c894fff74f06351ed26e6...a6de9343ef5747433d9c25784c90e84998b9d69a)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-version: 1.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Apply suggestion from @cary-ilm

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-06-02 20:28:20 -07:00
dependabot[bot] d3771f3060 Update idna requirement from >=3.15 to >=3.17 in /website (#2450)
Updates the requirements on [idna](https://github.com/kjd/idna) to permit the latest version.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](https://github.com/kjd/idna/compare/v3.15...v3.17)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.17'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-02 20:25:24 -07:00
f19c77355a Fix: Allow NumPy scalar values in Box2i and V2f tuple bindings (#2445)
* test: added failing test case to reproduce #2133

Signed-off-by: YukiRivera <yukikotrivera@gmail.com>

* fix: modified the code to allow numpy scalar values are accepted for #2133

Signed-off-by: Kimhuy Chea <kimhuychea@Kimhuys-MacBook-Air.local>

* test: add v2f numpy float scalar unit test for #2133

Signed-off-by: YukiRivera <yukikotrivera@gmail.com>

* fix: enforce strict type-safety for box2i and v2f attributes

Signed-off-by: YukiRivera <yukikotrivera@gmail.com>

* test: add a test for mixed standard int and numpy scalar entries

Signed-off-by: Kimhuy Chea <kimhuychea@Kimhuys-MacBook-Air.local>

* fix: Allow mixed Python standard types and NumPy scalars in objectToV2

Signed-off-by: YukiRivera <yukikotrivera@gmail.com>

* Address review feedback: optimize Numpy type lookup and expand unit test assertions

Signed-off-by: YukiRivera <yukikotrivera@gmail.com>

---------

Signed-off-by: YukiRivera <yukikotrivera@gmail.com>
Signed-off-by: Kimhuy Chea <kimhuychea@Kimhuys-MacBook-Air.local>
Co-authored-by: Kimhuy Chea <kimhuychea@Kimhuys-MacBook-Air.local>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-31 10:44:14 -07:00
dependabot[bot]andCary Phillips d6b0c4f86b Bump openjph from 0.27.0 to 0.27.3.bcr.1 (#2446)
Bumps [openjph](https://github.com/aous72/OpenJPH) from 0.27.0 to 0.27.3.bcr.1.
- [Release notes](https://github.com/aous72/OpenJPH/releases)
- [Commits](https://github.com/aous72/OpenJPH/commits)

---
updated-dependencies:
- dependency-name: openjph
  dependency-version: 0.27.3.bcr.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-31 09:42:50 -07:00
Cary PhillipsandCopilot Autofix powered by AI 4fa887d369 Break release.py into separate small scripts for each step (#2438)
* Break release.py into separate small scripts for each step

It's much easier to follow the logic this way than having everything
in a single file.

log.py - Prints PRs w/labels and CVE/OSS-Fuzz issues
cherry.py - Reports commits to cherry pick
changes.py - Adds entries to CHANGES.md release notes
tag.py - creates a tag with release notes as message
candidate.py - Formats the release candidate mail
draft.py - Draft the GitHub release w/notes

This also updates the release instructions in CONTRIBUTING.md

Signed-off-by: Cary Phillips <cary@ilm.com>

* fixes

Signed-off-by: Cary Phillips <cary@ilm.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Consistent date formatting

Don't use "%e" since it forces two columns

Signed-off-by: Cary Phillips <cary@ilm.com>

* improve usage messages

Signed-off-by: Cary Phillips <cary@ilm.com>

* more usage message updates

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-31 09:41:59 -07:00
Cary Phillips bd61413c02 Add setMaxImageSize/setMaxTileSize to python module (#2435)
* Add setMaxImageSize/setMaxTileSize to python module

This gives access to size limits in the python module, necessary for
guarding against OOM errors on untrusted input files.

Address F-5 of
https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-gvmj-5qjh-fh8x

Signed-off-by: Cary Phillips <cary@ilm.com>

* Set max size to 5x10 and validate loading test.exr throws

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-29 20:51:03 -07:00
Cary PhillipsandCursor b2f301c1cc Fix Imath include compat on CMake reconfigure (#2441) (#2443)
Remove the `OPENEXR_IMATH_SUBDIR_INCLUDE_PATCH` cache guard so
internal-Imath include directories are re-applied on every configure.

Add a configure-twice smoke test to CI for internal-Imath builds to
catch this class of regression.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 20:19:29 -07:00
Lumina WangandCary Phillips 3a99dd9ba1 Bugfix: Fix interger overflows (#2442)
* Fix integer overflow in internal_dwa_encoder.h
Cast width and height to size_t and change the tmpHalfBufferElements to size_t
to avoid overflow and potential crash.

Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>

* Fix integer overflow in part_attr.c

Cast width and height to size_t to fix overflow and crash.

Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>

* Fix integer overflow in encoding.c

Since priv_to/from_native32(void*, int) are widely used, instead of changing the
function definition, process the sample count table line by line to fix a crash
related to integer overflows.

Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>

---------

Signed-off-by: Lumina Wang <lumina.wang@autodesk.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-29 20:18:19 -07:00
Cary Phillips d00a3b1bd6 Pin idna>=3.15 in website/requirements.txt (#2430)
Addresses [Internationalized Domain Names in Applications (IDNA): Specially crafted inputs to idna.encode() can bypass CVE-2024-3651 fix](https://github.com/AcademySoftwareFoundation/openexr/security/dependabot/6)

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-28 20:37:30 -07:00
dependabot[bot]andCary Phillips cadf06b7c9 Bump github/codeql-action from 4.35.4 to 4.36.0 (#2437)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.4 to 4.36.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/68bde559dea0fdcac2102bfdf6230c5f70eb485e...7211b7c8077ea37d8641b6271f6a365a22a5fbfa)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-27 17:51:40 -07:00
Cary Phillips c9519c7ca0 Release notes and news for v3.4.12 (#2436)
* release notes for v3.4.12

Signed-off-by: Cary Phillips <cary@ilm.com>

* add :warning; remove security heading

Signed-off-by: Cary Phillips <cary@ilm.com>

* v3.4.12 news

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix cve list formatting

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-25 19:15:35 -07:00
0a227f54c8 Validate HTJ2K chunk header length before decode (#2434)
* Validate HTJ2K chunk header length before decode

Reject oversized or inconsistent header payload lengths so corrupted
chunks cannot advance the codestream pointer past the compressed buffer.
Add regression tests for truncated, inflated PLEN, and channel-count cases.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Improved logic

* Improve documentation

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
2026-05-25 19:10:25 -07:00
Cary Phillips 023879c908 Check for xSize==0 in gaps fuzzer part_exceeds_memory_limits (#2429)
Addresses https://issues.oss-fuzz.com/issues/514487287
Addresses https://issues.oss-fuzz.com/issues/514423826

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-23 20:19:22 -07:00
ArcMantisandCary Phillips 252feab755 exrmetrics print disk size of part (#2424)
* Adding feature which allows the disk sizes of induvidual parts in a multipart EXR to be printed as one of the exrmetrics stats. The current method only works when no output file is specified because we use the write position of the dummy output stream to derive bytes written per part. Added flag to enable part size printout.

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Improved help description. Appended to website/bin/exrmetrics.rst

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Improved help message to be more clear. Modified parse() to report error when user attempts to use --part-disk-size and -o or vice versa in command. Added test in test_exrmetrics.py to verify json ouput for --part-disk-size.

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

---------

Signed-off-by: Aries Moczar <arcmantis@protulae.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-18 18:38:07 -07:00
Cary Phillips 99d87b4b8d Add test to validate python module reading of unfinished parts (#2421)
PR #2148 extends the python module to skip over parts with
invalid/unfinished pixel data, so it reads what it can. Reading
"header_only" reads all headers.

This adds a test to validate that behavior, using a test file with
corrupted chunk tables in two of the parts.

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-18 09:29:22 -04:00
Cary Phillips 427929c0fc Add support for multithreading in Python module (#2418)
* Add support for multithreading in Python module

The `OpenEXR.File` object now takes a `num_threads` argument
specifying the number of threads for I/O (passed directly to the
`MultiPartInputFile/MultiPartOutputFile` object constructors).

`OpenEXR.set_global_thread_count(int)` specifies the number of worker
threads for the process-wide thread pool (calls
`Imf::setGlobalThreadCount`), and `OpenEXR.global_thread_count()`
returns the current value.

This also fixes a bug where the `File` object destructor was clearing
the channel dict and pixel numpy arrays even if they are owned by the
caller, a bug revealed by the new multithreading test.

Signed-off-by: Cary Phillips <cary@ilm.com>

* -1 as default num_threads invokes globalThreadCount(), and clarify docs.

The documentation now clarifies that set_global_thread_count() should
be called only during initialization, not interleaved with File
reads/writes.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-18 09:20:29 -04:00
Kimball ThurstonandCary Phillips 15fa71c3b4 Fix computation of chunk height (#2423)
* remove errant include

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* add test for combo of start line, lines per compression, y samples

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* fix compute of sampled height

When there are strange y_sampling, the number of lines per chunk was not
being computed correctly depending on how the start position lines up
with the sampling

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Apply suggestion from @cary-ilm

remove debugging printf

Signed-off-by: Cary Phillips <cary@ilm.com>

* Apply suggestion from @cary-ilm

remove debugging printf

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-17 23:13:12 -04:00
Cary Phillips f448690ec2 Impose memory limits in openexr_exrgaps_fuzzer (#2419)
This applies the memory limits in effect in `openexr_exrcheck_fuzzer`
to the new `openexr_exrgaps_fuzzer`. Without the limits, the fuzzer
can generate test case images that are valid but exceed the limits of
the fuzzing environment.

Addresses https://issues.oss-fuzz.com/issues/513282267
Addresses https://issues.oss-fuzz.com/issues/512988066

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-17 20:43:30 -04:00
Kimball Thurston 227656e52b Fix memory leaks (#2422)
* fix memory leak in test only - invalid api call

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* simplify string init

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* refactor part memory handling for parts

failing to add a part was not reverting cleanly. However, when
reverting, the array storing the list of the parts was not being updated
correctly, causing more potential memory leaks with lots of failures.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2026-05-17 09:26:46 -04:00
Zhen XuandCary Phillips 830bfb594a Fix unfinished multi-part file loading in the py (#2148)
This commit fixes the issue where an unfinished multi-part file could
not be loaded properly in the python warpper for OpenEXR. This happens
when headers for the multi-part file are written to disk but the actual
pixels never finish being written.

The current fix skips the corrupted or empty parts with no pixel data
while retaining the ability for loading the correct ones.

Signed-off-by: dendenxu <zhenx@zju.edu.cn>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-16 11:32:14 -07:00
GhxstandCary Phillips b3ea75380e Support NumPy float vectors in Python headers (#2407)
* Support NumPy float vectors in Python headers

Signed-off-by: Ghost <ghxstofsolana@gmail.com>

* Address float vector ndarray review

Signed-off-by: Ghost <ghxstofsolana@gmail.com>

* Allow shorter float vector ndarrays

Signed-off-by: Ghost <ghxstofsolana@gmail.com>

* Tighten float vector ndarray test

Signed-off-by: Ghost <ghxstofsolana@gmail.com>

---------

Signed-off-by: Ghost <ghxstofsolana@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-16 07:52:59 -07:00
michaeldsmith 94b319d833 Add HTJ2K256 and HTJ2K32 to data compression scheme list (#2416)
Signed-off-by: michaeldsmith <37905569+michaeldsmith@users.noreply.github.com>
2026-05-15 18:15:18 -07:00
dependabot[bot]andCary Phillips e87d0f2c6e Bump github/codeql-action from 4.35.2 to 4.35.4 (#2399)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.2 to 4.35.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/95e58e9a2cdfd71adc6e0353d5c52f41a045d225...68bde559dea0fdcac2102bfdf6230c5f70eb485e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-15 08:02:17 -07:00
Cary Phillips 13fd621bd8 Add missing quotes around ENV in src/test/oss-fuzz/CMakeLists.txt (#2410)
Otherwise, if FUZZING_ENGINE or LIB_FUZZING_ENGINE are not set, the
cmake statements yield confusing invalid syntax.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-15 08:01:33 -07:00
Cary Phillips e866821a9d Check for invalid Slice base and type in TileProcess::copy_sample_count (#2414)
* Check for invalid Slice base and type in TileProcess::copy_sample_count

Reject as invalid if the framebuffer has no sample counts, or they're
not UINTs.

Addresses https://issues.oss-fuzz.com/issues/512895184

Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>

* add higher-level slice guards

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-15 08:00:58 -07:00
Moira ShooterandCary Phillips b8f9f69ea1 Python: reject dataWindow size mismatch before write (#2413)
Closes #2023

Summary:
if datawindow != the size of the numpy buffers, the library could still try to write.
That put native code in a bad state and could crash the process instead of reporting a normal Python error.

This change adds a safety check before writing: when we are writing those numpy buffers under the simple case where channels are not subsampled, we verify that the dataWindow width and height line up with the array dimensions. If they do not, we fail immediately with a clear error so callers can fix the header or the array shape.

Added unit test

Made-with: Cursor

Signed-off-by: Moira Shooter <mshooter@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-15 08:00:24 -07:00
Moira ShooterandCary Phillips 03dbf06c43 Closes #2121 (#2412)
Summary:
Adds binary stream support to the new Python OpenEXR.File API so EXRs can be read from and written to in-memory buffers (e.g. io.BytesIO) without going through a temp file. Implements IStream / OStream adapters backed by Python read / write, tell, and seek, wired to MultiPartInputFile / MultiPartOutputFile.

Tests:

test_unittest.py: BytesIO read vs disk; write ? BytesIO ? read round-trip.
test_images.py: same compare_files checks against the openexr-images corpus for BytesIO read and write(BytesIO) ? read back.
Note : Had to clone https://github.com/AcademySoftwareFoundation/openexr-images.git
and run

setenv OPENEXR_TEST_IMAGE_REPO <path-to-openexr-images>
when running the tests

Made-with: Cursor

Signed-off-by: Moira Shooter <mshooter@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-15 07:58:46 -07:00
ArcMantisandCary Phillips db3a5f24c7 Arcmantis/warning deprecate WidenFilename (#2398)
* Added OPENEXR_DEPRECATED to function WidenFilename indicating its future removal

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Disable warnings of deprecated WidenFilename in unit-tests

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Corrected compiler check from _WIN32 to _MSC_VER. Added additional conditions for __clang__ and __GNUC__.

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Added TODO comments indicating pragmas disabling deprecation-warnings should be removed once WidenFilename is removed.

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Tightened pragmas around WidenFilename to be more precise when disabling deprectation warnings

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

---------

Signed-off-by: Aries Moczar <arcmantis@protulae.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-14 10:28:21 -07:00
AndresandCary Phillips 5d6e875345 Fix Python docstring indentation (#2409)
Signed-off-by: Andres <aguido@unal.edu.co>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-14 08:30:24 -07:00
Cary Phillips e175bcce36 Update urllib3 to 2.7 in website/requirements.txt (#2406)
* Update urllib3 to 2.7 in website/requirements.txt

Vulnerability detected in urllib3 < 2.7

Signed-off-by: Cary Phillips <cary@ilm.com>

* require python 3.11

Signed-off-by: Cary Phillips <cary@ilm.com>

* regenerate requirements-lock.txt for "via -r"

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-13 20:55:09 -07:00
Pierre-Anthony Lemieux db5ed9076b htj2k compressor: validate codestream dimensions (#2403)
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2026-05-13 10:32:47 -07:00
Pierre-Anthony LemieuxandCary Phillips 736a335343 Signal HTJ2K* compressors as lossless (#2405)
* Signal HTJ2K* compressors as lossless

Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>

* Update src/test/OpenEXRTest/testCompressionApi.cpp

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>

---------

Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-11 17:13:27 -07:00
Anthony Hurtado 1e878d0ed2 test/oss-fuzz: add openexr_exrgaps_fuzzer (#2401)
* test/oss-fuzz: add openexr_exrgaps_fuzzer

Adds a third oss-fuzz fuzzer that complements the existing two
(openexr_exrcheck_fuzzer and openexr_exrcorecheck_fuzzer) by
exercising API surfaces those two cannot reach:

- TiledInputPart::readTile with adversarial coordinate sequencing,
  stressing the tile cache and ripmap level resolution beyond what
  checkOpenEXRFile()'s lexicographic loop covers.
- TiledInputPart::readTiles with attacker-controlled (dx1,dx2,dy1,dy2)
  ranges rather than the natural full-image range.
- DeepTiledInputPart::readTile with attacker-controlled coordinates.
- MultiPartInputFile::header(p) iteration in reverse part order, with
  per-attribute name lookup, exercising the part-cache and the
  typed-attribute path.

The harness shares the same plain LLVMFuzzerTestOneInput pattern as
the existing fuzzers, the same BSD-3-Clause header, and links against
the same OpenEXR / OpenEXRUtil targets via the existing foreach loop
in CMakeLists.txt.

Signed-off-by: Anthony Hurtado <amhurtado@pm.me>

* test/oss-fuzz: address Copilot review on openexr_exrgaps_fuzzer

Six fixes from the Copilot review of #2401:

1. read_u32(): cast each byte to uint32_t before shifting/ORing.
   The previous form left-shifted promoted-to-int values, which is
   undefined behavior in C++ when the shifted value would set the sign
   bit.

2. write_temp(): handle short writes and EINTR. The single write()
   call could legally return early or be interrupted, causing valid
   inputs to be silently dropped. Loop until the full buffer is
   written, retrying on EINTR.

3. Add explicit #include <algorithm> for std::min, which was
   previously relying on transitive inclusion. Also add <cerrno>.

4. Mode 0 (test_tiled_random_coords): replace
   `if (hdr.find("type") != hdr.end()) continue;` with a check on
   the actual type value. MultiPartInputFile auto-synthesizes a
   "type" attribute when missing, so the previous check effectively
   skipped every part. Mirror the fix in test_deep_tiled to require
   hdr.type() == DEEPTILE explicitly. Use Imf::DEEPTILE constants
   from ImfPartType.h.

5. Mode 1 (test_tiled_range): clamp the (dx2-dx1+1)*(dy2-dy1+1)
   product so a single readTiles() call requests at most
   kMaxRangeSide^2 = 64 tiles, down from the prior 32x32 = 1024.
   Improves fuzz throughput on valid tiled inputs without losing
   coverage of small-range and boundary cases.

6. CMakeLists.txt: replace the duplicated fuzzer list in the
   oss_fuzz custom target's DEPENDS with ${OPENEXR_FUZZERS}, so the
   list is maintained in one place.

Signed-off-by: Anthony Hurtado <amhurtado@pm.me>

* test/oss-fuzz: refresh exrgaps fuzzer header comment

Drop the now-stale "companion to exrcheck/exrcorecheck" framing since
more fuzzers have landed since this was written, and reword the leading
sentence to refer to all checkOpenEXRFile-based fuzzers collectively.

Signed-off-by: Anthony Hurtado <amhurtado@pm.me>

---------

Signed-off-by: Anthony Hurtado <amhurtado@pm.me>
2026-05-11 15:58:43 -07:00
Cary Phillips b428ba5096 Relax NaN comparison in compression tests (#2388)
* Relax NaN comparison in compression tests

`compareExact(float)` currently requires bitwise equality, even for
NaN, but C vs C++ EXR can generate NaNs that are not bit-wise
identical, leading to reports of failures on various architectures.

This fixes the failures noted in #1281, #1460, #1628 in
the `test*Compression` tests, of the form:

    F float at 59, 0 not equal: C++ loaded C 0x7fc4e364 (nan) vs C loaded C 7f84e364 (nan)

and in `testOptimizedInterleavePatterns`:

    error reading back channel B pixel 21,-76 got -nan expected -nan

This change takes the conservative approach and relaxes the bitwise
comparison only for the architectures that are known to have NaN
differences.

This also changes the method of bitwise comparison of float
values. The C++ standard does not guarantee that writing one field of
a union and reading another is well-defined, and we've seen cases of
it failing with Intel's oneAPI. This changes the comparison to use
`memcpy` to a `uint32_t` instead of a union.

Made with Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>

* remove extraneous bothNan

Signed-off-by: Cary Phillips <cary@ilm.com>

* Use  test on all architectures

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-10 20:12:24 -07:00
Cary Phillips f21cb810ef Release notes, news, and CVE info for v3.4.11, 3.3.11, 3.2.9 (#2402)
* notes for v3.4.11

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add 2344 and 2382 to v3.4.11 notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* Release notes, news, and CVEs for v3.4.11, v3.3.11, v3.2.9

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-10 16:44:10 -07:00
dependabot[bot]andCary Phillips ef7a66fdbe Bump openjph from 0.26.3.bcr.1 to 0.27.0 (#2400)
Bumps [openjph](https://github.com/aous72/OpenJPH) from 0.26.3.bcr.1 to 0.27.0.
- [Release notes](https://github.com/aous72/OpenJPH/releases)
- [Commits](https://github.com/aous72/OpenJPH/commits/0.27.0)

---
updated-dependencies:
- dependency-name: openjph
  dependency-version: 0.27.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-10 12:38:49 -07:00
DavidKorczynski cac70aedd2 Add new fuzzing harnesses that can be consumed by OSS-Fuzz (#2391)
Adds a handful of new fuzzing harnesses that can be run by way of
OSS-Fuzz. The main goal is to increase the code covered, e.g. in a
recent report approximately 16000 lines of code are covered:
https://storage.googleapis.com/oss-fuzz-coverage/openexr/reports/20260420/linux/src/report.html

With the new fuzzing harnesses here, the total number of lines covered
increases above 25000 from a short run, so I anticipate it will go a
good amount larger.

Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: DavidKorczynski <david@adalogics.com>
2026-05-10 12:37:00 -07:00
Cary PhillipsandPierre-Anthony Lemieux 15b620b523 Cast to size_t to avoid int overflow in ht_undo_impl (#2397)
* Cast to `size_t` to avoid int overflow in `ht_undo_impl`

`width` is `int32_t` and `bytes_per_element` is `int16_t`, so the raw
product can overflow 32 bits before the cast to `size_t`; cast each
term to `size_t` before the multiplication.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update src/lib/OpenEXRCore/internal_ht.cpp

Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update src/lib/OpenEXRCore/internal_ht.cpp

Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update src/lib/OpenEXRCore/internal_ht.cpp

Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Report EXR_ERR_CORRUPT_CHUNK if computedoffset overflows size_t

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
2026-05-06 08:29:45 -07:00
Cary Phillips 662ec14f47 Clarify #include policy and make usage consistent (#2369)
* Clarify #include policy and make usage consistent

This explains the OpenEXR policy regarding the "OpenEXR/" subdirectory
for include files: headers are installed under the "OpenEXR"
subdirectory, and the library supports application code that uses
either the bare header or the "OpenEXR subdirectory, i.e either one
of:

    #include <ImfHeader.h>
    #include <OpenEXR/ImfHeader.h>

Both cmake config and pkg-config add -I$include and -I$include/OpenEXR
as compilation args.

This policy is explained for users in the "Header Layout and #include
Policy" section in website/install.rst.

Internally, all library and tool source includes bare headers, without
the "OpenEXR" since the source tree maintains headers local to each
library, not in a common OpenEXR directory. The only exception is code
in the source tree that is expected to mimic example application code.

Internally, all library and tool source includes files via quotes ""
when the header in question is either in the local directory or is one
of the public headers installed in the OpenEXR. Others are included
via brackets <>.  Previously, this was inconsistent.  Imath headers
are included via <> because they come from another project.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add note about local header #include to install.rst

Signed-off-by: Cary Phillips <cary@ilm.com>

* separate header sections for applications vs. internal builds

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-04 21:17:32 -07:00
ArcMantisandCary Phillips 1c4f77e9b6 Completing ChannelList Iterator API (#2384)
* Added additional operator overloads '--', '*' and '->' for ChannelList::Iterator and ChannelList::ConstIterator. Also added global operator overloads '==' and '!=' for Iterator class.
(issue #1325)
Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Added '==' and '!=' overloads for mixed Iterator and ConstIterator comparisons. Added Iterator and ConstIterator traits.

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

* Added test to testChannels unit-test to verify functionality of ChannelList::Iterator/ConstIterator

Signed-off-by: Aries Moczar <arcmantis@protulae.com>

---------

Signed-off-by: Aries Moczar <arcmantis@protulae.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-04 20:49:28 -07:00
dependabot[bot]andCary Phillips 2ec8eb91ea Bump sphinx from 7.2.6 to 7.4.7 in /website (#2396)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.6 to 7.4.7.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/v7.4.7/CHANGES.rst)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.2.6...v7.4.7)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-version: 7.4.7
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-05-04 20:30:38 -07:00
Cary Phillips 75d17f3099 Add install instructions for python module (#2387)
The new section mentions the requirement for Python development
install (not just the interpeter), and pybind11, and also mentions the
cmake variables for directing the build to a specific Python install.

Inspired by #1603.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-05-04 08:40:07 -07:00
Cary Phillips d62b62f512 cmake: require YMM asm for inline AVX probe (#2385) 2026-05-03 21:35:02 -07:00
Cary Phillips 8c7de3eb93 Include all Imath headers via #include <Imath/...> (#2376) 2026-05-03 21:34:26 -07:00
dependabot[bot] 6721442a8d Bump platforms from 1.0.0 to 1.1.0 (#2394)
Bumps [platforms](https://github.com/bazelbuild/platforms) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/bazelbuild/platforms/releases)
- [Commits](https://github.com/bazelbuild/platforms/compare/1.0.0...1.1.0)

---
updated-dependencies:
- dependency-name: platforms
  dependency-version: 1.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-02 10:23:00 -07:00
ArcMantis dddb282795 Corrected index verification to reject index matching the string size because this would be out-of bounds as arrays are zero-indexed. Addresses issue #2379 (#2392)
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
2026-04-30 07:07:42 -07:00
Mirco MirandaandCary Phillips 8d5415a6fa Fix Null-dereference READ (#2382)
Signed-off-by: Mirco Miranda <mirco.miranda@systemceramics.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-25 07:06:35 -07:00
navvyswethgraphicsandCary Phillips ca2e5137d2 Fix Windows ARM64EC build issues and correct SIMD ARM NEON path (#2344)
Signed-off-by: nregulla <nregulla@qti.qualcomm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-24 22:24:17 -07:00
dependabot[bot] df534c6691 Bump rules_cc from 0.2.17 to 0.2.18 (#2386)
Bumps [rules_cc](https://github.com/bazelbuild/rules_cc) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/bazelbuild/rules_cc/releases)
- [Commits](https://github.com/bazelbuild/rules_cc/compare/0.2.17...0.2.18)

---
updated-dependencies:
- dependency-name: rules_cc
  dependency-version: 0.2.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-24 22:22:38 -07:00
Kimball Thurston fd6bbaae66 validate that the uncompressed sizes recorded in the dwa header are valid (#2383)
This prevents some corruption when filling buffers where these sizes
were trusted but not fully validated to be sane ahead of time

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2026-04-24 08:21:48 -07:00
Cary Phillips 0592ee539f Fix int overflow in ImageChannel::resize pixel count (#2367)
* Fix int overflow in ImageChannel::resize pixel count

Compute `_numPixels` with `uint64_t` after validating subsampled
dimensions, and reject products larger than `SIZE_MAX`. Prevents
undersized `new[]` in `TypedFlatImageChannel` and
`TypedDeepImageChannel` when `width*height` overflows signed int.

Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>

* Remove the `(_pixelsPerRow < 0 || _pixelsPerColumn < 0)` test, since
the width and height have already been validated.

But an extra test *is* necessary in ImageChannel::resize() to validate
that xSampling and ySampling are not 0. This adds the validation check
but also adds a test to the test suite to validate handling of bad
sampling values.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-21 19:13:11 -07:00
Cary Phillips 21eaa33bcb Harden IDManifest parsing against illegal shift and string prefix OOB (#2378)
* Harden IDManifest parsing against illegal shift and string prefix OOB

`readVariableLengthInteger()` must not apply `(byte & 127) << shift`
when `shift >= 64`; that is undefined behavior for `uint64_t` and
could yield corrupted lengths for string list parsing. Reject
encodings that exceed representable shifts.

When decoding compressed string lists, the common-prefix length is
encoded with one or two leading bytes depending on whether the
previous string exceeded 255 characters. Require each string to be at
least that many bytes before reading those prefix bytes, avoiding
out-of-bounds indexing on undersized entries.

Made with Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>

* Remove minPrefixLen test that duplicates PR #2377

That fix belongs in #2377, not combined with the shift fix.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-21 18:35:06 -07:00
Cary Phillips 48e5f65a7d Fix OOB read when expanding IDManifest prefix-compressed strings (#2377)
Validate each string has enough bytes for the 1- or 2-byte
common-prefix encoding before indexing. Prevents heap OOB read when
the previous string is long and the current entry is empty or too
short.

Made with Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-21 18:34:39 -07:00
ArcMantis 1bd1988a46 Minor changes to website index page to make some sentences clearer. Addresses issue 2076. (#2375)
Signed-off-by: Aries Moczar <arcmantis@protulae.com>
2026-04-20 16:09:35 -07:00
Cary Phillips 53cfa8329f Bump and pin website/requirements.txt (#2373)
* Bump and pin website/requirements.txt

Signed-off-by: Cary Phillips <cary@ilm.com>

* dependabot.yml ignores requirements-lock.txt

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-20 07:44:52 -07:00
dependabot[bot]andCary Phillips d03989fefc Bump packaging from 26.0 to 26.1 (#2371)
Bumps [packaging](https://github.com/pypa/packaging) from 26.0 to 26.1.
- [Release notes](https://github.com/pypa/packaging/releases)
- [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/packaging/compare/26.0...26.1)

---
updated-dependencies:
- dependency-name: packaging
  dependency-version: '26.1'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-20 06:31:54 -07:00
dependabot[bot] e4a63b444d Bump msys2/setup-msys2 from 2.31.0 to 2.31.1 (#2370)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.31.0 to 2.31.1.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/cafece8e6baf9247cf9b1bf95097b0b983cc558d...e9898307ac31d1a803454791be09ab9973336e1c)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.31.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-20 06:29:47 -07:00
Cary Phillips 574289d367 Add release notes and news for v3.4.10, v3.3.10, v3.2.8 (#2368)
* notes for v3.2.8

Signed-off-by: Cary Phillips <cary@ilm.com>

* notes for v3.3.10

Signed-off-by: Cary Phillips <cary@ilm.com>

* notes for v3.4.10

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add CVE-2026-39886, CVE-2026-40244, CVE-2026-40250 to SECURITY.md

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix range for CVE-2026-39886

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix date for 3.4.10

Signed-off-by: Cary Phillips <cary@ilm.com>

* news for v3.4.10

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-19 08:09:56 -07:00
Cary Phillips 76e6496764 Recommend GH Security Advisories for vulnerability reporting (#2364)
Mention security@openexr.com only for private/secure communication.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-19 08:09:31 -07:00
Cary Phillips 635c511e5f Add workflow dispatch trigger to release-sign.yml (#2366)
If the release signing fails for some reason when triggered by the
release publish, this gives a way to force run it.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-17 13:46:41 -07:00
dependabot[bot]andCary Phillips c13e0e1320 Bump vmactions/freebsd-vm from 1.4.4 to 1.4.5 (#2363)
Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](https://github.com/vmactions/freebsd-vm/compare/7ca82f79fe3078fecded6d3a2bff094995447bbd...d1e65811565151536c0c894fff74f06351ed26e6)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-version: 1.4.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-16 16:40:26 -07:00
dependabot[bot]andCary Phillips d45080e2ab Bump github/codeql-action from 4.35.1 to 4.35.2 (#2362)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.1 to 4.35.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/c10b8064de6f491fea524254123dbe5e09572f13...95e58e9a2cdfd71adc6e0353d5c52f41a045d225)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-16 16:39:56 -07:00
Cary Phillips 090780124a Add documentation and test for UTF-8 file paths (#2361)
This adds a note to the source code and the website documentation that
clarifies that `const char*` filename arguments are assumed to be
UTF-8 encoded.

It also adds a test to validate the handling of non-ascii filenames by
isOpenExrFile().

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-16 16:39:24 -07:00
Cary Phillips fc2bceec77 Add reference to "contribute" and Clotributor in README.md and website (#2359)
GitHub auto-generates the "contribute" page from issues labeled "good first issue."

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-15 14:45:37 -07:00
dependabot[bot] 5d8f79207f Bump actions/cache from 5.0.4 to 5.0.5 (#2360)
Bumps [actions/cache](https://github.com/actions/cache) from 5.0.4 to 5.0.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/668228422ae6a00e4ad889ee87cd7109ec5666a7...27d5ce7f107fe9357f9df03efb73ab90386fccae)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 5.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-14 16:50:54 -07:00
dependabot[bot] 5ab3dc3b97 Bump actions/upload-artifact from 7.0.0 to 7.0.1 (#2354)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-13 06:33:13 -07:00
Cary Phillips 416fecf712 Fix integer overflow in internal_dwa_compressor.h (#2346)
`width` and `height` are `int32_t`; cast to `size_t`, since the result
is a pointer offset, to avoid overflow.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-10 15:27:12 -07:00
dependabot[bot]andCary Phillips aaaa7b2858 Bump pygments from 2.19.2 to 2.20.0 in /website (#2347)
Bumps [pygments](https://github.com/pygments/pygments) from 2.19.2 to 2.20.0.
- [Release notes](https://github.com/pygments/pygments/releases)
- [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
- [Commits](https://github.com/pygments/pygments/compare/2.19.2...2.20.0)

---
updated-dependencies:
- dependency-name: pygments
  dependency-version: 2.20.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-10 15:12:09 -07:00
dependabot[bot] 55cd8175a4 Bump requests from 2.32.5 to 2.33.0 in /website (#2348)
Bumps [requests](https://github.com/psf/requests) from 2.32.5 to 2.33.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.5...v2.33.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-10 14:17:52 -07:00
Cary Phillips 44bf86508f Add CI test to validate "cmake --install .. --prefix <path> (#2333)
With this change, when `configure_install_prefix` is provideed, the CI
configures and builds with one install prefix but then overrides that
in the install step with an explicit `--prefix <path>`. This validates
that the custom prefix takes precedence over the cache.

This is done for the matrix builds that test with various settings
off, so it's sure to catch both with and without the overriding
prefix.

The `--install` option is only available in cmake 3.15+, but the
OpenEXR supported version of cmake is still 3.14 (so that's what the
CI uses), so the CI uses 3.15 for these builds.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-10 09:18:10 -07:00
Cary Phillips cdefd56f21 Fix Pinned-Dependencies Scorecard alert in website workflow (#2316)
Recommended by the GitHub Scorecard code scanner (Security -> Code scanning
-> Pinned-Dependencies).

Use `pip install --require-hashes -r requirements-lock.txt` instead of
unpinned `pip3 install -r requirements.txt` to satisfy OpenSSF Scorecard's
Pinned-Dependencies check

Add `website/requirements-lock.txt` generated via `pip-compile
--generate-hashes` with all transitive dependencies pinned by SHA-256 hash.
This requires regenerating `website/requirements-lock.txt` whenever `website/requirements.txt` changes, via:

`pip-compile requirements.txt --generate-hashes -o requirements-lock.txt`

Made-with: Cursor


colorama

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-10 09:17:40 -07:00
Cary Phillips dce587f227 Fix CodeQL SARIF upload ref for pull_request workflows (#2338)
Use refs/pull/<n>/head and the PR head SHA when uploading results so
Dependabot and other branch refs are not required by the Code Scanning
API (avoids ref not found errors).

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-10 07:22:32 -07:00
Pierre-Anthony Lemieux 15fd269f7e Address https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-r3mr-mx8q-jcw5 (#2345)
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
2026-04-09 21:55:19 -07:00
dependabot[bot]andCary Phillips 33e7891b5a Bump jmertic/slack-release-notifier (#2341)
Bumps [jmertic/slack-release-notifier](https://github.com/jmertic/slack-release-notifier) from 32206e01ee0b0f66865d2be13bb3c62e474b5ce0 to 9d7d3a84563d2ebc8f7b2271be6c9568fedd7f3a.
- [Release notes](https://github.com/jmertic/slack-release-notifier/releases)
- [Commits](https://github.com/jmertic/slack-release-notifier/compare/32206e01ee0b0f66865d2be13bb3c62e474b5ce0...9d7d3a84563d2ebc8f7b2271be6c9568fedd7f3a)

---
updated-dependencies:
- dependency-name: jmertic/slack-release-notifier
  dependency-version: 9d7d3a84563d2ebc8f7b2271be6c9568fedd7f3a
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-09 11:18:07 -07:00
dependabot[bot] f69e110548 Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0 (#2343)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e...cef221092ed1bacb1cc03d23a2d87d1d172e277b)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-09 11:16:59 -07:00
Cary Phillips ee4aed01d2 Fix 3.4.9 cve list formatting (#2340)
Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-05 14:17:57 -07:00
Cary Phillips cd34d0a85a Add CVE-2026-34589,34588,34545,34544,34543,34380,34379,34378 to SECURITY.md (#2334)
* Add CVE-2026-34589,34588,34545,34544,34543,34380,34379,34378 to SECURITY.md

Signed-off-by: Cary Phillips <cary@ilm.com>

* Replace explicit lists with ranges

Signed-off-by: Cary Phillips <cary@ilm.com>

* update with 3.2 and 3.3 patches

Signed-off-by: Cary Phillips <cary@ilm.com>

* Use a table for vulnerability section, with a column for the "Affected
Versions" and another for the "Patched Versions".

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-05 12:13:45 -07:00
Cary Phillips 97d256e80a fix link formatting typo (#2339)
Also, in release.py, convert `text` to ``text`` *before* converting links, so gthe links don't get doubly-converted.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-05 12:12:58 -07:00
dependabot[bot]andCary Phillips df735baa13 Bump pypa/cibuildwheel from 3.4.0 to 3.4.1 (#2336)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/ee02a1537ce3071a004a6b08c41e72f0fdc42d9a...8d2b08b68458a16aeb24b64e68a09ab1c8e82084)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: 3.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-05 06:38:02 -07:00
Cary Phillips ac1d629b2c notes and news for v3.4.9, v3.3.9, v3.2.7 (#2337)
* update notes for v3.2.7 with recent cves

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix merge of notes for 3.2.7

Signed-off-by: Cary Phillips <cary@ilm.com>

* notes for v3.3.9

Signed-off-by: Cary Phillips <cary@ilm.com>

* update v3.3.9 notes with added cves

Signed-off-by: Cary Phillips <cary@ilm.com>

* notes for v3.4.9

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add CVE-2026-34589,34588,34545,34544,34543,34380,34379,34378

Signed-off-by: Cary Phillips <cary@ilm.com>

* 3.2.7 news

Signed-off-by: Cary Phillips <cary@ilm.com>

* 3.3.9 news

Signed-off-by: Cary Phillips <cary@ilm.com>

* 3.4.9 news

Signed-off-by: Cary Phillips <cary@ilm.com>

* revert edits to SECURITY.md

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add missing CVES for past releases

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-04-05 06:37:10 -07:00
Jhacson MezaandCary Phillips 1e4009f62e Fix shared lib symlink installation path (#2326)
Signed-off-by: Jhacson Meza <jhacsonmeza@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-04-01 13:32:56 -07:00
Cary Phillips 3ad9b29430 Fix misaligned memory access in LossyDctDecoder_execute HALF→FLOAT expansion (#2324)
* Fix misaligned memory access in `LossyDctDecoder_execute` HALF→FLOAT expansion

After DCT decoding, `LossyDctDecoder_execute()` expands FLOAT-type channels
from their intermediate HALF (16-bit) XDR representation back to FLOAT (32-bit)
XDR in place.  The expansion was done by casting `_rows[y]` (a `uint8_t *`)
directly to `float *` and `uint16_t *`, then reading and writing through those
typed pointers.

Because row buffers are assigned by advancing a byte pointer with no alignment
padding (`outBufferEnd += chan->width * chan->bytes_per_element` in
`internal_dwa_compressor.h`), a FLOAT channel that follows a HALF channel of
odd width receives a `_rows[y]` pointer that is 2-byte aligned but not 4-byte
aligned.  Dereferencing a `float *` cast from such a pointer is undefined
behavior under the C standard:

- On ARM, RISC-V, and MIPS (strict alignment) this crashes immediately.
- On x86 it is silently tolerated at the hardware level but remains UB:
  auto-vectorizing compilers (SSE/AVX) may assume aligned access and generate
  incorrect code.
- UBSan reports: `store to misaligned address ... for type 'float', which
  requires 4 byte alignment` at `internal_dwa_decoder.h:749`.

Fix: replace the cast-and-dereference pattern with the `unaligned_load16` /
`memcpy` / `unaligned_store32` helpers already used throughout the rest of
OpenEXRCore (`internal_xdr.h`, `unpack.c`, `pack.c`, `internal_pxr24.c`).
These helpers use `memcpy` internally, which the C standard guarantees is safe
for unaligned addresses and which compilers compile to a single load/store
instruction on architectures that support it.

The byte-order handling is preserved correctly:
- `unaligned_load16` reads 2 bytes via `memcpy` and applies `one_to_native16`
  (XDR → native), returning a native-endian HALF value.
- `half_to_float` converts native HALF → native float.
- `memcpy(&bits, &f, 4)` reinterprets the float's bit pattern as `uint32_t`
  without numeric conversion (the correct type-pun idiom in C).
- `unaligned_store32` applies `one_from_native32` (native → XDR) and writes
  4 bytes via `memcpy`, storing the result in XDR float format.

Made-with: Cursor
Signed-off-by: Cary Phillips <cary@ilm.com>

* add TODO comment

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-31 07:49:09 -07:00
Cary Phillips fd6e4007ed Add "cherry" and "changes" options to release.py (#2317)
* Add "cherry" and "changes" options to release.py

Print the SHAs of commits from PRs with the given label:
   share/util/release.py cherry v3.4.7

Add section and PR list entry to CHANGES.md:
   share/util/release.py changes v3.4.7 2313

These options help automate the release process, although they still
leave theactual cherry-picking to be done by hand.

The release process:
1. Label PRs with the new release label
2. Run "release.py cherry" to print the commits
3. For each PR/commit:
   a. cherry pick it onto the release branch
   b. run "release.py changes" to add to the release notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* 1. "release.py changes" accepts a list of PRs
2. "release.py cherry" prints a "release.py changes" command for copy/execute.
3. "release.py log" prints a 'git log' with commits annotated with
    labels associated with each identified PR.

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix comment

Signed-off-by: Cary Phillips <cary@ilm.com>

* "Workflow" PRs are ones that are either from dependabot *or* only
modify files under .github/workflow

Signed-off-by: Cary Phillips <cary@ilm.com>

* Further clean up the release instructions in CONTRIBUTING.md

And fix a typo in "release.py cherry" output.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-30 06:59:24 -07:00
dependabot[bot]andCary Phillips ec93548aed Bump vmactions/freebsd-vm from 1.4.3 to 1.4.4 (#2332)
Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](https://github.com/vmactions/freebsd-vm/compare/4807432c7cab1c3f97688665332c0b932062d31f...7ca82f79fe3078fecded6d3a2bff094995447bbd)

---
updated-dependencies:
- dependency-name: vmactions/freebsd-vm
  dependency-version: 1.4.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-30 06:50:48 -07:00
dependabot[bot]andCary Phillips 7a26f439ce Bump github/codeql-action from 4.34.1 to 4.35.1 (#2331)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.34.1 to 4.35.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/38697555549f1db7851b81482ff19f1fa5c4fedc...c10b8064de6f491fea524254123dbe5e09572f13)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-30 06:49:36 -07:00
dependabot[bot] 1d07ddd467 Bump jmertic/slack-release-notifier (#2330)
Bumps [jmertic/slack-release-notifier](https://github.com/jmertic/slack-release-notifier) from f824585541879ef2a6388268eccb9be210aa6878 to 32206e01ee0b0f66865d2be13bb3c62e474b5ce0.
- [Release notes](https://github.com/jmertic/slack-release-notifier/releases)
- [Commits](https://github.com/jmertic/slack-release-notifier/compare/f824585541879ef2a6388268eccb9be210aa6878...32206e01ee0b0f66865d2be13bb3c62e474b5ce0)

---
updated-dependencies:
- dependency-name: jmertic/slack-release-notifier
  dependency-version: 32206e01ee0b0f66865d2be13bb3c62e474b5ce0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 06:48:49 -07:00
Cary Phillips 8b4d73f666 Add a message about image size limits and OOM errors to SECURITY.md and website (#2327)
* Add a message about image size limits and OOM errors

Placed just after the main list of features of the file format, and in
SECURITY.md since misunderstandings of this feature/policy can lead to
false assumptions of security vulnerability.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add reference to setMaxImageSize to ReadingAndWritingImageFiles.rst

And website/src/exrreader/exrreader_max.cpp illustrates setting max
image size.

Signed-off-by: Cary Phillips <cary@ilm.com>

* move exrreader_max to its own directory

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention tiled format/API

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-29 19:29:20 -07:00
Cary Phillips 7c31424f9e Fix signed integer overflow in LossyDctDecoder_execute() pointer arithmetic (#2329)
`numBlocksX` and `numBlocksY` are declared as `int`. Two pointer-offset
expressions in `LossyDctDecoder_execute()` multiplied them as signed
32-bit integers before using the result as a pointer offset:

    rowBlock[comp]   = rowBlock[comp - 1]   + numBlocksX * 64;
    currDcComp[comp] = currDcComp[comp - 1] + numBlocksX * numBlocksY;

`dataWindow.max.x` is a signed 32-bit value in the EXR file format, so
`numBlocksX` can reach `(INT32_MAX + 7) / 8 = 268,435,456`. At that
point `numBlocksX * 64 = 17,179,869,184` overflows `int32`, and
`numBlocksX * numBlocksY` overflows even sooner. The wraparound
produces a small or negative pointer offset, causing `rowBlock[comp]`
and `currDcComp[comp]` to point into already-used or pre-buffer memory
rather than the intended component stride.

Fix: cast `numBlocksX` to `size_t` before multiplying so the
arithmetic is performed in pointer-sized unsigned arithmetic:

    rowBlock[comp]   = rowBlock[comp - 1]   + (size_t) numBlocksX * 64;
    currDcComp[comp] = currDcComp[comp - 1] + (size_t) numBlocksX * numBlocksY;

This is consistent with the allocation on the line above, which already
uses `(size_t) numComp * (size_t) numBlocksX * 64 * sizeof(uint16_t)`,
and with the packed-DC count check, which uses explicit `uint64_t` casts.

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-29 19:20:52 -07:00
Cary Phillips e464a33cc5 fix integer overflow in PIZ wavelet buffer arithmetic (#2328)
Three classes of signed integer overflow in the PIZ codec path, all
reachable from corrupt `dataWindow` dimensions in the EXR file header.

**`wav_2D_encode` / `wav_2D_decode` — wavelet loop pointer arithmetic**

`oy` is passed as `int` (value `wcount * nx`, at most ~INT32_MAX after
the guard below). Inside the hierarchical wavelet loop the expressions

    ey  = in + oy * (ny - p2)   // pointer end-of-row sentinel
    oy1 = oy * p                // row stride at level p
    oy2 = oy * p2               // row stride at level p2

multiply two values that can each approach INT32_MAX, producing a
signed 32-bit product that wraps to a small or negative value. The
wrapped value is used as a pointer offset, causing reads and writes
through `px` / `py` to land outside the allocated wavelet buffer.

Fix: widen by introducing `int64_t oy64 = oy` and using it for all
three expressions; `oy1` and `oy2` are also declared `int64_t`.

**`wavbuf += nx * ny * wcount` — per-channel buffer advance**

`nx`, `ny`, and `wcount` are all `int`. Their triple product overflows
int32 for moderately large images, causing subsequent channels to be
processed at an incorrect (too-small) offset into the wavelet buffer,
corrupting both encode and decode output.

Fix: cast to `(uint64_t)` before multiplying.

**`wcount * nx` — call-site argument overflow**

The fifth argument to `wav_2D_encode` / `wav_2D_decode` is `wcount * nx`
(`oy` = y-stride = elements per row). `wcount` is 1 or 2
(`bytes_per_element / 2`); for `wcount = 2` the product overflows int32
when `nx > INT32_MAX / 2`.

Fix: add an early bounds check `if (wcount > 0 && nx > INT_MAX / wcount)`
that rejects such input as `EXR_ERR_CORRUPT_CHUNK` before any arithmetic
is performed. This also keeps `wcount * nx` within int32 range at the
call site, ensuring `oy` arrives in the wavelet functions with a valid
non-overflowed value.

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-29 19:19:49 -07:00
Cary Phillips f5beec2bd8 Security: fix signed integer overflow in undo_pxr24_impl() (PXR24 decoder) (#2323)
In the `EXR_PIXEL_FLOAT` branch of `undo_pxr24_impl()`, the expressions

    (uint64_t)(w * 3)

compute the signed 32-bit product `w * 3` before the cast to `uint64_t`.
When `w` is large this is undefined behavior under the C standard; on
two's-complement builds without sanitizers the result wraps to a small
positive value, which can cause the bounds check

    if (nDec + (uint64_t)(w * 3) > outSize)

to pass incorrectly. If the check is bypassed the decode loop proceeds
to write `4*w` bytes through `dout`, potentially far beyond the allocated
output buffer.

Fix: cast `w` to `uint64_t` before multiplying so that both the bounds
check and the counter update are performed entirely in 64-bit unsigned
arithmetic:

    (uint64_t)w * 3   (cast before multiply, not after)

The `EXR_PIXEL_UINT` and `EXR_PIXEL_HALF` decode branches are unaffected:
they reuse the pre-computed `nBytes` variable, which is already formed as
`(uint64_t)(w) * (uint64_t)(bytes_per_element)`.

Also fix the symmetric issue in `apply_pxr24_impl()` (the encoder):
    lastIn += w * 4
advances a pointer by a signed 32-bit product; corrected to
    lastIn += (uint64_t)w * 4

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-29 19:19:12 -07:00
Cary Phillips 2c19a5a662 news and release notes for v3.4.8 and v3.4.7 (#2322)
* notes for v3.4.6

Signed-off-by: Cary Phillips <cary@ilm.com>

add 2167 to notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* notes for v3.4.7

Signed-off-by: Cary Phillips <cary@ilm.com>

* add notes for v3.4.8

Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix typos in links in CHANGES.md

Signed-off-by: Cary Phillips <cary@ilm.com>

* news for v3.4.8 and v3.4.7

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-29 19:18:31 -07:00
dependabot[bot] 7820b7e1b9 Bump sigstore/gh-action-sigstore-python from 3.2.0 to 3.3.0 (#2325)
Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases)
- [Changelog](https://github.com/sigstore/gh-action-sigstore-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/a5caf349bc536fbef3668a10ed7f5cd309a4b53d...04cffa1d795717b140764e8b640de88853c92acc)

---
updated-dependencies:
- dependency-name: sigstore/gh-action-sigstore-python
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 09:57:13 -07:00
Cary Phillips 088859fb61 Fix integer overflow in srcbuffer pointer arithmetic in unpack_* (#2321)
Pointer arithmetic involving `srcbuffer` in the `unpack_*` functions
can overflow for very wide images.

Multiplying `int w` by a bytes-per-element constant (2, 4, 6, or 8) in
`srcbuffer +=` expressions causes signed integer overflow when the
image width is large.

Promote the leading operand to `int64_t` at every affected multiplication
so pointer arithmetic is performed in 64-bit signed arithmetic throughout,
eliminating the undefined behavior without imposing any image size limit.

Affected sites: `generic_unpack`, `unpack_16bit`, `unpack_32bit`, and
all 3- and 4-channel interleave/planar specializations.

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-26 16:35:49 -07:00
Antonio RojasandCary Phillips 30345db729 Don't hardcode the python module install dir (#2309)
* Don't hardcode the python module install dir

Use the proper install dir provided by cmake instead

Signed-off-by: Antonio Rojas <arojas@archlinux.org>

* Update src/wrappers/python/CMakeLists.txt

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Antonio Rojas <arojas@archlinux.org>

* Update src/wrappers/python/CMakeLists.txt

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Antonio Rojas <arojas@archlinux.org>

---------

Signed-off-by: Antonio Rojas <arojas@archlinux.org>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-26 16:22:10 -07:00
dependabot[bot]andCary Phillips 05472e737f Bump github/codeql-action from 4.33.0 to 4.34.1 (#2318)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.33.0 to 4.34.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b1bff81932f5cdfc8695c7752dcee935dcd061c8...38697555549f1db7851b81482ff19f1fa5c4fedc)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.34.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-26 08:45:03 -07:00
dependabot[bot]andCary Phillips 97e1870f06 Bump msys2/setup-msys2 from 2.30.0 to 2.31.0 (#2319)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/4f806de0a5a7294ffabaff804b38a9b435a73bda...cafece8e6baf9247cf9b1bf95097b0b983cc558d)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-26 08:44:04 -07:00
dependabot[bot] f72a3aecef Bump jmertic/slack-release-notifier (#2320)
Bumps [jmertic/slack-release-notifier](https://github.com/jmertic/slack-release-notifier) from 35fad060af5559c24decdec0f701e6ba93566704 to f824585541879ef2a6388268eccb9be210aa6878.
- [Release notes](https://github.com/jmertic/slack-release-notifier/releases)
- [Commits](https://github.com/jmertic/slack-release-notifier/compare/35fad060af5559c24decdec0f701e6ba93566704...f824585541879ef2a6388268eccb9be210aa6878)

---
updated-dependencies:
- dependency-name: jmertic/slack-release-notifier
  dependency-version: f824585541879ef2a6388268eccb9be210aa6878
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-26 08:43:08 -07:00
Cary Phillips c48f23ce68 PXR24: reject zlib output that does not match packed payload size (#2310)
* PXR24: reject zlib output that does not match packed payload size

PXR24 stores zlib-compressed packed channel data (e.g. 3 bytes/sample
for float), while chunk `unpacked_size` is the native layout (4
bytes/sample).  After inflate, validate the decompressed length
against the packed byte count derived from the same geometry as
encode/decode, not `unpacked_size`.

A truncated-but-valid zlib stream previously produced success with a
short `actual_out` while the decoder advanced through scratch as if
the full packed block were present, reading uninitialized heap into
pixels.

Add `pxr24_packed_zlib_size()` (aligned with `apply_pxr24_impl`) and
require `outSize ==` that value after `exr_uncompress_buffer()`
succeeds.

Analysis and solution with the the help of Cursor / Claude Opus 4.5

Signed-off-by: Cary Phillips <cary@ilm.com>

* replace comparison to uncompressed_size with outSize

A simpler solution: remove `pxr24_packed_zlib_size()` entirely detect
corrupt chunks by comparing against `outSize` instead of
`uncompressed_size`.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-22 16:18:52 -07:00
Cary Phillips 6155271859 Force macos cibuildwheel to use Xcode clang (#2315)
On GitHub’s macOS runners, clang on PATH often points to Homebrew’s
LLVM (e.g. /usr/local/opt/llvm@18/bin/clang) instead of Xcode’s clang.

That LLVM build pulls in Homebrew’s libunwind, which is built with
minimum macOS 14.0. When the OpenEXR extension is built with that
toolchain, it ends up depending on that libunwind.

During wheel repair, delocate copies all non-system dependencies into
the wheel. It then checks that each bundled library’s minimum macOS
version matches the wheel’s target. Homebrew’s libunwind requires
14.0, so if the wheel claims 11.0 (or 10.15), delocate fails.

Xcode’s clang lives at /usr/bin/clang and uses the system C++ runtime
and unwinder. Those are part of macOS and don’t bring in a separate
libunwind dylib with a higher minimum version.

Assisted-with: Cursor / Claude Opus 4.5

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-20 09:47:53 -07:00
Cary Phillips 3df0122142 Pin pypa/cibuildwheel actions to release sha (#2294)
Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-19 15:28:19 -07:00
Cary Phillips 622f2ae19a Restrict workflow permissions for ci_steps, release-sign, and codeql (#2295)
- ci_steps: set top-level permissions to read, and write only for the
  upload step
- release-sign: repository-projects permission is not necessary
- codeql: set top-level permissions to read

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-19 15:27:47 -07:00
dependabot[bot]andCary Phillips 2e32c6b3c6 Bump actions/cache from 5.0.3 to 5.0.4 (#2311)
Bumps [actions/cache](https://github.com/actions/cache) from 5.0.3 to 5.0.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/cdf6c1fa76f9f475f3d7449005a359c84ca0f306...668228422ae6a00e4ad889ee87cd7109ec5666a7)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 5.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-19 14:32:54 -07:00
dependabot[bot]andCary Phillips c6bacff999 Bump github/codeql-action from 4.32.6 to 4.33.0 (#2304)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.6 to 4.33.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/0d579ffd059c29b07949a3cce3983f0780820c98...b1bff81932f5cdfc8695c7752dcee935dcd061c8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-19 14:32:27 -07:00
Cary Phillips 178deca15c Fix MinGW -Walloc-size-larger-than= in general_attr string test (#2303)
Only allocate INT32_MAX+2 bytes when sizeof(size_t) >= 8 (64-bit).
On 32-bit MinGW the max object size is INT_MAX, so skip the
oversized-string rejection test to avoid the warning.

Note that we need to use `__SIZEOF_SIZE_T__` to suppress the MinGW warning, since it happens at compiletime, not runtime.

Made with the help of Cursor / Claude Opus 4.5

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-19 14:31:49 -07:00
Cary Phillips cf9bf84dc3 Fix B44/B44A integer overflow: use uint64_t for row offset (#2312)
The B44 and B44A decoder and encoder use channel width (`nx`) and
height (`ny`) in row pointer math. `nx` and `ny` are `int`; the
scratch buffer is correctly sized with `(uint64_t)ny * (uint64_t)nx *
bytes_per_element`, but row bases were computed as:

```
  row0 = (uint16_t*)scratch;
  row0 += y * nx;   // int * int -> signed overflow when y*nx > INT_MAX
```

For large `nx` (e.g. 268435456), `y*nx` overflows, so `row0`/`row1`/`row2`/`row3`
point before the scratch buffer.

Fix: compute the row offset in `uint64_t` before pointer arithmetic in both
`uncompress_b44_impl` (decoder) and `compress_b44_impl` (encoder).

Analysis and solution with the help of Curor / Claude Opus 4.5

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-19 14:22:40 -07:00
Christoph Gohlke 7567d41783 Fix comparison operator for buffer size check (#2307)
Signed-off-by: Christoph Gohlke <cgohlke@cgohlke.com>
2026-03-17 20:56:39 -07:00
peterhillmanandCary Phillips ab06a5d3ae don't insert name attributes into single part files (#2301)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-16 15:48:05 -07:00
Jean-Francois PanissetandCary Phillips 6926c63f71 Restore Analysis build (#2297)
Address issue [2296](https://github.com/AcademySoftwareFoundation/openexr/issues/2296):
weekly analysis_workflow.yml build was broken by the need for libopenjph, which is
not included as a pre-built dependency in the `aswf/ci-openexr:2024` images, which
expect to be used to build OpenEXR 3.2.x.

Switching to the 2026 images allows the build to complete. Also no need to get rid
of GLEW, that issue is no longer relevant in recent images.

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-16 15:47:44 -07:00
Cary Phillips 0a29a413ae Suppress deprecation warnings for isOptimizationEnabled and standard attributes (#2124)
* Suppress deprecation warnings for isOptimizationEanbled and standard attributes

The methods are deprecated for use in application code, but no reason
to pollute the build with warnings about the remaining internal usage.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Remove testOptimized.cpp/h entirely.

The test only validates the deprecated API, so it serves no purpose.

This also marks the `InputPart::isOptimizationEnabled()` as
deprecated, since all that does is call
`InputFile::isOptimizationEnabled()`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove isOptimizationEnabled() and counts from testInterleavePatterns()

This leaves test test in place since it validates interleave/unpack
coverage, but it removes the use of the deprecated API.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-16 15:01:39 -07:00
Cary Phillips 8371547b51 Fix FreeBSD build failure involving threads.h, and add FreeBSD CI build (#2300)
* Fix FreeBSD build failure involving threads.h

- internal_thread.h: skip <threads.h> on FreeBSD so the pthread
  fallback is used, avoiding -lstdthreads (fixes #2299)

- Add ci_freebsd.yml: build and test on FreeBSD via vmactions/freebsd-vm

Signed-off-by: Cary Phillips <cary@ilm.com>

* pin freebsd-vm@v1 to sha

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-16 13:28:30 -07:00
dependabot[bot]andCary Phillips 6ba3cdeb30 Bump actions/download-artifact from 8.0.0 to 8.0.1 (#2292)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-12 06:48:30 -07:00
Cary Phillips 37a6525861 Fix integer overflow in htj2k decode with width > 32767 (#2291)
Loop iterators need to be int32_t, not int16_t.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-12 06:47:25 -07:00
dependabot[bot]andCary Phillips 54dd6d7ee8 Bump scikit-build-core from 0.12.1 to 0.12.2 (#2289)
Bumps [scikit-build-core](https://github.com/orgs/scikit-build) from 0.12.1 to 0.12.2.
- [Commits](https://github.com/orgs/scikit-build/commits)

---
updated-dependencies:
- dependency-name: scikit-build-core
  dependency-version: 0.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-11 16:35:43 -07:00
dependabot[bot]andCary Phillips 145adbf72d Bump jmertic/slack-release-notifier (#2288)
Bumps [jmertic/slack-release-notifier](https://github.com/jmertic/slack-release-notifier) from 6fa159048d5313ff1177d248ad84beb627571670 to 35fad060af5559c24decdec0f701e6ba93566704.
- [Release notes](https://github.com/jmertic/slack-release-notifier/releases)
- [Commits](https://github.com/jmertic/slack-release-notifier/compare/6fa159048d5313ff1177d248ad84beb627571670...35fad060af5559c24decdec0f701e6ba93566704)

---
updated-dependencies:
- dependency-name: jmertic/slack-release-notifier
  dependency-version: 35fad060af5559c24decdec0f701e6ba93566704
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-11 16:35:00 -07:00
dependabot[bot] 3978976a04 Bump pypa/cibuildwheel from 3.3 to 3.4 (#2287)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.3 to 3.4.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v3.3...v3.4)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: '3.4'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-11 16:34:16 -07:00
Cary Phillips 69aa24a5b9 Disable visibility attributes on Windows to fix msys2 -Wattributes warning (#2281)
Skip GCC visibility (default/hidden) when _WIN32 is defined so MinGW
and msys2 builds use empty export macros and avoid 'visibility attribute
not supported in this configuration; ignored'.

Made-with: Cursor

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-05 19:30:09 -08:00
dependabot[bot]andCary Phillips b19cfec2cf Bump github/codeql-action from 4.32.4 to 4.32.5 (#2286)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.4 to 4.32.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/89a39a4e59826350b863aa6b6252a07ad50cf83e...c793b717bc78562f491db7b0e93a3a178b099162)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-05 19:29:24 -08:00
Cary Phillips 50ea61bd4d Fix build failure with glibc 2.43 due to C11 threads.h conflicts (#2262)
* Fix build failure with glibc 2.43 due to C11 threads.h conflicts

Fix conflicting once_flag, ONCE_FLAG_INIT, and call_once definitions
when building with glibc 2.43, which now includes C11 <threads.h>
support

Detect <threads.h> availability and use standard C11 thread primitives
when present, falling back to pthread or Windows implementations
otherwise CI

This also adds a new Linux build (#12) using a Fedora Rawhide container to
test against glibc 2.43

Signed-off-by: Cary Phillips <cary@ilm.com>

* revert unnecessary stylistic changes

Signed-off-by: Cary Phillips <cary@ilm.com>

* simply internal_thread.h #if logic

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add #if specific to __APPLE__; add better comments

Signed-off-by: Cary Phillips <cary@ilm.com>

* replace __APPLE__ with has_include<threads.h>

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-05 19:28:38 -08:00
Cary Phillips d1656ddcb7 Remove website_preview_link workflow (#2282)
It uses the insecure pull_request_target trigger, and the better
approach is use the GitHub App's "Show build overview in comment".

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-05 19:20:59 -08:00
dependabot[bot]andCary Phillips 5c00e3c53b Bump scikit-build-core from 0.11.6 to 0.12.1 (#2285)
Bumps [scikit-build-core](https://github.com/orgs/scikit-build) from 0.11.6 to 0.12.1.
- [Commits](https://github.com/orgs/scikit-build/commits)

---
updated-dependencies:
- dependency-name: scikit-build-core
  dependency-version: 0.12.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-02 10:14:49 -08:00
dependabot[bot]andCary Phillips a52d9d4c88 Bump jmertic/slack-release-notifier (#2284)
Bumps [jmertic/slack-release-notifier](https://github.com/jmertic/slack-release-notifier) from 5221a45213eddc6206886797beb079e091c93406 to 6fa159048d5313ff1177d248ad84beb627571670.
- [Release notes](https://github.com/jmertic/slack-release-notifier/releases)
- [Commits](https://github.com/jmertic/slack-release-notifier/compare/5221a45213eddc6206886797beb079e091c93406...6fa159048d5313ff1177d248ad84beb627571670)

---
updated-dependencies:
- dependency-name: jmertic/slack-release-notifier
  dependency-version: 6fa159048d5313ff1177d248ad84beb627571670
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-03-02 10:14:15 -08:00
Cary Phillips b9f3ff66f6 release notes and news for 3.4.6, 3.3.8, and 3.2.6 (#2280)
* release notes and news for 3.4.6, 3.3.8, and 3.2.6

Signed-off-by: Cary Phillips <cary@ilm.com>

remove glibc 2.43 fix from 3.4.6 notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix broken markdown-to-rst link conversion, and subsitute backquotes

The regular expression for link conversion needs to allow newlines in
the text.

Also, convert markdown's single-backquote to rst double-backquote

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-02 10:13:47 -08:00
peterhillman a8715ccb85 update SECURITY with CVE info for PR #2256 (#2283)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2026-03-01 19:04:53 -08:00
Cary Phillips e2606e83c1 Build oss-fuzz via oss-fuzz_build.sh (#2276)
This localizes the oss-fuzz building logic inside the OpenEXR project,
minimizing the changes we have to request of the oss-fuzz project
itself.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-03-01 13:58:44 -08:00
dependabot[bot]andCary Phillips dfc48db6b1 Bump actions/download-artifact from 7.0.0 to 8.0.0 (#2278)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/37930b1c2abaa49bbe596cd826c3c89aef350131...70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-27 11:51:49 -08:00
dependabot[bot]andCary Phillips 4a96cc9719 Bump actions/upload-artifact from 6.0.0 to 7.0.0 (#2277)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/b7c566a772e6b6bfb58ed0dc250532a479d7789f...bbbca2ddaa5d8feaa63e36b76fdaad77386f024f)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-27 11:50:53 -08:00
Cary Phillips ffe973df81 Fix install doc to note vendored OpenJPH started with v3.4.6 (#2275)
The doc was written when we planned the vendored OpenJPH to be
released in v3.4.4, but we released v3.4.5 without it. This fixes the
doc to indicate 3.4.6 instead.

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-27 11:49:50 -08:00
Cary Phillips 40574855b6 Update the vendored libdeflate to 1.25 (#2274) 2026-02-24 19:36:23 -08:00
Cary PhillipsandCursor 3b4cd1a0a4 Release Python GIL during I/O operations in bindings (#2273)
Release the GIL around OpenEXR read/write operations to allow other
Python threads to run during file I/O. This prevents the bindings
from blocking the entire Python interpreter during potentially
lengthy operations.

Operations wrapped with gil_scoped_release:
- readPixels, readTiles, readPixelSampleCounts
- writePixels, writeTiles, writeTile
- copyPixels

Also adds a test to verify the GIL is released during I/O.

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 17:23:09 -08:00
Cary PhillipsandCursor 5667a27321 Fix build failure with -march=sandybridge (#2231) (#2272)
The USE_F16C_INTRINSICS macro was incorrectly defined when __AVX__ was
set with either __GNUC__ or __clang__, even when __F16C__ was not
defined. This caused build failures on CPUs that have AVX but not F16C
(e.g., Sandy Bridge).

Fix by requiring __F16C__ to be defined (via AND) rather than being
optional (via OR).

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 14:35:15 -08:00
Cary PhillipsandCursor 9299a8258b Enable SSE2 on 32-bit x86 builds to fix test failures (#2271)
On 32-bit x86 (i386/i686), the build assumes SSE2 is available at
runtime but doesn't enable SSE2 code generation at compile time.
This mismatch causes testCPUIdent and testDWATable to fail because
the compiled code doesn't match the CPU capability detection.

Add -msse2 and -mfpmath=sse compiler flags for 32-bit x86 builds
(excluding MSVC which handles this differently). This aligns the
compiled code with the runtime expectations.

Fixes #2257

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 11:05:02 -08:00
Brunoandpeterhillman 132febd604 Mention OpenEXR dependencies on README (#2269)
* Mention OpenEXR dependencies on README

Closes: #2123
Signed-off-by: Bruno Lopes <brunvonlope@outlook.com>

* Update README.md

Co-authored-by: peterhillman <work@pedro.kiwi>
Signed-off-by: Bruno <brunvonlope@outlook.com>

---------

Signed-off-by: Bruno Lopes <brunvonlope@outlook.com>
Signed-off-by: Bruno <brunvonlope@outlook.com>
Co-authored-by: peterhillman <work@pedro.kiwi>
2026-02-24 16:06:50 +13:00
Vertexwahn 4cec5c8a21 Bazel: Use openjph 0.26.3 (#2268)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2026-02-23 17:18:13 -08:00
Cary Phillips c501616626 Add referent to OPENEXR_FORCE_EMBEDDED_CORE on install page (#2260)
Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-23 11:56:18 -08:00
Cary Phillips 632e46623a Vendor OpenJPH v0.26.3 (#2250)
Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-23 11:55:53 -08:00
Cary Phillips 764eddca85 Fix sentence fragment typo in website python docs (#2261)
* Fix sentence fragment typo in website python docs

Signed-off-by: Cary Phillips <cary@ilm.com>

* len(exrfile.parts)==1

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-23 09:26:39 -08:00
Cary Phillips 8ee7514964 Add CVE-2025-64181 to SECURITY.md (#2253)
Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-23 09:03:46 -08:00
Cary PhillipsandPeter Hillman ff22ba3a79 Add news and release notes for v3.4.5 and v3.3.7 (#2252)
* New for v3.4.5

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add notes for v3.3.7

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* Add notes for v3.4.5

Signed-off-by: Cary Phillips <cary@ilm.com>

* news for v3.4.5 and v3.3.7

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Peter Hillman <peterh@wetafx.co.nz>
2026-02-23 09:03:21 -08:00
Cary Phillips 04b2b48ba5 Fix ZipCompressor to initialize compresson type correctly (#2259)
The ZipCompressor constructor was assigning the compression type
incorrectly. THe logic between ZIP and ZIPS was reversed.

This also adds an inline function to the Compressor class to return
the compressor type.

This also adds a test to validate the Compressor object settings.

Fixes #2255 "ImfZipCompressor maps ZIP/ZIPS to the wrong OpenEXRCore
compression type (ZIP vs ZIPS swapped)"

This also revealed that the DWA and HTJ2K compressor objects set the
compression type to LAST_TYPE, for some reason. Is that an oversight?

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-23 08:59:19 -08:00
peterhillmanandCary Phillips 347befa0d7 Add sanity check for correct arguments to exrstdattr (#2263)
* validate arguments to exrstdattr

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* add test for exrstdattr argument verification

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-23 08:51:00 -08:00
dependabot[bot] 103e6db730 Bump github/codeql-action from 4.32.3 to 4.32.4 (#2264)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.3 to 4.32.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9e907b5e64f6b83e7804b09294d44122997950d6...89a39a4e59826350b863aa6b6252a07ad50cf83e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 08:49:54 -08:00
dependabot[bot]andCary Phillips 9507e51812 Bump jmertic/slack-release-notifier (#2265)
Bumps [jmertic/slack-release-notifier](https://github.com/jmertic/slack-release-notifier) from 7ed1272d4b089a8987b4c6880604cf63287b68b8 to 5221a45213eddc6206886797beb079e091c93406.
- [Release notes](https://github.com/jmertic/slack-release-notifier/releases)
- [Commits](https://github.com/jmertic/slack-release-notifier/compare/7ed1272d4b089a8987b4c6880604cf63287b68b8...5221a45213eddc6206886797beb079e091c93406)

---
updated-dependencies:
- dependency-name: jmertic/slack-release-notifier
  dependency-version: 5221a45213eddc6206886797beb079e091c93406
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-23 08:49:20 -08:00
dependabot[bot] 2c5339b8f3 Bump rules_cc from 0.2.16 to 0.2.17 (#2267)
Bumps [rules_cc](https://github.com/bazelbuild/rules_cc) from 0.2.16 to 0.2.17.
- [Release notes](https://github.com/bazelbuild/rules_cc/releases)
- [Commits](https://github.com/bazelbuild/rules_cc/compare/0.2.16...0.2.17)

---
updated-dependencies:
- dependency-name: rules_cc
  dependency-version: 0.2.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 08:48:14 -08:00
dependabot[bot]andCary Phillips dbc48c1d33 Bump rules_cc from 0.2.14 to 0.2.16 (#2227)
Bumps [rules_cc](https://github.com/bazelbuild/rules_cc) from 0.2.14 to 0.2.16.
- [Release notes](https://github.com/bazelbuild/rules_cc/releases)
- [Commits](https://github.com/bazelbuild/rules_cc/compare/0.2.14...0.2.16)

---
updated-dependencies:
- dependency-name: rules_cc
  dependency-version: 0.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-22 15:32:40 -08:00
VertexwahnandCary Phillips 63da162693 Bazel: Remove WORKSPACE.bazel file (#2258)
* Bazel: Remove WORKSPACE.bazel file

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Update Bazel version

Signed-off-by: Vertexwahn <julian.amann@tum.de>

---------

Signed-off-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-22 15:31:43 -08:00
peterhillmanandCary Phillips 2f1fe194d9 add python support for Opaque Attributes (#2249)
* add python support for OpaqueAttributes

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* add attribute of unknown type to test.exr

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* remove intermediate class; just wrap Imf::OpaqueAttribute directly

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-22 12:45:13 -08:00
Cary Phillips 3ce27a96d5 Report an error if a deep pixel as more than UINT_MAX samples (#2256) 2026-02-21 21:47:19 -08:00
Cary Phillips d30edbd7ac Rename external/OpenJPH/src/core/common to openjph, instead of using a symlink (#2225)
* Rename OpenJPH/src/core/common to openjph, instead of using a symlink

OpenJPH headers are included in application code with the openjph subdirectory:

However, in the OpenJPH source tree, the headers live under a
directory called "common", which means when OpenEXR builds the
vendored copy of OpenJPH via `add_subdirectory`, the headers aren't in
the expected "openjph" directory.

The previous solution to this was to create a symlink from "openjph"
to "common", but symlinks are fragile on Windows. If the git repo is
cloned with `core.symlinks=false`, the symlink doesn't exist.

This solution simply renames the "common" directory to "openjph" in
the vendored OpenJPH code, adjusting references to it as necessary.
The `vendor_openjph.sh` script does the proper renaming in the OpenJPH
cmake configuration.

This address the issue raised on #2193 after it was merged.

Signed-off-by: Cary Phillips <cary@ilm.com>

* check if "common" has already been renamed to "openjph"

recent releases of OpenJPH have the subdirectory named "openjph", not "common".

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-19 10:13:31 -08:00
Cary Phillips 8344966940 Fix tag check, git rm, and sed calls in vendor_openjph.sh (#2248)
- the logic of the tag check was inverted
- sed needs -i '' on macOS

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-17 08:29:34 -08:00
tylermorganwallandCary Phillips bbfe5abae8 IlmThread: fix deprecated atomic shared_ptr ops for shared_ptr (GCC 15) (#2243)
* IlmThread: avoid deprecated atomic_* overloads for shared_ptr

Signed-off-by: tylermorganwall <tylermw@gmail.com>

Use std::atomic<std::shared_ptr<T>> when available to avoid
deprecated atomic_load/atomic_exchange overloads.

Refs AcademySoftwareFoundation/openexr#1786

* IlmThread: make ThreadPool provider move atomic and simplify feature guards

Define `ILMTHREAD_HAVE_ATOMIC_SHARED_PTR` once and reuse it throughout
`IlmThreadPool.cpp` instead of repeating the feature-test expression.

For the atomic `shared_ptr` path, switch `ThreadPool::Data` move
construction from load+store+clear to a single `exchange`, so ownership
transfer is done atomically in one step.

Non-atomic code paths are unchanged.

Signed-off-by: tylermorganwall <tylermw@gmail.com>

---------

Signed-off-by: tylermorganwall <tylermw@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-16 16:19:40 -08:00
dependabot[bot]andCary Phillips 79b6d76e98 Bump actions/setup-python from 6.1.0 to 6.2.0 (#2235)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/83679a892e2d95755f2dac6acb0bfd1e9ac5d548...a309ff8b426b58ec0e2a45f0f869d46889d02405)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-16 10:11:07 -08:00
dependabot[bot]andCary Phillips feeb02a8af Bump actions/checkout from 6.0.1 to 6.0.2 (#2236)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-16 10:10:36 -08:00
dependabot[bot]andCary Phillips a40749ccd0 Bump actions/cache from 5.0.1 to 5.0.3 (#2240)
Bumps [actions/cache](https://github.com/actions/cache) from 5.0.1 to 5.0.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/9255dc7a253b0ccc959486e2bca901246202afeb...cdf6c1fa76f9f475f3d7449005a359c84ca0f306)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 5.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-16 10:09:53 -08:00
dependabot[bot]andCary Phillips 0792264bd4 Bump github/codeql-action from 4.31.9 to 4.32.3 (#2247)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.9 to 4.32.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/5d4e8d1aca955e8d8589aabd499c5cae939e33c7...9e907b5e64f6b83e7804b09294d44122997950d6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-16 10:09:08 -08:00
dependabot[bot]andCary Phillips c962ec1b19 Bump bazel_skylib from 1.8.2 to 1.9.0 (#2226)
Bumps [bazel_skylib](https://github.com/bazelbuild/bazel-skylib) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/bazelbuild/bazel-skylib/releases)
- [Changelog](https://github.com/bazelbuild/bazel-skylib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bazelbuild/bazel-skylib/compare/1.8.2...1.9.0)

---
updated-dependencies:
- dependency-name: bazel_skylib
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2026-02-16 10:07:59 -08:00
Cary Phillips 5f572b7097 Fix incorrect size check in istream_nonparallel_read (#2244)
* Fix incorrect size check in istream_nonparallel_read

`sz` was computed incorrectly when `stream_sz > 0 && nend > stream_sz`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add static_casts for conversion between uint64_t/int64_t

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2026-02-16 10:04:31 -08:00
John Mertic 36320e1f76 Fix links and formatting in CONTRIBUTING.md (#2239)
* Fix links and formatting in CONTRIBUTING.md

Updated links and corrected text formatting in the CONTRIBUTING.md file.

Signed-off-by: John Mertic <jmertic@linuxfoundation.org>

* Update CLA signing instructions in CONTRIBUTING.md

Clarify the process for signing the Contributor License Agreement (CLA) and provide updated links.

Signed-off-by: John Mertic <jmertic@linuxfoundation.org>

* Fix grammar in CLA information

Correct grammatical errors in the CLA section.

Signed-off-by: John Mertic <jmertic@linuxfoundation.org>

---------

Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
2026-02-02 09:39:26 +13:00
dependabot[bot]andCary Phillips 166bc4832c Bump actions/upload-artifact from 5 to 6 (#2222)
* Bump actions/upload-artifact from 5 to 6

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* pin upload-artifact to sha

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-12-18 17:03:35 -08:00
dependabot[bot] b9aeccb009 Bump github/codeql-action from 4.31.8 to 4.31.9 (#2224)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.8 to 4.31.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1b168cd39490f61582a9beae412bb7057a6b2c4e...5d4e8d1aca955e8d8589aabd499c5cae939e33c7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-18 13:29:23 -08:00
dependabot[bot]andCary Phillips f38a3aa1ab Bump actions/cache from 4.3.0 to 5.0.1 (#2221)
Bumps [actions/cache](https://github.com/actions/cache) from 4.3.0 to 5.0.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/0057852bfaa89a56745cba8c7296529d2fc39830...9255dc7a253b0ccc959486e2bca901246202afeb)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-12-15 13:19:22 -08:00
dependabot[bot]andCary Phillips 95db42db40 Bump msys2/setup-msys2 from 2.29.0 to 2.30.0 (#2220)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.29.0 to 2.30.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/fb197b72ce45fb24f17bf3f807a388985654d1f2...4f806de0a5a7294ffabaff804b38a9b435a73bda)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.30.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-12-15 13:18:48 -08:00
dependabot[bot] 1d0175d47d Bump actions/download-artifact from 6.0.0 to 7.0.0 (#2219)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/018cc2cf5baa6db3ef3c5f8a56943fffe632ef53...37930b1c2abaa49bbe596cd826c3c89aef350131)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 13:18:25 -08:00
dependabot[bot]andCary Phillips 153e4a8d4d Bump github/codeql-action from 4.31.7 to 4.31.8 (#2218)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.7 to 4.31.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/cf1bb45a277cb3c205638b2cd5c984db1c46a412...1b168cd39490f61582a9beae412bb7057a6b2c4e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-12-15 13:17:18 -08:00
dependabot[bot]andCary Phillips 88c89f1fca Bump actions/checkout from 6.0.0 to 6.0.1 (#2212)
* Bump actions/checkout from 6.0.0 to 6.0.1

Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v6...v6.0.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* pin checkout to 6.0.1 sha in codeql.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-12-15 13:16:37 -08:00
dependabot[bot]andCary Phillips e6888288b8 Bump github/codeql-action from 4.31.5 to 4.31.7 (#2214)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.5 to 4.31.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/fdbfb4d2750291e159f0156def62b853c2798ca2...cf1bb45a277cb3c205638b2cd5c984db1c46a412)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-12-11 14:58:09 -08:00
dependabot[bot]andCary Phillips 79d6f1faf7 Bump sigstore/gh-action-sigstore-python from 3.1.0 to 3.2.0 (#2213)
Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases)
- [Changelog](https://github.com/sigstore/gh-action-sigstore-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/f832326173235dcb00dd5d92cd3f353de3188e6c...a5caf349bc536fbef3668a10ed7f5cd309a4b53d)

---
updated-dependencies:
- dependency-name: sigstore/gh-action-sigstore-python
  dependency-version: 3.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-12-11 14:57:28 -08:00
dependabot[bot] 709327d814 Bump imath from 3.2.2 to 3.2.2.bcr.1 (#2215)
Bumps [imath](https://github.com/AcademySoftwareFoundation/Imath) from 3.2.2 to 3.2.2.bcr.1.
- [Release notes](https://github.com/AcademySoftwareFoundation/Imath/releases)
- [Changelog](https://github.com/AcademySoftwareFoundation/Imath/blob/main/CHANGES.md)
- [Commits](https://github.com/AcademySoftwareFoundation/Imath/commits)

---
updated-dependencies:
- dependency-name: imath
  dependency-version: 3.2.2.bcr.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-11 14:53:44 -08:00
Cary PhillipsandCopilot 6a5c21d31d Vendor in an internal version of OpenJPH (#2193)
* Vendor in an internal version of OpenJPH

This follows the pattern of `libdeflate`: if an external OpenJPH
installation is found, it will use that, but if none is found, it uses
the vendored code. The CMake configuration
`OPENEXR_FORCE_INTERNAL_OPENJPH=ON` forces use of the vendored
version.

The script `share/util/vendor_openjph.sh` downloads a release of
OpenJPH and adds the necessary files to the repo via git, in the
directory external/OpenJPH. It also modifies the OpenJPH config to
force a static build, so the OpenEXRCore doesn't have to.

The OpenEXRCore CMakeLists.txt adds the vendored code via
`add_subdirectory(... EXCLUDE_FROM_ALL)`, with symbols hidden.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update external/OpenJPH/src/core/coding/ojph_block_decoder_avx2.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update external/OpenJPH/src/core/coding/ojph_block_decoder_ssse3.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update external/OpenJPH/src/core/coding/ojph_block_decoder64.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update external/OpenJPH/src/core/coding/ojph_block_decoder64.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-11 14:52:40 -08:00
Kimball Thurston 6d19304586 Add option to compile c++ libraries with an embedded core library (#2216)
* Add option to compile c++ libraries with an embedded core library

Can configure with cmake -DOPENEXR_FORCE_EMBEDDED_CORE=ON

This will force symbols to be hidden in the Core library such that when
linked into the c++ shared library or other binary, they will be hidden
(as if there is no core library). This should not be the default config
but is supported for creating custom versions of exr.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Fix bazel build

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-12-11 14:51:59 -08:00
dependabot[bot]andCary Phillips 3b89eb795e Bump actions/setup-python from 6.0.0 to 6.1.0 (#2210)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/e797f83bcb11b83ae66e0230d6156d7c80228e7c...83679a892e2d95755f2dac6acb0bfd1e9ac5d548)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-25 11:56:29 -08:00
dependabot[bot]andCary Phillips fdc4363bff Bump github/codeql-action from 4.31.4 to 4.31.5 (#2209)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.4 to 4.31.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e12f0178983d466f2f6028f5cc7a6d786fd97f4b...fdbfb4d2750291e159f0156def62b853c2798ca2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-25 11:56:08 -08:00
VertexwahnandCary Phillips 5afcb90d42 Remove enable-beta-ecosystem since Bazel is no officially supported (#2208)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-25 11:55:47 -08:00
dependabot[bot]andCary Phillips 29f6cf8c07 Bump actions/checkout from 3.6.0 to 6.0.0 (#2204)
* Bump actions/checkout from 3.6.0 to 6.0.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 6.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v3.6.0...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* pin ci_workflow_old.yml to checkout v3.6.0

Signed-off-by: Cary Phillips <cary@ilm.com>

* exclude ci_workflow_old.yml from dependabot updates

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-25 11:55:08 -08:00
dependabot[bot]andCary Phillips 03cf6784be Bump openjph from 0.25.2 to 0.25.3 (#2206)
Bumps [openjph](https://github.com/aous72/OpenJPH) from 0.25.2 to 0.25.3.
- [Release notes](https://github.com/aous72/OpenJPH/releases)
- [Commits](https://github.com/aous72/OpenJPH/compare/0.25.2...0.25.3)

---
updated-dependencies:
- dependency-name: openjph
  dependency-version: 0.25.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-24 17:49:22 -08:00
dependabot[bot]andCary Phillips 6420127889 Bump github/codeql-action from 4.31.3 to 4.31.4 (#2202)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.3 to 4.31.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/014f16e7ab1402f30e7c3329d33797e7948572db...e12f0178983d466f2f6028f5cc7a6d786fd97f4b)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-24 17:48:54 -08:00
Cary Phillips c037f53988 V3.4.4 news (#2203)
* release notes for v3.4.4

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add 2198 and 2199 to release notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* News and notes for v3.4.4

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-19 17:24:14 -08:00
Aras PranckevičiusandCary Phillips 59289ebbcb OpenEXRCore: fix ILMTHREAD_THREADING_ENABLED checks (#2199)
The CMake setup is always defining ILMTHREAD_THREADING_ENABLED
macro, just to either 1 or 0 value, so checking for it via #ifdef
will always pass. The non-Core parts of the library were already
using correct checks.

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-16 17:10:33 -08:00
Aras Pranckevičius 6297537ab1 OpenEXRCore: avoid direct dependency on imath (#2198)
All other Core code uses internal_coding.h functions
half_to_float & float_to_half, in order to make it compile
when IMath is not present at all, follow the same pattern.

This dependency was accidentally introduced in #2174 and #2126

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
2025-11-16 17:09:51 -08:00
dependabot[bot]andCary Phillips 90b6738109 Bump github/codeql-action from 4.31.2 to 4.31.3 (#2196)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.2 to 4.31.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/0499de31b99561a6d14a36a5f662c2a54f91beee...014f16e7ab1402f30e7c3329d33797e7948572db)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-14 06:49:47 -08:00
Cary Phillips 533cc8e582 Add missing copywrite comments (#2194)
Results of the latest Linux Foundation license scan.

Several helper scripts need to be updated as well to properly ignore
comment lines.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-14 06:49:26 -08:00
Cary Phillips 745f247679 Add copywrite notices to website example code (#2195)
The copywrite notices should appear in the files but not on the
website pages, so the `.. literalinclude::` blocks need a ` lines: 5-`
so it skips the 5 lines of the copywrite notice and renders only the
following lines.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-14 06:48:46 -08:00
Aras PranckevičiusandCary Phillips 681d8ebf2a DWA: initialize linear/nonlinear tables at runtime (#2174)
* Move thread-safe single initialization utilities into internal_thread.h

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>

* DWA: initialize linear/nonlinear tables at runtime

DWA compression has two lookup tables for nonlinear value encoding,
each 128KB size. Initialize these tables once upon
first use of DWA compression, instead of spending 256KB if binary
size on them.

The initialization itself takes 0.47ms (Mac M4 Max).

OpenEXRCore-4_0.dylib size goes 628KB -> 370KB.

The previously used precalculated table (dwaLookups.h) still stays
in the repository, but it got moved into the tests only folder,
and the tests were changed to ensure that runtime-initialized
tables match the previous hardcoded table exactly.

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>

---------

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-14 06:48:10 -08:00
dependabot[bot] 9f56263075 Bump pypa/cibuildwheel from 3.2 to 3.3 (#2192)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.2 to 3.3.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v3.2...v3.3)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: '3.3'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-13 06:26:29 -08:00
dependabot[bot]andCary Phillips 9dcee460be Bump github/codeql-action from 3.27.9 to 4.31.2 (#2190)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.9 to 4.31.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/df409f7d9260372bd5f19e5b04e83cb3c43714ae...0499de31b99561a6d14a36a5f662c2a54f91beee)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-11 05:05:34 -08:00
dependabot[bot] 91900eeee1 Bump msys2/setup-msys2 from 2.27.0 to 2.29.0 (#2189)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.27.0 to 2.29.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/61f9e5e925871ba6c9e3e8da24ede83ea27fa91f...fb197b72ce45fb24f17bf3f807a388985654d1f2)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-11 05:05:11 -08:00
dependabot[bot]andCary Phillips d71348cc17 Bump actions/download-artifact from 4.1.8 to 6.0.0 (#2188)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.8 to 6.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/fa0a91b85d4f404e444e00e005971372dc801d16...018cc2cf5baa6db3ef3c5f8a56943fffe632ef53)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-11 05:04:33 -08:00
dependabot[bot]andCary Phillips 921b213235 Bump ossf/scorecard-action from 2.4.0 to 2.4.3 (#2187)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/62b2cac7ed8198b15735ed49ab1e5cf35480ba46...4eaacf0543bb3f2c246792bd56e8cdeffafb205a)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-11 05:04:08 -08:00
dependabot[bot]andCary Phillips 0ebd86ccad Bump actions/checkout from 2.7.0 to 5.0.0 (#2183)
* Bump actions/checkout from 2.7.0 to 5.0.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 2.7.0 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v2.7.0...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* keep ci_workflow_old.yml at 3.6 because of glibc/node24

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-11 05:03:45 -08:00
Cary Phillips b39ea96af0 Add recent CVEs to SECURITY.md (#2182)
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-11 05:02:59 -08:00
dependabot[bot]andCary Phillips f1241c226b Bump actions/upload-artifact from 4 to 5 (#2184)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-10 07:48:40 -08:00
dependabot[bot]andCary Phillips 22383cfa7d Bump actions/setup-python from 5.3.0 to 6.0.0 (#2180)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.3.0 to 6.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/0b93645e9fea7318ecaed2b359559ac225c90a2b...e797f83bcb11b83ae66e0230d6156d7c80228e7c)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-10 07:48:16 -08:00
dependabot[bot]andCary Phillips a8896d3e79 Bump pypa/cibuildwheel from 2.23 to 3.2 (#2186)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.23 to 3.2.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.23...v3.2)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: '3.2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-10 07:22:43 -08:00
dependabot[bot] 09238bb9c5 Bump actions/cache from 4.2.0 to 4.3.0 (#2185)
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/1bd1e32a3bdc45362d1e726936510720a7c30a57...0057852bfaa89a56745cba8c7296529d2fc39830)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 07:22:11 -08:00
Cary Phillips 0f5836b4a0 Properly set OpenEXR_error in legacy python API (#2171)
The OpenEXR module is installed into a subdirectory named OpenEXR. Importing via:

    import OpenEXR.OpenEXR as OpenEXR

should work but was failing because the module name is different from
what the code was expecting.g

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-09 12:31:39 -08:00
dependabot[bot]andCary Phillips 25d154ee87 Bump snyk/actions from 0.4.0 to 1.0.0 (#2178)
Bumps [snyk/actions](https://github.com/snyk/actions) from 0.4.0 to 1.0.0.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](https://github.com/snyk/actions/compare/b98d498629f1c368650224d6d212bf7dfa89e4bf...9adf32b1121593767fc3c057af55b55db032dc04)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-version: 1.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-09 12:30:50 -08:00
dependabot[bot]andCary Phillips 57aaf213ef Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.13.0 (#2177)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.3 to 1.13.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/67339c736fd9354cd4f8cb0b744f2b82a74b5c70...ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-version: 1.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-09 12:30:10 -08:00
Aous NamanandCary Phillips 6f343f9f3b Converts asserts in internal_ht.cpp to if statement that throws an exception. (#2175)
* Assert statements are converted to cause a failure in internal_ht.cpp

Signed-off-by: Aous Naman <aous@unsw.edu.au>

* Removed two throws; the third is caught in a try-catch block

Signed-off-by: Aous Naman <aous@unsw.edu.au>

---------

Signed-off-by: Aous Naman <aous@unsw.edu.au>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-09 12:29:02 -08:00
dependabot[bot]andCary Phillips e1a1c91771 Bump readthedocs/actions from 1.2 to 1.5 (#2179)
Bumps [readthedocs/actions](https://github.com/readthedocs/actions) from 1.2 to 1.5.
- [Commits](https://github.com/readthedocs/actions/compare/cc0920454cf03ca8a3fbd3cbaa2ce2e509e70636...b8bba1484329bda1a3abe986df7ebc80a8950333)

---
updated-dependencies:
- dependency-name: readthedocs/actions
  dependency-version: '1.5'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-09 12:18:35 -08:00
dependabot[bot] 2b2f1ad6cf Bump sigstore/gh-action-sigstore-python from 3.0.0 to 3.1.0 (#2181)
Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases)
- [Changelog](https://github.com/sigstore/gh-action-sigstore-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/f514d46b907ebcd5bedc05145c03b69c1edd8b46...f832326173235dcb00dd5d92cd3f353de3188e6c)

---
updated-dependencies:
- dependency-name: sigstore/gh-action-sigstore-python
  dependency-version: 3.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-09 12:17:56 -08:00
Cary Phillips 60a57e26fd Update macos-13 to macos-15-intel (#2173)
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-09 11:18:09 -08:00
Vertexwahn 497d02ba1a Imporve Bazel support (#2176)
* Bazel support: Bump openjph to 0.25.2

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Add Bazel update to dependabot

Signed-off-by: Vertexwahn <julian.amann@tum.de>

---------

Signed-off-by: Vertexwahn <julian.amann@tum.de>
2025-11-09 11:15:39 -08:00
Aras PranckevičiusandCary Phillips e1d2d2d1db B44: initialize exp/log tables at runtime (#2126)
* B44: initialize exp/log tables at runtime

B44 compression is probably very rarely used, and even when it is, the
tables are only ever used on channels marked as "linear"
(EXR_PERCEPTUALLY_LINEAR), which is not the default.

Instead of having a megabyte of source code for the tables, that take
up 256 kilobytes of library size, initialize the tables once upon
first use of B44 compression. The initialization itself takes under
a millisecond (Ryzen 5950X, Windows, build without F16C enabled even),
and is done in a thread-safe way using InitOnceExecuteOnce / pthread_once
depending on the platform.

OpenEXRCore-4_0.dll size goes 868KB -> 614KB.

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>

* Trying to fix static builds

Symbol visibility is slightly different once a C file contains
not only data, but also a function. So the tables and their
initialization need to be split into separate source files.

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>

* Fix threads=off build

The ILMTHREAD_THREADING_ENABLED is defined to 0 or 1! Which means
some already existing code within the whole library is already
wrong

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>

---------

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-05 15:31:27 -08:00
VertexwahnandCary Phillips a369e7c1a3 Bazel build: Bump openjph to 0.25.0 and libdeflate to 1.25 (#2167)
* Bazel build: Bump openjph to 0.25.0

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Bump libdeflate to 1.25

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Fix IexTest

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Introduce alias

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Rename bazelisk to bazel switch to Ubuntu 24.04

Signed-off-by: Vertexwahn <julian.amann@tum.de>

---------

Signed-off-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-11-05 08:53:17 -08:00
Cary Phillips 580cdbf796 release notes and news for v3.4.3, v3.3.6, and 3.2.5 (#2172)
* v3.2.5

Signed-off-by: Cary Phillips <cary@ilm.com>

* v3.3.6

Signed-off-by: Cary Phillips <cary@ilm.com>

* v3.4.3

Signed-off-by: Cary Phillips <cary@ilm.com>

* release notes for v3.2.5

Signed-off-by: Cary Phillips <cary@ilm.com>

* release notes for v3.3.6

Signed-off-by: Cary Phillips <cary@ilm.com>

* update release notes for v3.3.6

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add #2166 to release notes for v3.3.6

Signed-off-by: Cary Phillips <cary@ilm.com>

* Release notes for v3.4.3

Signed-off-by: Cary Phillips <cary@ilm.com>

* update v3.4.3 notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* update 3.4.3 release notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix formatting glitches

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix 3.3.6 date

Signed-off-by: Cary Phillips <cary@ilm.com>

* vix 3.3.6 date

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-05 08:32:23 -08:00
Cary Phillips f454bbb182 Fix improper use of Py_DECREF in legacy python module (#2168)
The `PyObject_StealAttrString` function called
`PyObject_GetAttrString` to get a new reference, then immediately
decrefs it and returns the pointer, which subsequent code uses,
leading to a use-after-free.

This rewrites all code that used that construct, primarily
`makeOutputFile`.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-11-03 08:30:53 -08:00
Cary Phillips c74a1e4253 Remove iex_debugTrap() function (#2151)
This is an ancient utility function that at one point served as a
debugging aide, a symbol to set a breakpoint for in the debugger. It's
problematic because it's not namespaced so it can lead to symbol
collisions when linking multiple versions of the library into a single
binary.

This is an API change, so it should only go into the next major release.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-30 15:12:26 -07:00
Cary Phillips eb0b058ff9 Only define CMAKE_DEBUG_POSTFIX if it is not already defined (#2166)
This makes it possible to set CMAKE_DEBUG_POSTFIX="", which wasn't
possible before but is desirable in the case where the debug libraries
should have the same name as the release build.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-30 15:12:01 -07:00
Cary Phillips 2904cc847c Check for image size overflow in legacy python module (#2163)
* Check for image size overflow in legacy python module

Add checks for image size overflow and additional checks for failure
conditions.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Py_ssize_t, for windows

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-30 14:52:02 -07:00
peterhillmanandCary Phillips 72aa3e78ac verify packed/unpacked size with uncompressed data (#2162)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-10-30 14:51:11 -07:00
peterhillman 556e056bb6 check storage_mode when computing chunk sizes (#2164)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2025-10-30 13:38:26 -07:00
peterhillman 16edd7b212 ImfCheckFile: handle partial deep tiles (#2161)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2025-10-29 15:51:11 -07:00
Kimball Thurston fffdcf2f07 Fix issues with negative coordinates and sampling != 0 (#2160)
* remove unused variable

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* allow a single line when positions are negative with large y sampling > height

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-10-27 07:49:19 -06:00
Joshua Rogers 60b986fb34 Fix memset in exr_read_chunk when nread is negative (#2159) 2025-10-26 09:22:50 -07:00
Cary Phillips 9762558b37 Fix bug with re-reading scanline file with a different set of channels (#2150)
* Fix bug with re-reading scanline file with a different set of channels

Fixes #2141.

The `first` flag in the `ScanLineProcess` object should be reset to
false in `ScanLineInputFile::setFrameBuffer()`, so subsequent calls to
`readPixels()` do the proper initialization.

Also adds a test, which fails without the fix in
`ScanLineInputFile::setFrameBuffer()`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* replace first=true with singleScan.reset()

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-25 15:43:48 -07:00
Cary Phillips b3a19903db Fix handling of corrupt RLE data (#2156)
* Fix handling of corrupt RLE data

If the size of the uncompressed RLE data does not match the expected
output size, the chunk is corrupt, so report an error.

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove packsz>0 because of the packsize==0 above

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-23 14:27:04 -07:00
Cary Phillips fd657e8a41 Release notes and news for v3.4.2 (#2152)
* Add news for v3.4.2

Signed-off-by: Cary Phillips <cary@ilm.com>

* release notes for v3.4.2

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-20 14:39:05 -07:00
VertexwahnandCary Phillips 37ccf5c710 Update Bazel dependencies (#2146)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-10-13 10:04:36 -07:00
Cary Phillips 3ef13a8433 Make the release.py generic, so it works with Imath (#2143)
This is a helper script that runs the gh cli to create draft releases,
update news items, and format message.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-13 09:57:24 -07:00
Cary Phillips c13cc7128d Release notes and website news for v3.4.1 (#2142)
* release notes for v3.4.1

Signed-off-by: Cary Phillips <cary@ilm.com>

* add 2139 and 2140 to notes for v3.4.1

Signed-off-by: Cary Phillips <cary@ilm.com>

* news for v3.4.1

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-13 09:57:07 -07:00
Matt Johnson 9fb611aef6 handle CMake CREATE_LINK failures for openjph headers (#2144)
CMake's `file(CREATE_LINK ... SYMBOLIC)` function can fail in some
cases, notably on Windows which seems to require that developer mode be
enabled in order to create symbolic links. It can return a status code
though which can be checked to determine whether the symlink was created
successfully or not, so if it reports that it failed we can fallback to
a regular COPY. CREATE_LINK does have a COPY_ON_ERROR option, but that
is only intended for individual files and will not copy an entire
directory's contents, which is what is needed in this case.

Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
2025-10-13 09:56:04 -07:00
Cary Phillips e531b2cab3 Fix doxygen/sphinx/rst website issues (#2139)
Something seems to have gotten more sensitive. Readthedocs has
processed this fine, but building locally now reports several
problems:

* Doxgen argument mismatch in src/lib/OpenEXRCore/internal_ht.cpp: size vs sz

* SPHINX_CONF_PY_FILE was undefined, leading to an empty
  MAIN_DEPENDENCY for the sphinx-build command, silently ignored
  before.

* Missing backquote in website/install.rst

* Duplicate hyperlinks named `here` in website/news.rst

* A problem with subheader delimiters in website/news.rst

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-06 20:35:36 -07:00
Cary Phillips c43a73f22c Update HELP2MAN_URL in install_help2man.sh (#2140)
Downloading from ftp.gnu.org has been timing out, and it turns
out it's known to be slow. https://mirror.cs.odu.edu is apparently
more reliable.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-06 20:34:10 -07:00
Cary Phillips 932c3fb0a2 Include the openjph headers from the openjph folder, required for OpenJPH 0.23+ (#2136)
* Fix openjph include directory

This fixes the openjph includes to look in the openjph folder:

This worked in earlier releases because OpenJPH 0.22 and before
appended openjph to the INTERFACE_INCLUDE_DIRECTORIES in its exported
cmake config, but this is fixed in OpenJPH 0.23.

Rather than complicate the OpenEXR source files, this fixes the
problem in the cmake config for the earlier versions by manually
stripping the "openjph" from the include directory setting.

However, when building OpenJPH via FetchContent, the headers reside in
src/core/common directory in the OpenJPH source tree, not in an
openjph folder, so this creates a symlink in the openjph source folder
in this case.  Note that the longer (hopefully not too much longer)
term plan is to vendor in the openjph source and dispense with the
FetchContent altogether, so this code can be removed then.

I've tested this with OpenJPH 0.22.0, 0.23.1, and 0.24.1 in both the
case of fetch/internal build and building against an external
installation.

Signed-off-by: Cary Phillips <cary@ilm.com>

* bazel: bump openjph to 0.24.1

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-05 18:52:09 -07:00
NeroBurner 9550627354 cmake: remove trailing spaces (#2127)
Cosmetic change, no change in functionality.

Remove the trailing spaces in comments in `CMakeLists.txt`

Signed-off-by: Reinhold Gschweicher <pyro4hell@gmail.com>
2025-10-05 11:05:27 -07:00
Cary Phillips 4994b291b8 Bump macos runners to 14 and 15, drop 13 (#2137)
* Bump macos runners to 14 and 15, drop 13

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add a macos-15-intel job

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-10-05 07:28:44 -07:00
Vertexwahn 5bd9a67e04 Bazel cleanup (#2138)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2025-10-04 17:08:17 -07:00
Cary Phillips b893bda1ab Bump version on main branch to 4.0.0 (#2117)
The RB-3.4 branch has been made, so the version on the main branch
should go up.  The version on the main branch should be the *next*
release, after the upcoming v3.4 release.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-05 10:43:55 -07:00
Cary Phillips f91e1581f4 News for v3.4.0 release (#2119)
And update the references to v3.4 upon release.

Plus, a few updates to the news.rst file and the release.py script
that generates the news item from the release notes.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-05 10:43:29 -07:00
Cary Phillips 3e63acd6b1 Add section on OpenEXR/Imath version compatibility to install instructions (#2107)
* Add section on OpenEXR/Imath version compatibility to install instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

* rearrange and clarify OpenEXR/Imath version combos

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix formatting

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove test image repo; mention vendored libdeflate

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-05 10:39:16 -07:00
Cary Phillips 4dd4305f88 fix formatting in release notes (#2118)
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-02 16:47:56 -07:00
Cary Phillips 40cbd96d92 CI fixes: (#2116)
* missing OPENEXR_IMATH_VERSION_PATCH
* run python wheels workflow even on release branch

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-02 14:56:15 -07:00
Cary Phillips 9fcb1b0abb Release notes for v3.4 (#2108)
* Release notes for v3.4

Signed-off-by: Cary Phillips <cary@ilm.com>

* add 2104

Signed-off-by: Cary Phillips <cary@ilm.com>

* address Peter's suggestions

Signed-off-by: Cary Phillips <cary@ilm.com>

* add 2112-2115 to v3.4

Signed-off-by: Cary Phillips <cary@ilm.com>

* update title of #2115

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-02 13:35:23 -07:00
Cary Phillips 32760d4944 Move openjph to Requires.private in OpenEXR.pc (#2115)
* Remove openjph from OpenEXR.pc

It's not a part of the public interface, so it's not necessary for
application.

Also, since src/lib/OpenEXRCore/CMakeLists.txt declares OpenJPH as
private:

 target_link_libraries(OpenEXRCore PRIVATE ${EXR_OPENJPH_LIB})

it is *not* necessary in the `target_link_libraries(PUBLIC)`
declaration in cmake/LibraryDefine.cmake, so this change removes it
there.

This also adds a ci test to validate the OpenEXR.pc.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add EXR_OPENJPH_PKGCONFIG_REQUIRES to Requires.private

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add -static to validate_pkgconfig.sh for static builds

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-02 13:34:35 -07:00
Cary Phillips da818d1550 Improve handling of Imath and OpenJPH library versions (#2113) 2025-09-01 18:16:40 -07:00
Cary Phillips 76f3410aca Remove openjph includes from ImfHTCompressor.h (#2114)
These appear to have been left in ImfHTCompressor.h inadvertently from
an earlier implementation:

    #include <ojph_codestream.h>
    #include <ojph_file.h>

They aren't necessary, and they inject an unnecessary compile-time
dependence on the openjph headers.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-09-01 16:21:31 -07:00
Cary Phillips da32c659b5 Fix compiler warnings (#2112)
* Fix compiler warnings

* static_cast for signed/unsigned integer comparisons
* remove unused variables
* fix order of member initialization
* use override instead of virtual
* printf %d -> %ld
* clang pragmas

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix use of int vs size_t

Signed-off-by: Cary Phillips <cary@ilm.com>

* use palemieux's suggestions

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-31 17:53:54 -07:00
Pierre-Anthony Lemieux 637b0718b2 Add support for 32-line HTJ2K Compressor (#2104)
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2025-08-28 11:05:38 -07:00
dependabot[bot]andCary Phillips d3f8a8ef41 Bump scikit-build-core from 0.11.5 to 0.11.6 (#2106)
Bumps [scikit-build-core](https://github.com/orgs/scikit-build) from 0.11.5 to 0.11.6.
- [Commits](https://github.com/orgs/scikit-build/commits)

---
updated-dependencies:
- dependency-name: scikit-build-core
  dependency-version: 0.11.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-08-26 13:25:44 -07:00
Kimball ThurstonandCary Phillips ced50a0842 remove extra allocation, fix invalid dereference on corrupt file (#2103)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-08-26 13:25:03 -07:00
Kimball ThurstonandCary Phillips ac3d491262 add fallback catch to avoid exceptions from crossing C boundary (#2102)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-08-26 13:24:37 -07:00
peterhillman 7d04f3c752 Add details about branches to install instructions (#2105)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2025-08-26 10:52:04 -07:00
Todica IonutandCary Phillips e8e0b99fdd documentation install OpenJPH (#2099)
* documentation install OpenJPH

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

* Mention that openjph is v3.4

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-08-15 09:00:56 -07:00
Cary Phillips 69aaa6c48b Properly implement header_only for python module's OpenEXR.File (#2094)
When `OpenEXR.File` opens a file, it now holds onto the
`MultiPartInputFile` object (deleted by the destructor when the `File`
goes out of scope), so that a subsequent `write` operation can call
`copyPixels` on it to transfer the image data from the input to the
new output file.

A new test in `src/wrappers/python/test/test_unittest.py` validates
the behavior with a muli-part file.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-14 21:39:39 -07:00
Pierre-Anthony Lemieux 0afe0a28e3 Bump OpenJPH to 0.21.5 (#2097)
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2025-08-14 21:32:47 -07:00
Cary Phillips 290efa730c Fix python module to allow empty part name for single-part file (#2090)
Files with a single part allow the part name to be empty. Part names
are only required if there is more than one part.

Addresses #2089.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-14 18:23:46 -07:00
Cary Phillips de5023549e Create symlink for the add_subdirectory CI test in the CI step (#2098)
A permanent symlink in the src/test tree causes problems, better to
create it explicitly during the test.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-14 17:25:52 -07:00
Benedikt KrengelandCary Phillips 8c2e0f375e docs: fix incorrect function names in C API docs (#2095)
Replace old function names in the C API docs:

  exr_read_scanline_block_info() → exr_read_scanline_chunk_info()
  exr_read_tile_block_info()     → exr_read_tile_chunk_info()

Signed-off-by: Benedikt Krengel <74617304+benekreng@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-08-14 09:53:35 -07:00
Cary Phillips ed0160fa39 Update CVE links in SECURITY.md to https://www.cve.org (#2093)
The initial posting of the CVEs went out before the cve.org pages were
published.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-13 11:13:28 -07:00
Cary Phillips 346ff61938 Add CI test to validate cmake add_subdirectory(openexr) (#2088)
This adds a test in `src/test/subdirectory` that builds the
`exrwriter` example program with a CMake configuration that references
openexr via:

  add_subdirectory(openexr)

Note that the existing website example program uses
find_package(openexr). This compiles the same program (via a symlink
to the source), but with a different CMakeLists.txt. The `openexr`
submodule in the test directory is simply a symlink to the top-level
repo.

This change also introduces an option to specify the cmake version for
each job, and adds tests for cmake 3.14.7 and 4.0.3.

NOTE: This behavior currently does not work with cmake 3.26+, so the
"cmake 4" CI job fails, but the fix is in PR #2087 (Fix aliases for
IexConfig and IlmThreadConfig).

Also, this changes the example `README.md`/`exrwriter.cpp` code to use
the `OPENEXR_IMF_NAMESPACE` rather than a hard-coded `Imf`, so we now
validate the behavior of specifying an explicit alternative namespace
for downstream applications.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-13 11:13:00 -07:00
Cary Phillips ef6ba3b133 Add CI jobs for C++20, and build tools/tests against standard (#2083)
* Add CI jobs for C++20, and build tools/tests against standard

The `OPENEXR_CXX_STANDARD` was not getting set for the bin tools and
tests, which it should, to ensure the entire suite builds in the given
environment. This consolidates the logic for building the bin tools
into a function in the src/bin/CMakeLists.txt file.

Also, the minimum CXX version was being silently bumped up to 17,
which seems wrong. If you specified c++11 or c++14 for some reason, it
should do what you say and fail. The code still builds for 11 and 14,
since we haven't yet introduced any features that require 17+, even
though we state 17 as the project minimum.

The C++20 CI jobs build the library and tests but don't *execute* the
tests, just to save execution cycles.

TODO: We should make a larger refactor of the CI to run a more
exhaustive combination of compiler/system/configuration options on
release candidates, and leave a short list of the most-likely-to-fail
tests to run on each PR. But that's for a separate PR.

Also, it looks like the OPENEXR_INSTALL options were duplicated
between `OpenEXRSetup.cmake` and the root `CMakeLists.txt`, so this
cleans that up as well.

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove blank lines

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-13 09:49:03 -07:00
Cary PhillipsandDoug Walker c00f6aa521 Add colorInteropID standard attribute (#2075)
* Add colorInteropID standard attribute

See https://lf-aswf.atlassian.net/wiki/spaces/CIF/overview for discussion

TODO: fill in the proper documentation

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update website/TechnicalIntroduction.rst

Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update website/StandardAttributes.rst

Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update website/StandardAttributes.rst

Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update src/lib/OpenEXR/ImfStandardAttributes.h

Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update src/test/OpenEXRTest/testStandardAttributes.cpp

Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update src/lib/OpenEXR/ImfStandardAttributes.h

Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Add note that colorInteropID is new in v3.4

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
2025-08-12 14:49:43 -07:00
Cary Phillips fe176989fe Fix aliases for IexConfig and IlmThreadConfig (#2087)
These have been incorrectly specified from the project's earliest
cmake configuration as:

  add_library(${PROJECT_NAME}::Config ALIAS IexConfig)
  add_library(${PROJECT_NAME}::Config ALIAS IlmThreadConfig)

but these conflict with:

  add_library(${PROJECT_NAME}::Config ALIAS OpenEXRConfig)

Each duplicating a declaration of OpenEXR::Config. These have likely
never been used. This changes updates them to what was likely original
intention:

  add_library(Iex::Config ALIAS IexConfig)
  add_library(IlmThread::Config ALIAS IlmThreadConfig)

CMake prior to 3.26 didn't complain, but 3.26+ has new aliasing
features which encounter the problem when OpenEXR is configured in an
application via `add_subdirectory(openexr)`.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-08-05 14:17:39 -07:00
Pierre-Anthony Lemieux b99325f1f1 Fix HTJ2K chunk header length error and group common HTJ2K functions (#2086)
* Fix HTJ2K chunk header length computation

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Group common HTJ2K functions

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

---------

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2025-08-02 20:17:32 -07:00
Cary Phillips 9dd63df87b Standardize handling of directories and paths in ci_steps.yml (#2066)
Rather than explicitly stating each step's working directory, use use
BUILD_DIR and INSTALL_DIR env vars. It's easier to follow this way.

Also, Windows requires explicitly setting the PATH before running
ctest and before executing the website example. Set OPENEXR_PATH to
have the necessary components. Because the PATH can get modified
internally by GitHub actions, it's easiest to gather the path setting
into a variable and set it explicitly just before execution.

This also renames the "ubuntu" install manifests to "linux".

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-07-31 13:45:24 -07:00
Cary Phillips 81711da788 Helper script release.py to automate release notes steps (#2079)
* release.py notes <tag> - extract release notes from CHANGES.md for the tagged release, print to stdout
* release.py news <tag> - edit the website/news.rst file to add reference to the tagged release
* release.py draft <tag> - create a draft release on GitHub
* release.py candidate <tag> - format a message about the upcoming release, print to stdout

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-07-31 08:50:55 -07:00
Cary Phillips 52c8e3a06d Add CVEs from OSTIF report to SECURITY.md and CHANGES.md (#2084)
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-07-31 08:27:23 -07:00
Barnaby Robson d160a8f543 OpenEXR - Adds New Bytes Attribute (#2074) 2025-07-30 20:14:49 -07:00
Cary Phillips 30500b1319 V3.3.5 news and release notes (#2078)
* v3.3.5 notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* update v3.3.5 release date

Signed-off-by: Cary Phillips <cary@ilm.com>

* news for v3.3.5

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-07-26 14:29:44 -07:00
dependabot[bot]andCary Phillips f1acb9da52 Drop support for python 3.7; add support for python 3.13 (#2070)
* Bump scikit-build-core from 0.10.7 to 0.11.5

Bumps [scikit-build-core](https://github.com/orgs/scikit-build) from 0.10.7 to 0.11.5.
- [Commits](https://github.com/orgs/scikit-build/commits)

---
updated-dependencies:
- dependency-name: scikit-build-core
  dependency-version: 0.11.5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* drop python 3.7; add python 3.13

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-07-24 12:50:18 -07:00
Nikolaos Koutsikos 5c69285235 Deep Scanline Input file read memory leak fix (#2069)
The Deep Scanline Input file read with an externally provided framebuffer was
leaking lots of memory. The reason was the Scanline process, which has a
boolean member variable check in its destructor that controls whether the
member buffers will be freed or not.
However this boolean member variable was never set in the code path that uses
an externally provided framebuffer, making Deep reading leaking massive amounts
of memory.
This commit fixes the memory leak issue, but setting the member variable after
the decoding initialisation.

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
2025-07-20 14:42:47 +12:00
Pierre-Anthony Lemieux fd6a33f18d Add HTJ2K Compressor support to Tiled images (#2072)
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2025-07-10 14:50:09 -07:00
Pierre-Anthony Lemieux 45ee12752f Remove realloc from HTJ2K coder (#2061)
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2025-06-26 12:17:49 -04:00
Cary Phillips d8a59968fe Update legacy Windows CI job from vfx2022 to vfx2023 (#2067)
GitHub is deprecating windows-2019 runner, so drop coverage for VFX 2022.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-06-17 11:54:21 -07:00
Cary Phillips 30d2c46eb7 v3.3.4 release notes and news (#2062)
* v3.3.4 news

* Release notes for v3.3.4

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-06-16 17:15:33 -07:00
Cary Phillips 9a34956d86 Improve example reader code in README.md/website, and add to CI (#2064)
This makes a better "hello, world" example writer program, creating a
non-square image to differentiate between x and y, and also provides a
visual example of what the resulting image looks like: a 100x50 image
with horizontal stripes 5 pixels high.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-06-14 16:40:46 -07:00
Cary Phillips 1acd251c26 Fix problem with OpenJPH downstream dependency (#2063)
* Fix problem with OpenJPH downstream dependency

The dependency on OpenJPH was not properly propogated to downstream
projects, so applications building against an installation of OpenEXR
that was in turn build against an external installation of OpenJPH
would fail to find openjph.  Linux is forgiving, but macOS and Windows
would fail.

There necessary `target_link_libraries()` and `find_dependency()` were missing.

This also cleans up the configuration "find" and "fetching" status
messages and makes them consistent across Imath, libdeflate, and
OpenJPH.

This also renames `OPENEXR_OJPH_REPO' to `OPENEXR_OPENJPH_REPO' and
`OPENEXR_OJPH_TAG' to `OPENEXR_OPENJPH_TAG', for consistency.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add comments to the install scripts

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-06-14 14:45:59 -07:00
Cary Phillips 85ed7a429b Add macOS universal2 build to CI, and bump OpenJPG to 0.21.3 (#2058)
Universal2 builds with CMAKE_OSX_ARCHITECTURES=x8664;arm64.

OpenJPH failed with this until 0.21,3

Technically, the cibuildwheel action does this but failure messages there
are  harder to parse, so better to treat it as a first-class CI check.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-06-13 11:17:39 -07:00
Nikolaos KoutsikosandCary Phillips 9bf37a31cd OpenEXRCore Deep pixel unpacking optimisation (#2049)
* Refactor UNPACK_SAMPLES macro to allow code reuse.

Breaking each case of the UNPACK_SAMPLES macro into seperate smaller macros
that can be reused to avoid code duplication.

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>

* Refactor some common code out in a macro

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>

* Optimise EXRCore Deep pixel unpacking

The functions for doing Deep pixel unpacking, had two branch checks (switch
statements) for checking the pixel and requested data type within the inner
most loop that goes over the pixels of each line. This is definitely
unnecessary, since the data types remain the same. However the compiler
is not able to optimise this, and the generated assembly for the pixel
for loop is massive since it contains all these branch checks.
This commit fixes this issue by moving the two switch statements outside
of the pixel for loop, which makes the compiler able to generate much more
efficient assembly for the pixel unpacking operations.

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>

---------

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-06-13 11:11:12 -07:00
Kimball ThurstonandCary Phillips ca971c4260 Add vendored deflate (#2037)
* wip: start tooling to manage vendored libraries

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Initial version to switch compiling to enable a vendored deflate

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* remove old method of including external deflate source

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* tell bazel to use external deflate

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* avoid issue compiling on a mac

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-06-12 08:31:48 -07:00
LI JIandCary Phillips 75e917abcc Supplemental to 2051: Adjust the "Unknown" compression threshold to 11 (#2053)
* adjust "Unknown" cutoff to be 11 (0x0A)

Signed-off-by: lji <lji@ilm.com>

* Update src/lib/OpenEXRCore/debug.c

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: LI JI <146397706+lji-ilm@users.noreply.github.com>

---------

Signed-off-by: lji <lji@ilm.com>
Signed-off-by: LI JI <146397706+lji-ilm@users.noreply.github.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-06-08 18:28:15 -07:00
Nikolaos Koutsikos ef8cfd2afe Fix Deep Scanline Input crash when using a framebuffer as parameter (#2019)
* Fix Deep Scanline Input crash when using an externally allocated framebuffer

The Deep Scanline Input code has recently been rewritten to make use of the
EXR core library. As a result a bug was introduced when using the overloads of
readPixels() and readPixelSampleCounts() that use externally provided
framebuffers as parameters, a hard crash was occuring. According to the comment
on the header of these functions, when these overloads are used the InputFile's
frameBuffer is not used.
However both these functions call into readMemData(), which does use the
InputFile's member framebuffer, which has not been allocated, resulting into a
segmentation fault.
This commit fixes the above issue, by using the parameter framebuffer that is
passed in, which should be allocated by the caller application.

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>

* Add a Deep Scanline Input test that uses a framebuffer parameter

After having found a bug with the readPixels() and readPixelSampleCounts()
overloads that receive a framebuffer parameter, it was made apparent that there
was a hole in our tests to cover these functions.
This commits slightly refactors the DeepScanLineBasic tests and adds a third
read path to add coverage for this case as well.

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>

---------

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
2025-05-28 10:42:27 +12:00
LI JI d0e2e53bdd add htj2k as one of the compression names (#2051)
Signed-off-by: lji <lji@ilm.com>
2025-05-27 16:59:08 -04:00
Cary Phillips b8392c850e Rename "HT256" to "htj2k" (#2048)
This renames the new compression to "htj2k". The discussion on this
concluded that the most significant aspect of the code is the "j2k"
part. The "256" part indicates the number of scanlines per chunk, but
should that should be regarded as the implicit default. Should we ever
introduce a j2k codec with a different scanline count, we can include
that non-default number in the name then.

From the htj2k-beta branch, this renames:

* "ht256" as a compression string name to "htj2k"
* HT256_COMPRESSION to HTJ2K_COMPRESSION
* EXR_COMPRESSION_HT256 to EXR_COMPRESSION_HTJ2K

NOTE: existing files written by applications build against the
htj2k-beta branch will not be readible by applications built with the
library going forward!

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-05-27 10:13:17 -04:00
50ba96b1db merge htj2k-beta branch with main (#2041)
* Add HTJ2K Compressor (#1883)

* Add HT256 compressor

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Update src/lib/OpenEXR/ImfCompression.h

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Update src/lib/OpenEXR/ImfCompression.cpp

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Update website/ReadingAndWritingImageFiles.rst

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Add channel map

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

---------

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Co-authored-by: Cary Phillips <cary@ilm.com>

* Bump OpenJPH (#1978)

* Bump OpenJPH to 0.21.2 (#1994)

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Rebase htj2k-beta onto main (#2033)

Signed-off-by: Cary Phillips <cary@ilm.com>

* Improve RGB channel detection heuristics for the HT256 encoder (#2029)

* Allow lowercase r,g and b, and reg, greee and blue.

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Improved RGB channel detection heuristics

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Fix Windows build

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Improve RGB heuristics
Add unit tests

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Removed unusued color channel abbreviations

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

---------

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>

* Fix HTJ2K Compressor python (#2038)

* HT256 COMPRESSION

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

* HT256 Compression fix

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

---------

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

* resolve conflicts

Signed-off-by: Cary Phillips <cary@ilm.com>

* OPENEXR_FORCE_INTERNAL_OPENJPH in pyproject.toml

Signed-off-by: Cary Phillips <cary@ilm.com>

* POSITION_INDEPENDENT_CODE=ON for openjpg and OpenEXR.so

Signed-off-by: Cary Phillips <cary@ilm.com>

* CMAKE_VERBOSE_MAKEFILE=ON

Signed-off-by: Cary Phillips <cary@ilm.com>

* Disable macos universal2 cibuildwheel, doesn't work with openjph

Signed-off-by: Cary Phillips <cary@ilm.com>

* add openjph to OpenEXR.pc

Signed-off-by: Cary Phillips <cary@ilm.com>

* using ubuntu-latest for website.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

* website.1

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
Co-authored-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Co-authored-by: Todica Ionut <todicaionut2000111@gmail.com>
2025-05-22 17:37:59 -07:00
Cary Phillips b66d0f275b Use default generator for oss_fuzz (#2047)
It appears ninja is not supported.

Also, fix test_build.sh; SRC is the parent of openexr, not the repo
itself. And add diagnostic output to cmake as well.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-05-22 14:09:13 -07:00
Cary Phillips 1d5bb79d3b Improve reliability/readability of bin tests scripts and failure output (#2044)
* Improve reliability and readability of bin tests scripts and failure output

The src/test/bin tests have been failing intermittently in the CI
checks, and the problem appears to be known instability in CMake's
file(DOWNLOAD) when invoked from processes in GitHub actions. The
downloaded files occasionally have 0 size.

This change brings the test images into the git repo rather than
downloading them from
https://github.com/AcademySoftwareFoundation/openexr-images at
configure time. I did that way originally to avoid repo bloat, so I
trimmed the list of files used by the tests, so the additional data is
not that signifiant, a few Mb.

This also restructures the test scripts to produce more informative
output, and restructures the CI steps to make it easier to navigate
the logs.

Signed-off-by: Cary Phillips <cary@ilm.com>

* put bin test images in dict; label tests with OpenEXR.bin

Signed-off-by: Cary Phillips <cary@ilm.com>

* typo

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-05-22 06:23:50 -07:00
Nikolaos KoutsikosandCary Phillips a729f91072 Enable vectorisation for ZIP reconstruct stage on Windows (#2043)
* Enable vectorisation for ZIP reconstruct stage on Windows

The __SSE4_1__ macro that is used to control the use of the vectorised version
of the reconstruct() function, is only defined for GCC and clang. As a result,
Windows were using the scalar version, which is less performant.
This commit fixes the above issue by adding a check for MSVC, similar to what
we have on the SSE2 macro check (and in other places in the code base).

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>

* Applying simple const correctness to internal_zip

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>

---------

Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-05-21 16:36:08 -07:00
Cary Phillips 80b2c94d1c Use CMake to build oss-fuzzers (#2042)
* Using CMake to build oss-fuzzers

The oss-fuzz build script
https://github.com/google/oss-fuzz/blob/master/projects/openexr/build.sh
currently had hard-coded compile/link commands with explicit
references to libraries and include directories. This requires
updating when anything about the link process changes, i.e. we add
OpenJPH. Better to just use CMake to build the fuzzer binaries.

In a separate PR to the OpenEXR oss-fuzz project, I'll update the
build.sh to simply build via CMake and provide the LIB_FUZZING_ENGINE
as a cmake command-line option.  This only builds the fuzzers if
OPENEXR_OSS_FUZZ_LIB_FUZZNG_ENGINE is set.

Signed-off-by: Cary Phillips <cary@ilm.com>

* add ozz_fuzz target and install component, and move oss-fuzz to src/test

Signed-off-by: Cary Phillips <cary@ilm.com>

* add test_build.sh, and a symlink for the current build.sh

Signed-off-by: Cary Phillips <cary@ilm.com>

* use CMakePresets.json for oss_fuzz options

Signed-off-by: Cary Phillips <cary@ilm.com>

* typo

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-05-21 16:30:08 -07:00
vlazar-ilm 5a39521804 Fix crash in exrmetrics when running in single part mode. (#2046)
* Fix crash in exrmetrics when running in single part mode.

Signed-off-by: Vlad Lazar <vlazar@ilm.com>

* Add a python test

Signed-off-by: Vlad Lazar <vlazar@ilm.com>

---------

Signed-off-by: Vlad Lazar <vlazar@ilm.com>
2025-05-21 13:03:55 +12:00
Kimball Thurston 39b9d241cd Allow partial reconstruction of the chunk table to succeed (#2036)
* Allow partial reconstruction of the chunk table to succeed

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Update implementation to only update fixed entries

When a partial reconstruction happens, only update the fixed entries. If
it is a complete reconstruction, can copy full array blindly.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-05-16 13:07:25 -07:00
Cary Phillips 310e3bd3ec Fix handling of /EHsc and /MP flags (#2021)
These flags are now specified via a generator expression, so they are
only applied to C++ compilation, not CUDA.

This also makes the flags PRIVATE, not PUBLIC. They should not affect
dependant projects, so they should not be a part of the public
interface.

Resolves #2018

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-04-12 21:48:39 -07:00
Cary Phillips d5b059dbf0 Fix quoting an cmake args in ci_workflow.yml (#2017)
Collect args into a list and then join them into a single string with
each entry quoted.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-04-12 21:47:55 -07:00
Kimball Thurston 3f1d975557 Address mingw32 issues (#2016)
* fix minor compile warnings

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* update mingw toolchain example

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* refactor compile ifdefs to work with i686 and no sse

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* force sse2 and re-enable testing for mingw32

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-04-06 14:07:27 +12:00
Cary Phillips 44ac2309e9 Add MSYS2 jobs to CI (#2014)
* Add MSYS2 jobs to CI

Build with MINGW32 and UCRT64, both shared and static.

The MINGW32 build will fail until PR 2013 is merged.

This is not quite complete, because even with PR #2013,
OpenEXRCore.testDWATable fails under MINGW32. In that case, the test
step is et to continue-on-error until this can be resolved.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Install cc, cmake, imath, and libdeflate via pacboy

Signed-off-by: Cary Phillips <cary@ilm.com>

* Install imath/libdeflate via pacboy only if not forcing internal build

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-04-05 15:04:47 -07:00
Kimball Thurston 5a675d69d3 simplify atomic pointer code for the chunk table (#2013)
* simplify atomic pointer code for the chunk table

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* remove out-dated comment

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-04-01 07:44:25 -07:00
Cary Phillips 1e1ca4a145 Fix botched htj2k news title (#2012)
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-03-26 11:48:01 -07:00
Cary Phillips 75b70c6cba v3.3.3 notes news (#2010)
* Release notes for v3.3.3

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix typos in notes; mention arm64 python

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update notes with recent PRs

Signed-off-by: Cary Phillips <cary@ilm.com>

* News for v3.3.3

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-03-24 21:14:38 -07:00
Cary Phillips 0b83825919 Fix python publishing workflows to work with ARM (#2007)
- Remove explicit CIBW_ARCHS_LINUX from wheel publishing
  workflows. Before the addition of the arm build, these simply stated
  the default so the weren't necessary, but on arm they're incorrect.

- Fix the names of the download artifacts, and add missing steps for
  the arm builds.

- Explicitly set MACOSX_DEPLOYMENT_TARGET. It's set in pyproject.toml,
  but that seems to not be sufficient.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-03-22 09:01:34 -07:00
Cary Phillips 44bf398506 Update cibuildwheel to v2.23 for arm support (#2005)
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-03-22 09:00:47 -07:00
Todica Ionut 4ddc29ca9a Update news and requirements source (#2003)
* docs to website

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

* docs to website

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

* Fix Typo docs to website

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

* website to docs

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

---------

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
2025-03-19 16:09:59 -07:00
Sergey Fedorov 783c6f4c6b exrmetrics: fix isinf (#2002)
Signed-off-by: Sergey Fedorov <barracuda@macos-powerpc.org>
2025-03-14 16:58:23 -07:00
Cary Phillips a002f35dc8 Fix missing variables in install manifests (#1999)
These apparently got overlooked when originally committing these
install manifests, and the test didn't fail because the numbers happen
to match as is, but that won't be the case going forward.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-03-14 12:16:48 -07:00
peterhillman 474dd65dde support subsampling in exrmetrics (#2001)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2025-03-14 10:14:37 -07:00
Christopher SchwartzandCary Phillips 279644cb38 Fix reading EXR images on 32bit Windows with OpenEXR 3.3 (#1952)
* Fix issue with atomic_compare_exchange_strong due to inappropriate type on 32 bit platforms

Signed-off-by: Christopher Schwartz <christopherschwartz@xrite.com>

* Change casted type to match the type of the assigned to variable on both, 32 and 64 bit platforms

Signed-off-by: Christopher Schwartz <christopherschwartz@xrite.com>

---------

Signed-off-by: Christopher Schwartz <christopherschwartz@xrite.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-03-11 13:39:12 -07:00
Kimball ThurstonandCary Phillips b3371beee2 Better deeptile parsing (#1997)
* check string size when looking at the type

If corrupt files put nul or other non-printing characters in the string
data it can be difficult to debug when the type name is printed but does
not compare equal.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* remove duplicate max sizes

use the size defaults in the core library

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* add check when in reduceMemory ahead of sample count alloc

when there are large tiles, need to check the memory prior to allocating
the sample count array. Additionally set a max tile size even when not
in reduce memory, although set larger than any known use for a tile size

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-03-11 13:31:59 -07:00
Patrick HulceandCary Phillips 7e32b483ee docs: clarify exr2aces output format (#1963)
* docs: clarify exr2aces output format

Inspired by discussion in https://github.com/AcademySoftwareFoundation/openexr/issues/1962.

Adds additional background to the ACES Image Container format produced by exr2aces.

Signed-off-by: Patrick Hulce <patrick.hulce@gmail.com>

* docs: update exr2aces.rst with recommended edits

Signed-off-by: Patrick Hulce <patrick.hulce@gmail.com>

* docs: add justified indentation

Signed-off-by: Patrick Hulce <patrick.hulce@gmail.com>

* Use inline link instead.

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Patrick Hulce <patrick.hulce@gmail.com>

* Remove link reference

Signed-off-by: Patrick Hulce <patrick.hulce@gmail.com>

---------

Signed-off-by: Patrick Hulce <patrick.hulce@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-03-11 13:15:11 -07:00
peterhillmanandCary Phillips 6756f28700 exrmetrics: fix json output, better testing (#1990)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-03-06 12:26:37 -08:00
Todica IonutandCary Phillips 6cb7d97b20 Remove duplicate cmake dependency from skbuild plugin (#1993)
Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-03-06 09:43:24 -08:00
Vertexwahn 09af4189dd Bazel support: Bump rules_cc (#1995)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2025-03-06 09:41:20 -08:00
Debitsch-FaroandCary Phillips 848f84ae75 fix_1981: Don't set the library postfix in the cmake cache. Otherwise it will set this variable if OpenEXR is a subproject (#1987)
fix_1981: Don't rewrite the header file of libdeflate if not necessary. Avoid useless rebuilds after cmake reconfigure

fix_1981: Remove whitespace

Signed-off-by: Rasmus Debitsch <rasmus.debitsch@faro.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-03-04 10:01:02 -08:00
JohnnyandCary Phillips 07521cb022 ARM CI (#1989)
* Update python-wheels.yml

Signed-off-by: Johnny <johnnync13@gmail.com>

* Update python-wheels-publish.yml

Signed-off-by: Johnny <johnnync13@gmail.com>

* Update python-wheels.yml

Signed-off-by: Johnny <johnnync13@gmail.com>

* Update python-wheels-publish.yml

Signed-off-by: Johnny <johnnync13@gmail.com>

* Update python-wheels-publish.yml

Signed-off-by: Johnny <johnnync13@gmail.com>

* Update python-wheels.yml

Signed-off-by: Johnny <johnnync13@gmail.com>

* Update python-wheels-publish-test.yml

Signed-off-by: Johnny <johnnync13@gmail.com>

---------

Signed-off-by: Johnny <johnnync13@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-03-04 08:33:50 -08:00
Matt Johnson 4077187e0a exrcheck: update CMakeLists.txt to install the tool (#1983)
* add an OPENEXR_INSTALL_DEVELOPER_TOOLS option

This new option will control whether or not the tools
considered to be "developer" tools should be installed.
These are tools useful for developing and debugging OpenEXR
itself that might not be suitable for distribution to end
users. exrcheck is currently the only tool considered to be
a developer tool.

Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>

* exrcheck: update CMakeLists.txt to enable developer tool installation

This makes the CMakeLists.txt for exrcheck look like other
tools like exrinfo and uncomments the CMake call to install
the tool. One difference though is that exrcheck is considered
a developer tool, and as such is only installed when the
OPENEXR_INSTALL_DEVELOPER_TOOLS option is enabled.

Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>

---------

Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
2025-02-26 16:07:26 -08:00
Kimball Thurston df162955c6 Adjust the clamping on the dwa compression (#1986)
* Adjust the clamping on the dwa compression

The dwa compression is not truly a quality level like other things, so a
maximal value is controlling quantization, not quality. A value of 0 is
allowed, but negative is not.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* improve tests for dwa compression level set

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-02-18 08:07:18 -08:00
Kimball Thurston 97f857131e Address issues with small exr files and header parse
If we know the file size, we should truncate the header parse to only
read the file at most. Otherwise, if the file size is unknown (stream)
then be conservative (and slower) and read 1 byte at a time for the
header parse. Once we know the file, that should be free to read chunks

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-02-15 09:59:26 +13:00
Kimball Thurston 1982b6fe97 Fix bad pointer math
In SSE, we were incrementing a pointer as if it were a uint16_t, not an
si128, causing out of bounds accesses on non-block aligned chunks.

Similarly, simplify the alignment logic and check return values and
pointers in related accesses (non-block aligned linear lut lookup).

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-02-12 20:47:42 +13:00
Kimball Thurston 2df7802a64 avoid large allocations (#1979)
If the chunk table is unable to provide the specified data window, do
not allocate the frame buffer (or cache framebuffer) to that size

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-02-11 16:45:23 -08:00
Kimball Thurston 22d562c0cc fix crash if user does not provide memory when filling (#1980)
for deep frame buffers, when filling, if the caller does not provide
output memory for a particular sample set, do not crash.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-02-11 16:39:02 -08:00
Kimball Thurston 928f9a4dd7 fix potential buffer overwrite with zip data (#1974)
If the zipped data unpacks to a buffer which is too large, but still
within the scratch buffer size, could potentially write past the end of
the buffer

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-02-08 15:11:38 -08:00
Cary Phillips 7044bc9925 Add HTJ2K news item (#1976)
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-02-08 15:11:01 -08:00
Kimball Thurston 2d94a3cc7c Fix usage of utf-8 filenames for windows
the std::filesystem::path mechanism is reasonable, but needs to be told
it to look for a utf-8 string, and is not automatically that, and the
standards committee must have realized there were issues and change the
api in c++20

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-02-09 11:01:48 +13:00
Cary Phillips 3144463fc4 Add website page for exrmetrics (#1971)
* Add website page for exrmetrics

Signed-off-by: Cary Phillips <cary@ilm.com>

* add missing backticks

Signed-off-by: Cary Phillips <cary@ilm.com>

* usage examples

Signed-off-by: Cary Phillips <cary@ilm.com>

* run description

Signed-off-by: Cary Phillips <cary@ilm.com>

* Use a pool...

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-02-08 12:04:58 -08:00
peterhillman 1217b57366 clean up exrmetrics help, simplify JSON output (#1973)
* clean up exrmetrics help, simplify JSON output

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* revert exrmetrics to returncode 0 with --help

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2025-02-06 16:10:18 -08:00
Kimball ThurstonandCary Phillips 91156c3b9c update all upload-artifact usage to v4 (#1970)
* update all upload-artifact usage to v4

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* replicate unique name change

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Update .github/workflows/python-wheels-publish-test.yml

-${{ env.INSTALL_MANIFEST }} should definitely not get appended to the name, that was appropriate only for the install manifests in ci_steps.yml.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update .github/workflows/python-wheels-publish.yml

-${{ env.INSTALL_MANIFEST }} should definitely not get appended to the name, that was appropriate only for the install manifests in ci_steps.yml.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update .github/workflows/ossfuzz_workflow.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update .github/workflows/python-wheels.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update .github/workflows/scorecard.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update .github/workflows/scorecard.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2025-02-04 13:30:04 -08:00
peterhillman f7a6cb4e7a extend exrmetrics (#1968)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2025-02-02 13:14:39 -08:00
Cary Phillips d8c96a061f Update actions/upload-artifact to @v4 (#1969)
This requires all artifacts to have unique names, so the
install_manifest.txt files need to uploaded with the name that
includes the os and build number.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-01-31 15:27:39 -08:00
dependabot[bot] 949ae1b364 Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 11:19:59 +13:00
Cary Phillips 26927897b2 Fix installation of Imath and libdeflate in windows CI (#1966)
The libdeflate and Imath installation steps require bash, not
PowerShell, otherwise they fail silently and fall back to the auto
fetch/build. And the install manifests for the validation were
correspondingly incorrect.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-01-29 16:30:32 -08:00
Cary Phillips 3ce6c2b85d Update security policy regarding backporting patches (#1961)
* Update security policy regarding backporting patches

This wording captures our policy: we commit to fixes for main and the
most recent minor release, but prior to that, discussed on a
case-by-case basis. Better to leave it at than than attempt to be more
specific, since those specifics can be determined based on the situation.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Support policy for 2.0-2.4:

2.4 was the first release by the ASWF, recent enough to negotiate
patches. Prior to that our knowledge is so limited, and CMake support
was so fragile, that we should not even entertain the possibility.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-01-26 13:38:40 -08:00
Dimitris Apostolou 66158f8363 Fix typos (#1954)
Signed-off-by: Dimitris Apostolou <dimitris.apostolou@icloud.com>
2025-01-14 16:00:46 -08:00
Kimball Thurston 8bc3faebc6 add checks to avoid using optimizations when inappropriate
The fast unpack routines for 3 and 4 channels were not designed to
handle sub-sampled images, but need to appear before other fallback
disablement in the choice logic. Until that choice logic can be
simplified, add additional checks to avoid heading to that branch

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-01-01 17:48:38 +13:00
Kimball Thurston ad85f1a267 add minor huf encode / decode performance optimizations
uses likely / unlikely macros to better guide branch predictor,
convert some static / local functions from functions to macros to avoid
having to take the address of a local variable, preventing register
optimizations, and finally guide pointer aliasing to get some
speed improvements in the huf encoder / decoder.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-01-01 16:09:22 +13:00
Kimball Thurston 22cbb7966f convert dwa encoder to use algorithm quantize
Convert the quantization from a massive table to a bit-fiddling
algorithm which is more code but significantly faster (in some cases,
almost 2x). This also eliminates the giant lookup tables from the
binary, which reduces the compiled size of the core library. Beside
the identity table (value in, same value out), those quantization
tables are preserved in the unit tests to ensure correct behavior.

The tests are defaulted to a light-er weight test, which should test
the variety of error tolerance ranges, but there is a deeper test
that can be enabled by switching an ifdef in the compression tables
test.

As a motivation for improvement, with this change, the size for the
core library is reduced by more than half (2.2MB to 0.99MB) while
performance is improved from 0.23s for an encode to 0.155s on
x86_64 with avx2 / f16c enabled anyway. Other platforms will
hopefully experience similar improvements.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-01-01 15:41:39 +13:00
Cary Phillips a8dc4f9acf Add test for v2f and v3f
Signed-off-by: Cary Phillips <cary@ilm.com>
2025-01-01 15:16:32 +13:00
Cary Phillips 82391c9cf5 Fix incorrect vec3 array size validation
Copy/paste error in objectToV3, should be looking for a.size()==3, not 2.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-01-01 15:16:32 +13:00
Cary Phillips a3390757ff Fix handling of box2f in python module
objectToBox2f was failing to store the value in the proper argument.

Also, the test was never actually creating a box out of floats, it was
only testing integers.

This also fixes an as-yet-undetected error with the use of Imf
namespace in PyOpenEXR_old.cpp, where there's already a `using`
statement.

Signed-off-by: Cary Phillips <cary@ilm.com>
2025-01-01 15:13:57 +13:00
Darby Johnston 81a8b3182b Add comment about thread-safety
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
2025-01-01 15:09:25 +13:00
Kimball Thurston 52348078a3 Add an option to use TBB as the global provider (#1852)
This does NOT change the default thread pool provider if you manually
instantiate a thread pool, as that would change the contract of the
previous definition of the thread pool and likely cause deadlocks when
users expected separate threads in separate thread pools

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2025-01-01 15:05:18 +13:00
HyeongSeok Kim 89fd37e4d2 Add numpy dependency to python wrapper. (#1935)
* update pyproject.toml and python workflows: Add numpy dependency

- Additional dependencies required for the build environment
Numpy must be installed in the python environment where the build is being performed in order to build.

- Automatic installation of dependencies like a normal python package
When installing this package, if numpy does not exist in the python environment, it will be installed automatically.

Signed-off-by: HyeongSeok Kim <tiryul@gmail.com>

* update python-wheels-*yml, pyproject.toml: remove BEFORE_BUILD, remove numpy in build requires

- python-wheels-*yml: When testing on other PRs, I found that dependencies were not properly installed for each build case, so I added this code. However, this PR is for adding numpy dependencies, so it is not needed as @JeanChristopheMorinPerso suggested.

- pyproject.toml: If you are going to do any additional work with the build artifacts, like generating stubs, you will need numpy in your build environment, but it is not needed at the moment. I agree with the review by @JeanChristopheMorinPerso.

Signed-off-by: HyeongSeok Kim <tiryul@gmail.com>

---------

Signed-off-by: HyeongSeok Kim <tiryul@gmail.com>
2024-12-15 19:01:21 -08:00
dependabot[bot] 867ce30da1 Bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 (#1937)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.2 to 1.12.3.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/15c56dba361d8335944d31a2ecd17d700fc7bcbc...67339c736fd9354cd4f8cb0b744f2b82a74b5c70)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-15 18:13:26 -08:00
dependabot[bot] c35a49244a Bump github/codeql-action from 3.27.6 to 3.27.9 (#1939)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.6 to 3.27.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/aa578102511db1f4524ed59b8cc2bae4f6e88195...df409f7d9260372bd5f19e5b04e83cb3c43714ae)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-15 18:12:56 -08:00
Cary Phillips 39010bff70 Restructure CI to use reusable steps, and add new checks (#1921)
* Restructure CI to use reusable steps, and add new checks

The goal of this change is to add tests to catch some recent
regressions that the existing CI missed:

* Validate that the proper files get installed. A recent
  innocuous-seeming change to the cmake config caused libdeflate files
  to make it into the installation and we didn't catch it.

  This change introduces a validation step that compares the
  install_mantifest.txt file from each job to a reference maintained
  in share/ci/install_manifest. Each job has a "build" number that
  identifies the reference manifest.

  NOTE: This means that all future changes to installed headers and
  libraries must be reflected in these manifests.

* Validate building against prebuilt/external Imath and libdeflate
  libraries, and also test the "force internal" option.

* Validate building with custom namespaces

To make the workflow files easier to maintain, this splits two parts:

* The ci_steps.yml file declares a common set of steps for Linux,
  macOS, and Windows, and a set of variables named to match the
  various CMake configuration options.

* The ci_workflow.yml invokes these steps with a succession of builds
  that provide collections of CMake settings, which is passes to the
  reusable workflow via the "with:" statement. The "with:" statements
  provide default variable settings, which means each build specifies
  only non-default settings, for a compact summary of what's unique
  about that job.

Some notes:

* By default, the builds now pre-install Imath and libdeflate, so that
  the main OpenEXR build picks them up. A special build now validates
  the behavior of OPENEXR_FORCE_INTERNAL_IMATH and
  OPENEXR_FORCE_INTERNAL_DEFLATE, which were previously untested.

* For each OS, we now build and test these configurations:
  1. Release
  2. Debug
  3. Static
  4. Threading disabled
  5. pkgconfig, docs, examples, tools disabled. This was also previously not
     tested.
  6. Legacy VFX reference platform compiler(s) and/or os(s)

* The "label:" setting forms the description of the job on the GitHub
  Acions page, prepended with the OS and "build" number, which makes
  it easier to cross reference between the entries on the Actions page
  and the workflow file.

* We no longer build with clang on Linux, since we do a clang build on
  macOS.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add Linux clang build

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-12-12 18:44:47 -08:00
dependabot[bot] a4a03cebc6 Bump pypa/cibuildwheel from 2.21.3 to 2.22.0 (#1924)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.21.3 to 2.22.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/7940a4c0e76eb2030e473a5f864f291f63ee879b...ee63bf16da6cddfb925f542f2c7b59ad50e93969)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 18:16:46 -08:00
dependabot[bot] 506c298c9a Bump github/codeql-action from 3.27.5 to 3.27.6 (#1932)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.27.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f09c1c0a94de965c15400f5634aa42fac8fb8f88...aa578102511db1f4524ed59b8cc2bae4f6e88195)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 18:15:23 -08:00
dependabot[bot] fe40612593 Bump actions/cache from 4.1.2 to 4.2.0 (#1936)
Bumps [actions/cache](https://github.com/actions/cache) from 4.1.2 to 4.2.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/6849a6489940f00c2f30c0fb92c6274307ccb58a...1bd1e32a3bdc45362d1e726936510720a7c30a57)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 18:14:48 -08:00
Cary Phillips 0e3d6dc030 Update link to TSC meeting calendar (#1928)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-12-09 12:31:40 -08:00
Cary Phillips b51239d32c Workaround CI workflow for vfx 2022/2021 (#1931)
* Workaround CI workflow for vfx 2022/2021

Build for VFX reference platform prior to 2023, which requires a
workaround to run an old version of glibc required by the ASWF Docker
images.

This doesn't easily integrate with the existing CI workflow, and it
can be deprecated entirely once we've moved beyond support for the
old CentOS-based VFX reference platform years.

See this discussion for details:
https://academysoftwarefdn.slack.com/archives/C0169RX7MMK/p1732574400981949

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove centos7 label

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-12-02 09:57:22 -06:00
dependabot[bot] a393987aba Bump github/codeql-action from 3.27.4 to 3.27.5 (#1923)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.4 to 3.27.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/ea9e4e37992a54ee68a9622e985e60c8e8f12d9f...f09c1c0a94de965c15400f5634aa42fac8fb8f88)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 15:11:54 -08:00
Cary Phillips f7e4e2c98f Fix windows build/CI with threading disabled (#1920)
The CI was failing to actually set OPENEXR_THREADING_ENABLED for the
macOS and Windows builds.

And the Windows build as failing with threading disabled, due to a
missing header.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-11-21 15:11:32 -08:00
Cary Phillips c302e2db2f Remove copy/assign/move tests in testAttributes() (#1922)
When we implemented the "rule of 5" (PR #601) in 2019, I added code to
testAttributes.cpp to validate the behavior, specifically related to
the TypedAttribute class, but in retrospect, this code isn't reliable,
so I propose eliminating the test altogether.

The test counts invocations of the various constructors, destructors,
and move/assignment operators, expecting them to be consistent, but
compilers can optionally optimize some of these operations away,
producing inconsistent results.

In particular, a Debug build on Windows produces different results
from a Release build. Our CI has not historically tested a Windows
Debug build, which explains why we never caught this. The exact
behavior may have also changed with C++17. All the more reason to
avoid such picky tests.

This does not change the library code, only the tests.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-11-20 11:54:41 -08:00
dependabot[bot] 36bb865035 Bump github/codeql-action from 3.27.1 to 3.27.4 (#1918)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.1 to 3.27.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/4f3212b61783c3c68e8309a0f18a699764811cda...ea9e4e37992a54ee68a9622e985e60c8e8f12d9f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 17:28:28 -08:00
dependabot[bot] e54d61b5ca Bump github/codeql-action from 3.27.0 to 3.27.1 (#1914)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.0 to 3.27.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/662472033e021d55d94146f66f6058822b0b39fd...4f3212b61783c3c68e8309a0f18a699764811cda)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 14:13:48 -08:00
dependabot[bot] d964419dde Bump scikit-build-core from 0.8.1 to 0.10.7 (#1913)
Bumps [scikit-build-core](https://github.com/orgs/scikit-build) from 0.8.1 to 0.10.7.
- [Commits](https://github.com/orgs/scikit-build/commits)

---
updated-dependencies:
- dependency-name: scikit-build-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 14:13:21 -08:00
dependabot[bot] 2ac93daa8f Bump pypa/gh-action-pypi-publish from 1.11.0 to 1.12.2 (#1910)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.11.0 to 1.12.2.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/fb13cb306901256ace3dab689990e13a5550ffaa...15c56dba361d8335944d31a2ecd17d700fc7bcbc)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 14:12:22 -08:00
Cary Phillips c0b592dbda Release notes and website news for v3.3.2 (#1916)
* Release notes for 3.3.2

Signed-off-by: Cary Phillips <cary@ilm.com>

* 3.3.2 release date Nov 10

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add #1912 to release notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* release notes and website news for v3.3.2

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-11-12 14:11:43 -08:00
Cary Phillips 16a6ac439b Add missing namespace macros (#1912)
To properly support custom namespaces, all namespace references should
use the appropriate macros, not hard-coded literals.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-11-07 15:01:29 -08:00
Kimball Thurston 1a5f8da030 Handle non-seekable stream (#1907)
If a stream is not seekable, grab the value (whole buffer) and provide
that

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-11-03 11:50:23 -08:00
Kimball Thurston f00ba78ed5 check for invalid uncompressed chunk sample count (#1905)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-11-03 11:46:20 -08:00
Kimball Thurston 5ce329ca79 Add thread control to exrmetrics (#1904)
Add ability to test threading modes with exrmetrics

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-11-03 11:45:45 -08:00
Matt Johnson 6fc0c63a14 CMake: use EXCLUDE_FROM_ALL when declaring Fetch for deflate library (#1880)
* CMake: use lower case name when checking whether Deflate is populated

The documentation for CMake's FetchContent_GetProperties() is not
particularly clear, but it follows the same convention of
FetchContent_Populate() and FetchContent_MakeAvailable() where the
given name is converted to lower case to produce the variable names,
so this changes the test for Deflate population to use the correct
"deflate_POPULATED" variable name.

Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>

* CMake: use EXCLUDE_FROM_ALL when declaring Fetch for deflate library

Commit af9ef0e made a change in the CMake setup to switch from using
FetchContent_Populate() to FetchContent_MakeAvailable() to bring in
libdeflate (and Imath) as dependencies. Using FetchContent_MakeAvailable()
has the side effect that libdeflate is now being included as part of the
build, causing libraries and headers to be built and installed.

The intent with fetching the deflate source is solely to copy select
files into OpenEXRCore, so this change adds the EXCLUDE_FROM_ALL option
to the call to FetchContent_Declare() to prevent deflate from being
included in the build.

One wrinkle though is that prior to CMake 3.28, passing the
EXCLUDE_FROM_ALL option to FetchContent_Declare() does *not* have the
desired effect of excluding the fetched content from the build when
FetchContent_MakeAvailable() is called. Ideally we could "manually"
set the EXCLUDE_FROM_ALL property on the deflate SOURCE_DIR and
BINARY_DIR, but a bug that was only fixed as of CMake 3.20.3 prevents
that from properly excluding the directories:
    https://gitlab.kitware.com/cmake/cmake/-/issues/22234

To support the full range of CMake versions without overly complicating
things with cumbersome workarounds, we continue to use Populate for CMake
versions before 3.30, and switch to MakeAvailable for CMake 3.30 and later.

Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>

---------

Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
2024-10-31 09:39:25 -07:00
Kimball Thurston 366eeb12e3 Reintroduce single cache for successive scanline reads (#1899)
Previously we allowed multiple threads to cache but that caused memory
bloat, here, only keep one so successive reads will be faster for
compression types where there are more than one scanline per chunk

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-10-30 13:44:38 -07:00
Megha S cd0ac53e19 Added tests for ImfCRgbaFile (#1890)
* Added tests for ImfCRgbaFile

Signed-off-by: Megha S <megha199501@gmail.com>

* Addressed review comments

Signed-off-by: Megha S <megha199501@gmail.com>

---------

Signed-off-by: Megha S <megha199501@gmail.com>
2024-10-30 13:44:10 -07:00
dependabot[bot] f9f7edccad Bump pypa/gh-action-pypi-publish from 1.10.3 to 1.11.0 (#1903)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.3 to 1.11.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/f7600683efdcb7656dec5b29656edb7bc586e597...fb13cb306901256ace3dab689990e13a5550ffaa)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-30 13:42:00 -07:00
Kimball Thurston b6fc6eccf9 Allow empty file name (#1898)
When providing a custom stream, there is no reason a filename needs to
be provided beyond clearer error messages. Because std::string does not
allow null, continue to disallow a null filename. Add a test case

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-10-26 10:37:23 -07:00
dependabot[bot] 4332f5e902 Bump actions/setup-python from 5.2.0 to 5.3.0 (#1896)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/f677139bbe7f9c59b41e40162b753c062f5d49a3...0b93645e9fea7318ecaed2b359559ac225c90a2b)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-26 10:36:30 -07:00
dependabot[bot] 74e8710ae1 Bump actions/cache from 4.1.1 to 4.1.2 (#1892)
Bumps [actions/cache](https://github.com/actions/cache) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/3624ceb22c1c5a301c8db4169662070a689d9ea8...6849a6489940f00c2f30c0fb92c6274307ccb58a)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-26 10:35:42 -07:00
dependabot[bot] a82cee1b2c Bump github/codeql-action from 3.26.13 to 3.27.0 (#1891)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.13 to 3.27.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f779452ac5af1c261dce0346a8f964149f49322b...662472033e021d55d94146f66f6058822b0b39fd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-26 10:35:18 -07:00
dependabot[bot] 7bd85a2ce2 Bump github/codeql-action from 3.26.12 to 3.26.13 (#1886)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.12 to 3.26.13.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/c36620d31ac7c881962c3d9dd939c40ec9434f2b...f779452ac5af1c261dce0346a8f964149f49322b)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 10:21:24 -06:00
Cary Phillips bfbb035873 Add manpage for exrmetrics (#1884)
Also, remove the `if(INSTALL_DOCS)` conditional in
docs/CMakeLists.txt, since that file is included only if
`OPENEXR_INSTALL_DOCS` is set.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-10-14 11:16:22 -07:00
dependabot[bot] 101d7b0cd6 Bump jmertic/slack-release-notifier (#1885)
Bumps [jmertic/slack-release-notifier](https://github.com/jmertic/slack-release-notifier) from fbbf40c3020ca7707ae09ff9160206381c592fd7 to 7ed1272d4b089a8987b4c6880604cf63287b68b8.
- [Release notes](https://github.com/jmertic/slack-release-notifier/releases)
- [Commits](https://github.com/jmertic/slack-release-notifier/compare/fbbf40c3020ca7707ae09ff9160206381c592fd7...7ed1272d4b089a8987b4c6880604cf63287b68b8)

---
updated-dependencies:
- dependency-name: jmertic/slack-release-notifier
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 11:16:00 -07:00
Vertexwahn 74a0f59390 Bazel Support: Use Imath and libdeflate live at head (#1882)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2024-10-13 14:16:13 -07:00
Cary Phillips 48e99c8570 Fetch master branch of libdeflate on main (#1879)
Rather than pinning libdeflate to a specific version, we should have
the OpenEXR main branch fetch from libdeflate's master branch, so our
bleeding edge uses their bleeding edge. Then, we pin to the most
recent libdeflate branch on minor release, or patch release if it's
ABI compatible.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-10-13 14:15:00 -07:00
Cary Phillips 3d34ea047d news update for v3.3.1 (#1876)
* news update for v3.3.1

Signed-off-by: Cary Phillips <cary@ilm.com>

* Put lastest news title in website/latest_news_title.rst

So the "Latest News" section on the main page can get the title as
well as the body of the news item, which is pulled from
website/news.rst.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-10-10 17:16:48 -07:00
dependabot[bot] 867eaefe55 Bump actions/upload-artifact from 4.4.0 to 4.4.3 (#1878)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.0 to 4.4.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/50769540e7f4bd5e21e526ee35c689e35e0d6874...b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 10:54:15 -07:00
dependabot[bot] 18526a6a42 Bump pypa/cibuildwheel from 2.21.2 to 2.21.3 (#1877)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.21.2 to 2.21.3.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/f1859528322d7b29d4493ee241a167807661dfb4...7940a4c0e76eb2030e473a5f864f291f63ee879b)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 10:52:33 -07:00
dependabot[bot] 859b36a5ff Bump actions/cache from 4.0.2 to 4.1.1 (#1874)
Bumps [actions/cache](https://github.com/actions/cache) from 4.0.2 to 4.1.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/0c45773b623bea8c8e75f6c82b208c3cf94ea4f9...3624ceb22c1c5a301c8db4169662070a689d9ea8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 21:51:40 -07:00
dependabot[bot] 528044b64d Bump github/codeql-action from 3.26.11 to 3.26.12 (#1872)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.11 to 3.26.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea...c36620d31ac7c881962c3d9dd939c40ec9434f2b)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 21:50:36 -07:00
Kimball Thurston 1cd4bf6b94 Address huf / piz performance regressions (#1868)
* Enable fast huf for os/x, optimize routines

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Apply some minor optimizations to piz decode

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* disable alias tag for msvc

It appears MSVC does not handle the restrict keyword properly

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Replicate comment denoting issue w/ msvc

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Remove overzealous memory optimization

It is more efficient to store the code length and symbol in the one
table, but appears measurably slower. Remove that.

Further, do not constantly refill the bit buffer during huf fast decode,
that slows down the decoding

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-10-05 19:22:56 -07:00
Cary Phillips 26fc443839 Don't exclude src/test and website from sdist (#1857)
The source should appear in the sdist, since the build's cmake requires them.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-10-05 19:22:23 -07:00
Cary Phillips 937a0e7598 Use FetchContent_MakeAvailable instead of FetchContent_Populate (#1863)
The cmake docs say:

  The FetchContent_Populate() command is a self-contained call which
  can be used to perform content population as an isolated
  operation. It is rarely the right command to use, projects should
  almost always use FetchContent_Declare() and
  FetchContent_MakeAvailable() instead.

And the python wheel sdist build reports warnings (macOS 12.7):

  CMake Warning (dev) at /private/var/folders/zd/1cs92n8x61j06hj_gbv7qlvr0000gn/T/pip-build-env-t9wrh100/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.30/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(Deflate) is deprecated, call
  FetchContent_MakeAvailable(Deflate) instead.  Policy CMP0169 can be set to
  OLD to allow FetchContent_Populate(Deflate) to be called directly for now,
  but the ability to call it with declared details will be removed completely
  in a future version.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-10-05 19:21:48 -07:00
Todica IonutandCary Phillips 014392c707 Fix Typo SECURITY.md (#1867)
* Fix Typo

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

* Update SECURITY.md

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>

---------

Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2024-10-05 19:21:27 -07:00
dependabot[bot] c41984b956 Bump pypa/cibuildwheel from 2.21.1 to 2.21.2 (#1864)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23...f1859528322d7b29d4493ee241a167807661dfb4)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-04 14:58:42 -07:00
dependabot[bot] 72b173b007 Bump github/codeql-action from 3.26.10 to 3.26.11 (#1865)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.10 to 3.26.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e2b3eafc8d227b0241d48be5f425d47c2d750a13...6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-04 14:58:00 -07:00
dependabot[bot] 74ab4287d1 Bump pypa/gh-action-pypi-publish from 1.10.2 to 1.10.3 (#1866)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.2 to 1.10.3.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/897895f1e160c830e369f9779632ebc134688e1b...f7600683efdcb7656dec5b29656edb7bc586e597)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-04 14:57:21 -07:00
Cary Phillips f1f2438e86 Set version on main branch to 3.4.0 (#1860)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-10-02 17:51:25 -07:00
RafaelWO 2b6e0609d1 CI: build wheels for Python 3.12 (#1861)
Signed-off-by: RafaelWO <38643099+RafaelWO@users.noreply.github.com>
2024-10-02 17:50:56 -07:00
Aras Pranckevičius 03a4718194 Build: compile source files in parallel under MSVC (#1858)
Compiling OpenEXRTest with dependencies from a fresh checkout, in Release
config with VS2022 on Ryzen 5950X: 75sec -> 12sec.

Signed-off-by: Aras Pranckevicius <aras@nesnausk.org>
2024-10-02 10:25:51 -07:00
dependabot[bot] d689a3a838 Bump github/codeql-action from 3.26.9 to 3.26.10 (#1854)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.9 to 3.26.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/461ef6c76dfe95d5c364de2f431ddbd31a417628...e2b3eafc8d227b0241d48be5f425d47c2d750a13)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 10:25:12 -07:00
Vertexwahn 0a0bb45952 Bazel support: Switch to Imath 3.1.12 (#1856)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2024-10-02 10:24:40 -07:00
Cary Phillips 8d52f35c1b Add v3.3.0 notes to website news (#1849)
* Add v3.3.0 notes to website news

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix LatestNewEnd

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-30 09:26:32 -07:00
Cary Phillips 43efc618c3 Bump version/soversion on main branch (#1848)
* add fuzz issues

Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix src/wrappers/python/README.md link

Signed-off-by: Cary Phillips <cary@ilm.com>

* Bump main branch version tag to 4.0.0 and SOVERSION to 99

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-30 09:26:18 -07:00
Cary Phillips 72e9c3df8d First draft of website documentation for python bindings (#1780)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-30 09:26:02 -07:00
Kimball Thurston 3e64e7d977 Use 64-bit values for the pointer math
Other reader classes already use 64-bit numbers for pointer math, fix
this case to use the same

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-28 17:53:27 +12:00
dependabot[bot] 3ebc6ed20c Bump github/codeql-action from 3.26.8 to 3.26.9 (#1846)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.8 to 3.26.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/294a9d92911152fe08befb9ec03e240add280cb3...461ef6c76dfe95d5c364de2f431ddbd31a417628)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 16:18:54 -07:00
Kimball Thurston 80c69c9437 Fix open ossfuzz 26 sept 2024 (#1850)
* always return if all we need are the sample counts

regardless of 0 sample counts or not, return if that is all we need, as
unpack buffers will not have been allocated for data

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* do not allow string lengths larger than the remaining data within the string vector

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* simplify safety check logic

The file size would have already been checked by the attrsz check, so
this check works implicitly, and works when the file size is not
available (streams)

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-26 04:59:18 -07:00
Cary Phillips b2d815602e First draft of release notes for v3.3 (#1835)
* First draft of release notes for v3.3

Signed-off-by: Cary Phillips <cary@ilm.com>

* compression API and exrmanifest/exrmetrics

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add Kimball's notes;  add description/link for exrmanifest

Signed-off-by: Cary Phillips <cary@ilm.com>

* 1833

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-24 09:54:26 -07:00
Kimball Thurston c7d03a85df Initial api to provide stateless read api for scanline things
This enables reading of scanlines in a "stateless" manner, where a
framebuffer does not have to be stored, then the call to readPixels
made.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-24 08:16:45 +12:00
Kimball Thurston 6245d6ec6e honor thread-safe stream api if available
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-24 08:16:45 +12:00
Kimball Thurston 210900cc32 Add initial api to allow reading streams to be thread safe
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-24 08:16:45 +12:00
Kimball Thurston 43d39b49ad Add new file to bazel build
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-24 08:14:01 +12:00
Kimball Thurston cfc6427ef6 Add templated utility class to centralize common pattern
All reading code has a (for threaded reads) need to maintain a set of
contexts and re-use them while dispatching N threads. Create a class to
do that and remove duplicate code.

This also lowers the scope of when the contexts are alive to reduce
memory bloat

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-24 08:14:01 +12:00
Kimball Thurston 821c1fc148 Remove some warnings when compiling on newer compilers (#1841)
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-23 09:35:24 -07:00
Todica Ionut 6a46ae88e1 centered colon (#1837)
Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
2024-09-23 09:30:57 -07:00
asa 8d141c5db5 Bazel build fixes. (#1836)
Signed-off-by: asa <asa@automaton.build>
2024-09-23 09:29:15 -07:00
dependabot[bot] 541dc150ae Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2 (#1838)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/0ab0b79471669eb3a4d647e625009c62f9f3b241...897895f1e160c830e369f9779632ebc134688e1b)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 09:28:53 -07:00
Todica Ionut cf14304cca Add Compression DWAA/B OpenEXRFileLayout.rst (#1839)
Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
2024-09-23 09:28:16 -07:00
dependabot[bot] 25c2d775f8 Bump pypa/cibuildwheel from 2.21.0 to 2.21.1 (#1824)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.21.0 to 2.21.1.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/79b0dd328794e1180a7268444d46cdf12e1abd01...d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-20 12:16:50 -07:00
Cary Phillips 8b0caea88b Update sigstore release signing action (#1822)
The default behavior of sigstore/gh-action-sigstore-python has
changed. Disable the automatic uploading of signed artifacts, since
this now includes artifacts named with just the tag, without the
"openexr-" prefix.

Also, the signature file now has a .json suffix.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-20 12:16:16 -07:00
Pedro Borges 176ec27c8a Fixed formatting issue in website/OpenEXRFileLayout.rst (#1832)
* Update OpenEXRFileLayout.rst

Signed-off-by: Pedro Borges <pedroborgespc@gmail.com>

* Update OpenEXRFileLayout.rst

Signed-off-by: Pedro Borges <pedroborgespc@gmail.com>

* Update OpenEXRFileLayout.rst

Signed-off-by: Pedro Borges <pedroborgespc@gmail.com>

---------

Signed-off-by: Pedro Borges <pedroborgespc@gmail.com>
2024-09-20 12:08:28 -07:00
dependabot[bot] a5d5f1b75b Bump github/codeql-action from 3.26.7 to 3.26.8 (#1833)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.7 to 3.26.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8214744c546c1e5c8f03dde8fab3a7353211988d...294a9d92911152fe08befb9ec03e240add280cb3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-20 11:52:25 -07:00
Kimball Thurston 04cc126643 Change how when channels are validated, duplicated
Old library allowed names to accumulate, whether that is a great feature
or not, preserve that when not in strict mode.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-20 07:40:30 +12:00
Kimball Thurston 04a91b79ed avoid decoding when there is an empty chunk
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-20 07:40:30 +12:00
Kimball Thurston 76c932a856 avoid calling compression when there is nothing to do
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-20 07:40:30 +12:00
Brendan Bolles 8f76f50435 Add includes for Windows (#1827)
Signed-off-by: Brendan Bolles <brendan@fnord.com>
2024-09-19 07:53:10 -07:00
Kimball Thurston c7c75e0624 Add duplicate validation
There is validation for tile descriptions already when looking at a
tiled file, but if someone provides a tile description in a non-tiled
file, validate that the enums will be valid

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-19 18:56:47 +12:00
Kimball Thurston 90704f2988 Address some initial fuzz reports after core rewrite merge (#1821)
* Add validation that the types of the attributes are correct, not just that they exist

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* use constructor semantics to zero init the context pointer, avoid one memory sanitizer warning

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* to avoid UB with streams, keep attr sizes with int32 size

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* handle an empty buffer cleanly

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-16 09:33:35 -07:00
dependabot[bot] 97e2d29538 Bump github/codeql-action from 3.26.6 to 3.26.7 (#1820)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/4dd16135b69a43b6c8efb853346f8437d92d3c93...8214744c546c1e5c8f03dde8fab3a7353211988d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 09:32:15 -07:00
dependabot[bot] ff200905e5 Bump pypa/cibuildwheel from 2.20.0 to 2.21.0 (#1819)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/bd033a44476646b606efccdd5eed92d5ea1d77ad...79b0dd328794e1180a7268444d46cdf12e1abd01)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 09:31:13 -07:00
Kimball Thurston 75da6b8098 Fix compile warnings
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston dbdedb1231 improve error reporting in stream wrapper
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 1273f5c78d Remove now unreachable code
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 852e0e19f5 Allow other things to share access to this file under windows
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 693a7e4492 simplify window filestream creation
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 7dc2e20eb7 set output bit in make_ofstream
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 7ac02da91d Tell wheel builds to use new-enough mac O.S. to deal with c++17
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 6966fcf76d only allow cxx standard to override if greater than 17
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston f715341b3c tell python wheels to use c++17
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 9f7c2bef74 legacy library allowed empty part name
Also add unique name validation

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 19361b7f0d better handle under/overflow of chunk table in deep tiles
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 2bca92f3a4 msvc does not really have stdatomic support yet, work around same as elsewhere
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 93b93ea27f pass the sample stride through instead of just the bytes like normal image reading
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 1dd3466fa8 minor optimization
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 95d8447f97 deep is not doing any optimization checks on the user bytes, let them vary as a result
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 8c7563efa3 fix sanitizer warning
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 7fc13ebe63 fix thread race condition
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 0517be80cd Remove now-unneeded legacy stream adapter
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston d097f7bbcc remove no-longer needed input part data
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 8b829c9f68 Fix compile when threading disabled
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 9a3a4ab103 Convert deep tiled input to use the core library
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston d8ef05eb69 Add consistent checks, fix messaging
- readPixels and readPixelSampleCounts were not consistent in frame
buffer checks
- pixelData is allowed to be null but wasn't being guarded against
- Clear up message around check being run to apply the decode chunk
cache
- add common optimization for sample count copying

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston fb369b676c remove extraneous mutex
mutex is now has-a, not is-a but the subclass hadn't been removed

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 431633ab0c Relax safety check when reading uncompressed deep
tiled deep files which are uncompressed incorrectly write a "full" tile
worth of sample counts, except the data is actually tight packed to the
smaller portion of that tile size (i.e. at coarser levels or at
boundaries of non-tile multiple images). so handle that check against
the memory size when copying uncompressed data to unpack (i.e. when in
the non-cumulative count mode)

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 2cbed13136 Convert deep scanline input file to use core library
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 2cae20dfac Reduce scope of messages and avoid set but unused when threading off
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 56d6b2f2c4 Easier to find bugs with null pointer instead of size 0 alloc
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 4072e8021a Fix the sample stride and set the pointer to null instead of alloc size 0
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston a2827bf065 Properly fail when version number is not 1
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 1f860abc05 Invert stat and open to do open and use fstat
This should fix 2 of the code scan security warnings, at no particular
cognitive overhead, although is just in tests anyway

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 1a9d840201 Fix funky formatting
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 6284ed1331 Move tables, test logic to core now compression is moved
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 8ff2fea2a2 Remove over-optimization
Previous commits had tried to reduce the number of calls to chunk offset
but that prevented updates during partial header changes

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 064d7a695d Avoid oss fuzz checks in c++ by initializing scans differently
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 56bfb1c0ed avoid potential UB math, ensure value is initialized
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 20ad624cb6 remove friend cheat as windows symbols change
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 974ed87cb1 remove unneeded vararg from macro
not all compilers have named vararg macros yet

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston ff08cb52fd Ensure common type for std::max
Not all compilers coerce the types to the same

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 8445b0f611 switch compression to use core encode / decode pipeline function
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston f6990cd1f6 Add a tag to the constructors to indicate read / write / temp
This makes construction consistent with core, where by once constructed,
the object is ready to be used. (file is opened and parsed or ready for
population)

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 4edae36c3f Expose compression / decompression pipeline function
This will allow users of the pipeline to run the compression /
decompression, and to replace the C++ compressor utilities. This also
adds some additional checks and looser memory restrictions to the
decompression scheme for ease when we don't have all the information
needed for encoding / decoding.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 2136a12328 Add a temporary context
This will allow us to have a context without having to actually have a
file (i.e. to use a header object in the C++ layer, or compression)

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston e115444b69 avoid potential (not likely) overflow in tile count calc
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston c4df79caa8 Add ability for context initializer to tiled rgba input file
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 6cee1f89f1 Convert tiled input file to use the core library
Once all the input classes are done, will refactor to lift code out of
the internals of data to common elements in a singular place to avoid
code duplication.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 45d61cf750 Remove sparsely used cache variable
No need to cache a variable only used in an exceptional case, start to
prep for refactor of data block into context

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 585fba3c89 Greatly simplify the cache buffer mechanism when input is tiled
This also adds a bypass to avoid double copy, simpler memory management,
and prepping to have some common code refactored

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston e71cf825f1 Add query to get the tile counts for a level
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 183689c2b1 Make it easier for c++ to report specific exceptions on missing
When a chunk is missing, c++ would test if the offset is 0 and throw a
different exception, replicate that here

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston c9f585a846 Fix scope of threading enable check
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 48a65cd799 Actually compare two images
test code was comparing one image to itself, fix this, but the ratio
check was too narrow for half float values

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 7e0da7f5b7 Convert scanline input file to use the core
simplifies input file as well. Future changes may lift common code out
of scanline input into common utility in context / somewhere.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 6fdcad4a66 Allow the unpack routines to splat into a subset of the chunk
This will avoid an extra temporary buffer to be cached when reading
subsets of the image chunks

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston dc99c56e5f Add channel lookup utility
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston de8194872c make y and x sampling use consistent functions
Avoid duplicate code, simplify logic, fix scenario for all negative y
coordinates

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 0315f0e617 make b44 consistent with compression rules
Not sure why this was coded this way, must have been a separate /
previous bug, but b44 / b44a are not exempt from the rule that if the
compression is larger, store uncompressed.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 36d4b649b8 add try / catch to avoid throwing through the C interface
Streams that throw are an unfortunate choice, but such is the way.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 83dbddebe9 Remove commented deprecations until further review
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston f07333d2f4 Small cleanup
reduce scope of variables, collapse logic to avoid duplicate conditional
blocks, re-enable failable free test (original issues had already been
fixed, but test had not been re-enabled)

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 65c8ef6b22 Address review notes from meshula
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 91709fd6f6 Reproduce check against the count of chunk items
The C++ library had arbitrary (duplicate, non-editable) checks against a
max chunk count, because the IO streams can't always provide the file
size as a safety check. reproduce that here

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 4113c85fa6 remove extra spaces
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 1c699b6a3a Convert MultiPartInputFile to use context
Also simplifies InputFile to always defer to MultiPartInputFile to start
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 6c0403f586 fix checkfile typo, return value for ripmap vs mipmap tiles
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 2ccc2fc418 Clean extraneous deep data during chunk reconstruction
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston c381ee0eda Add test, accessor to match multipart behavior
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 9343c90cbc Improve exception messages
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 20bba90739 remove tracking of current position
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 993d684215 write some initial doxygen documentation
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston e4e6cf2eb6 Initial conversion of input file to use core
This is not complete (some of the dependencies are circular, so depends
on other later conversions to finish), so represents a WIP state

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston f1ac5fc91c handle custom attributes
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston f323762060 Better handle streams and attempts to read past end
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston fe3b536cca Complete conversion of header attributes to header class
Add additional constructor to opaque attribute to enable this.
Registered custom attributes still TODO

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston c3e212e9c7 Add initial context objects
These are not final, but should represent concepts we will use in new
world of using the core to replace the internals of the C++

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
Kimball Thurston 6b9b287fd1 switch to c++17 by default
This will enable use of string_view and similar API convenience as makes
sense. Given 17 has been standard for 4 years of VFX Platform, this
should be ok.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-09-15 15:06:42 +12:00
dependabot[bot] 5e35d02a9d Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 (#1814)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/8a08d616893759ef8e1aa1f2785787c0b97e20d6...0ab0b79471669eb3a4d647e625009c62f9f3b241)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 14:16:31 -07:00
Cary Phillips 9638cf555a Add version comment to github/codeql-action/analyze (#1811)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-03 17:55:36 -07:00
Cary Phillips cc8eaeaba1 Pin snyk/actions/setup to v0.4.0 (#1810)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-03 17:55:16 -07:00
Cary Phillips 7e4e3eb24e Fix pypa/gh-action-pypi-publish release name comment (#1809)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-09-03 17:54:57 -07:00
Joseph Goldstone 81e18d3f21 Update Joseph Goldstone affiliation (#1799)
Signed-off-by: Joseph Goldstone <jgoldstone@arri.com>
2024-09-02 18:07:54 -07:00
dependabot[bot] 939594faab Bump github/codeql-action from 3.24.10 to 3.26.6 (#1805)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.10 to 3.26.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.10...4dd16135b69a43b6c8efb853346f8437d92d3c93)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 18:04:00 -07:00
dependabot[bot] 2775703de2 Bump actions/setup-python from 5.1.1 to 5.2.0 (#1806)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/39cd14951b08e74b54015e9e001cdefcf80e669f...f677139bbe7f9c59b41e40162b753c062f5d49a3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 17:46:03 -07:00
dependabot[bot] 89013cee3b Bump actions/upload-artifact from 4.3.6 to 4.4.0 (#1807)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/834a144ee995460fba8ed112a2fc961b36a5ec5a...50769540e7f4bd5e21e526ee35c689e35e0d6874)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 17:45:29 -07:00
dependabot[bot] e27486a330 Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.0 (#1808)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0...8a08d616893759ef8e1aa1f2785787c0b97e20d6)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 17:38:31 -07:00
Cary Phillips 84d7d52e17 Rewrite OpenEXR python bindings using pybind11 and numpy (#1756)
* Rewrite python bindings with pybind11 and numpy

This introduces an entirely new python API for reading and writing
OpenEXR files that supports all file features (or will soon):
scanline, tiled, deep, multi-part, etc. It uses numpy arrays for pixel
data, and it supports both separate arrays for each channel and
interleaving of RGB data into a single composite channel.  It leaves
the existing binding API in place for backwards-compatibility; there's
no overlap between the two APIs.

See src/wrappers/python/README.md for examples of the new API.

The API is simple: the ``File`` object holds a py::list of ``Part``
objects, each of which has a py::dict for the header and a py::dict
for the channels, and each channels hold a numpy array for the pixel
data. There's intentionally no support for selective scanline/time
reading; reading a file reads the entire channel data for all parts.
There *is*, however, an option to read just the headers and skip the
pixel data entirely.

A few things don't work yet:

- Reading and writing of deep data isn't finished.
- ID manfest attributes aren't supported yet.
- For mipmaped images, it current only reads the top level.

This also does not (yet) properly integrate the real Imath types. It
leaves in place for now the internal "Imath.py" module, but defines
its own internal set of set of Imath classes. This needs to be resolve
once the Imath bindings are distributed via pypi.org

The test suite downloads images from openexr-images and runs them
through a battery of reading/writing tests. Currently, the download is
enabled via the ``OPENEXR_TEST_IMAGE_REPO`` environment variable that
is off by default but is on in the python wheel CI workflow.

This also adds operator== methods to ``KeyCode`` and ``PreviewImage``,
required in order to implement operator== for the ``Part`` and
``File`` objects.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix subsampling

Signed-off-by: Cary Phillips <cary@ilm.com>

* - Make README.md examples more pythonic
- Add __enter__/__exit__ so "with File(name) as f" works
- Allow channel dict to reference pixel array directly
- Fix subsampling

Signed-off-by: Cary Phillips <cary@ilm.com>

* Use numpy/tuples in place of Imath types

Also:
- Use single-element array for DoubleAttribute
- Use fractions.Fraction for Rational
- Use 8-element tuple for chromaticities
- Add __enter__/__exit__ so "with" works with File object
- remove operator== entirely, it's way too hard to implement something that's
  actually useful for testing purposes. The tests do their own validations.

Signed-off-by: Cary Phillips <cary@ilm.com>

pixel comparison

Signed-off-by: Cary Phillips <cary@ilm.com>

* Deep reading/writing works for both scanline and tiles

Also works properly for separate channels and when coalescing into
RGB/RGBA arrays.

Signed-off-by: Cary Phillips <cary@ilm.com>

* doc strings

Signed-off-by: Cary Phillips <cary@ilm.com>

* Rename rgba param to separate_channels, off by default.

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove numpy as build requirement

Signed-off-by: Cary Phillips <cary@ilm.com>

* Rename rgbaChannel() to channelNameToRGBA; rename is_* to objectTo*

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add "deprecated" to InputFile/OutputFile/Imath doc strings

Signed-off-by: Cary Phillips <cary@ilm.com>

* Explicitly set python versions for wheel workflows, and exclude 3.13

Signed-off-by: Cary Phillips <cary@ilm.com>

* resolve conflicts

Signed-off-by: Cary Phillips <cary@ilm.com>

* resolve conflict

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-08-12 17:31:42 -07:00
Cary Phillips be14297325 Fix documentation typo: screenWindowWidth is float, not V2f (#1778)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-08-12 11:47:38 -07:00
Vertexwahn de81234564 Bazel Build: Bump libdeflate to 1.21 (#1795)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2024-08-10 20:36:59 -07:00
dependabot[bot] 8a00d295ed Bump snyk/actions (#1794)
Bumps [snyk/actions](https://github.com/snyk/actions) from 6312a53377a551c0258438bf25fb8f378afbc977 to ae9442546152ba9bb0a1c85e2672112c97e7a06d.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](https://github.com/snyk/actions/compare/6312a53377a551c0258438bf25fb8f378afbc977...ae9442546152ba9bb0a1c85e2672112c97e7a06d)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-10 20:35:23 -07:00
dependabot[bot] 9efc6e4dbb Bump actions/upload-artifact from 4.3.4 to 4.3.6 (#1793)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.4 to 4.3.6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/0b2256b8c012f0828dc542b3febcab082c67f72b...834a144ee995460fba8ed112a2fc961b36a5ec5a)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-10 20:32:50 -07:00
dependabot[bot] 9965ef42b2 Bump pypa/cibuildwheel from 2.19.2 to 2.20.0 (#1791)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.2 to 2.20.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/7e5a838a63ac8128d71ab2dfd99e4634dd1bca09...bd033a44476646b606efccdd5eed92d5ea1d77ad)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-10 20:32:08 -07:00
Cary Phillips 56325bac73 Revert CodeQL to 2.18.0 (#1790)
Scanning with CodeQL vesion 2.18.1 appears to run amok and fail with
"no space left on device". The runs have traditionally taken around 5
minutes, but after the 2.18.1 release, they're failing after an hour.

Pin to the SHA for 2.18.0 for now, until there's a solution.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-08-10 20:31:23 -07:00
peterhillman c8a74d9ac9 add exrmetrics tool (#1769)
* add exrmetrics tool (no tile support yet)

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* fix windows build

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* fix test for parameters

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* omit filenames from exrmetrics output to simplify JSON compatibility

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* better diagnostics in exrmetrics test

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* print return code of mysteriously failing test

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* initialize compression method

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* support tiled images, drop verbose option

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* use chrono::steady_clock for timing

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2024-08-01 11:23:19 -07:00
dependabot[bot] d6be66e4d6 Bump snyk/actions (#1788)
Bumps [snyk/actions](https://github.com/snyk/actions) from 640e31719aac3e44867d239dc86c20c3e34c8e4f to 6312a53377a551c0258438bf25fb8f378afbc977.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](https://github.com/snyk/actions/compare/640e31719aac3e44867d239dc86c20c3e34c8e4f...6312a53377a551c0258438bf25fb8f378afbc977)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 17:26:37 -07:00
dependabot[bot] 11860ba3af Bump sigstore/gh-action-sigstore-python from 2.1.1 to 3.0.0 (#1782)
Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 2.1.1 to 3.0.0.
- [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases)
- [Changelog](https://github.com/sigstore/gh-action-sigstore-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/61f6a500bbfdd9a2a339cf033e5421951fbc1cd2...f514d46b907ebcd5bedc05145c03b69c1edd8b46)

---
updated-dependencies:
- dependency-name: sigstore/gh-action-sigstore-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 17:26:10 -07:00
dependabot[bot] 46b59d7844 Bump ossf/scorecard-action from 2.3.3 to 2.4.0 (#1787)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/dc50aa9510b46c811795eb24b2f1ba02a914e534...62b2cac7ed8198b15735ed49ab1e5cf35480ba46)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 17:25:35 -07:00
dependabot[bot] c767181a72 Bump actions/setup-python from 5.1.0 to 5.1.1 (#1781)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/82c7e631bb3cdc910f68e0081d67478d79c6982d...39cd14951b08e74b54015e9e001cdefcf80e669f)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 07:53:52 -07:00
Heshy Roskes 4b3bcf3138 fix example (#1714)
and raise error when running the buggy version
instead of python mysteriously crashing

fixes #1711

Signed-off-by: Heshy Roskes <heshyr@gmail.com>
2024-07-24 16:09:04 -07:00
dependabot[bot] da9aac0c62 Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 (#1768)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.14 to 1.9.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/81e9d935c883d0b210363ab89cf05f3894778450...ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 08:12:39 -07:00
dependabot[bot] e27b907590 Bump pypa/cibuildwheel from 2.18.1 to 2.19.2 (#1773)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.18.1 to 2.19.2.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/ba8be0d98853f5744f24e7f902c8adef7ae2e7f3...7e5a838a63ac8128d71ab2dfd99e4634dd1bca09)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 08:12:16 -07:00
dependabot[bot] f48ed3046d Bump actions/upload-artifact from 4.3.3 to 4.3.4 (#1774)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/65462800fd760344b1a7b4382951275a0abb4808...0b2256b8c012f0828dc542b3febcab082c67f72b)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 08:11:14 -07:00
dependabot[bot] 5d6096f019 Bump actions/download-artifact from 4.1.7 to 4.1.8 (#1775)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.7 to 4.1.8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/65a9edc5881444af0b9093a5e628f2fe47ea3b2e...fa0a91b85d4f404e444e00e005971372dc801d16)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 08:10:46 -07:00
dependabot[bot] f15bb90c7a Bump snyk/actions (#1777)
Bumps [snyk/actions](https://github.com/snyk/actions) from 8349f9043a8b7f0f3ee8885bf28f0b388d2446e8 to 640e31719aac3e44867d239dc86c20c3e34c8e4f.
- [Release notes](https://github.com/snyk/actions/releases)
- [Commits](https://github.com/snyk/actions/compare/8349f9043a8b7f0f3ee8885bf28f0b388d2446e8...640e31719aac3e44867d239dc86c20c3e34c8e4f)

---
updated-dependencies:
- dependency-name: snyk/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 08:10:18 -07:00
Cary Phillips faf697fd86 Fix GHA CI after they upgraded nodejs (#1779)
They upgraded to a version that requires a glibc newer than is in the
pre-2023 ASWF containers.

See https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4324

The example build is failing, but it turns out the ci build step
duplicates what happens in the validate_openexr_libs.sh script anyway,
so I'm removing it from the workflow.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-07-24 08:08:24 -07:00
Jamil Halabi 8169016e5c Fix duplicate uninstall targets (#1763)
Signed-off-by: Jamil Halabi <jay3dlinux@gmail.com>
2024-06-02 10:17:42 -07:00
dependabot[bot] cef97397c4 Bump ossf/scorecard-action from 2.3.1 to 2.3.3 (#1750)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.3.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/0864cf19026789058feabb7e87baa5f140aac736...dc50aa9510b46c811795eb24b2f1ba02a914e534)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-02 10:00:40 -07:00
dependabot[bot] 04b10543ad --- (#1757)
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-02 09:59:57 -07:00
Cary Phillips 370db28358 Fix setting of part name via "name" attribute (#1748)
Calling `exr_attr_set_string()` on the "name" attribute sets the part
name. But this was inadvertently setting the part name to the string
"name", not to the actual value of the attribute.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-05-13 10:09:52 -07:00
Joseph Goldstone ef52af0387 'Stop' to 'tStop' in website desc of standard attributes (#1754)
Signed-off-by: Joseph Goldstone <jgoldstone@arri.com>
2024-05-13 10:08:51 -07:00
Cary Phillips 37594c2103 Install website requirements in venv (#1749)
Apparently, macOS doesn't like to pip install into the system-wide
location, it prefers a venv.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-05-13 09:39:07 -07:00
Christina Tempelaar-Lietz 810e4567a9 Update CI workflow to 2024 images.
Signed-off-by: Christina Tempelaar-Lietz <xlietz@gmail.com>
2024-05-08 14:27:12 -04:00
dependabot[bot] e89466bf0a Bump actions/upload-artifact from 4.3.2 to 4.3.3 (#1733)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/1746f4ab65b179e0ea60a494b83293b640dd5bba...65462800fd760344b1a7b4382951275a0abb4808)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 11:23:18 -04:00
dependabot[bot] da3f4494cd Bump actions/download-artifact from 4.1.5 to 4.1.7 (#1736)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.5 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/8caf195ad4b1dee92908e23f56eeb0696f1dd42d...65a9edc5881444af0b9093a5e628f2fe47ea3b2e)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 11:22:34 -04:00
Vertexwahn 7de2958171 Bazel support: Add test output to CI Bazel tests (#1744)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2024-05-07 11:21:22 -04:00
Matthias Moulin 5f9bee0d77 Removed unused sliceOptimizationData::type (#1742)
Removed unused `sliceOptimizationData::type` (which is always equal to `OPENEXR_IMF_INTERNAL_NAMESPACE::HALF`).

Signed-off-by: Matthias Moulin <matthias.moulin@gmail.com>
2024-05-07 11:20:30 -04:00
Dirk Lemstra 1b2b78858d Silence warning C4201: nonstandard extension used: nameless struct/union.
Signed-off-by: Dirk Lemstra <dirk@lemstra.org>
2024-05-04 14:25:38 +12:00
Kimball Thurston 694606da25 Fix mis-match in compression levels and tile description
This means all files saved c++ vs C match precisely, re-enable that
failure mode (had been behind an env variable)

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-21 10:38:56 +12:00
Kimball Thurston 421f1b4d2a Fix discrepancy from C++ in DWAA compress
C++ differentiated scanlines vs tiles in the DWAA compression type

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-21 10:38:56 +12:00
dependabot[bot] 1a28088c89 Bump actions/upload-artifact from 4.3.1 to 4.3.2 (#1723)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/5d5d22a31266ced268874388b861e4b58bb5c2f3...1746f4ab65b179e0ea60a494b83293b640dd5bba)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-20 09:26:42 -07:00
dependabot[bot] cfcf99e1a8 Bump actions/download-artifact from 4.1.4 to 4.1.5 (#1722)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/c850b930e6ba138125429b7e5c93fc707a7f8427...8caf195ad4b1dee92908e23f56eeb0696f1dd42d)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-20 09:25:18 -07:00
Kimball Thurston 94bf6ca43c Add tests for new functions added
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-20 14:32:05 +12:00
Kimball Thurston 031978a255 allow querying the chunk table offset while in write mode
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-20 14:32:05 +12:00
Kimball Thurston aed82c1484 Add unknown storage mode for future proofing, fix logic
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-20 14:32:05 +12:00
Kimball Thurston e7f1099440 Fix flag handling and storage type validation to match
Long name attribute flags was not being set correctly and the rules
around when there is a mismatch between the bit flags in the header and
the type attribute were not being correctly handled

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-20 14:32:05 +12:00
Kimball Thurston f38fb9d2c8 Add missing deep image state attribute
Not sure when that got added to the C++ library, but wasn't in the core

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-20 14:32:05 +12:00
Kimball Thurston 5b034db00a Add api for C++ integration
Add additional API for querying information from the context for
integration into the C++ code base. These should be reviewed prior to
final release whether they need to persist or are only temporary

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-04-20 14:32:05 +12:00
Cary Phillips 67614ffdc1 Add test for example python code in the pypi README.md (#1716)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-04-14 15:30:29 -07:00
Cary Phillips d669510fda Pin sphinx to 7.1.2
The build distro does not yet support 7.2+. 7.1 is the latest available.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-04-09 13:48:49 -07:00
Cary Phillips 9aa1484719 Improve filters for ossfuzz and bazel (#1703)
Ignore changes to workflow files other than the one in question.

Also, no point in filtering out old release branches and tags, since
the workflow files don't exist there anyway.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-04-09 13:43:36 -07:00
dependabot[bot] da6b169cf0 Bump sphinx from 5.3 to 7.2.6 (#1694)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.3 to 7.2.6.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.3.0...v7.2.6)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 13:43:00 -07:00
dependabot[bot] 4bc6077fa6 Bump actions/upload-artifact from 3.1.0 to 4.3.1 (#1713)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.0 to 4.3.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3.1.0...5d5d22a31266ced268874388b861e4b58bb5c2f3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 13:35:21 -07:00
StepSecurity Bot 7a31cd5953 [StepSecurity] ci: Harden GitHub Actions (#1707)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2024-04-08 17:27:49 -07:00
Cary Phillips 6c12cc1577 Create codeql.yml (#1709)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-04-08 17:27:08 -07:00
dependabot[bot] 063149e8e2 Bump github/codeql-action from 3.24.9 to 3.24.10 (#1710)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.9 to 3.24.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1b1aada464948af03b950897e5eb522f92603cc2...4355270be187e1b672a7a1c7c7bae5afdc1ab94a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 17:26:42 -07:00
Reini Urban 0084673f97 website: fix whitespace typo (#1706)
Signed-off-by: Reini Urban <reini.urban@gmail.com>
2024-04-05 16:05:28 -07:00
dependabot[bot] cf1e57c01e Bump github/codeql-action from 2.2.4 to 3.24.9 (#1695)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.4 to 3.24.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/17573ee1cc1b9d061760f3a006fc4aac4f944fd5...1b1aada464948af03b950897e5eb522f92603cc2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:37 -07:00
dependabot[bot] 133012a29e Bump pypa/cibuildwheel from 2.16 to 2.17 (#1696)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.16 to 2.17.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.16...v2.17)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:54:57 -07:00
dependabot[bot] f7d33c4e56 Bump actions/download-artifact from 4.0.0 to 4.1.4 (#1697)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.0.0 to 4.1.4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.0.0...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:53:22 -07:00
dependabot[bot] 7682c03774 Bump actions/cache from 4.0.0 to 4.0.2 (#1698)
Bumps [actions/cache](https://github.com/actions/cache) from 4.0.0 to 4.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.0.0...v4.0.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:36:12 -07:00
Cary Phillips 509a227b9f Set archive prefix for signed releases (#1702)
* Set archive prefix for signed releases

This makes it so the signed release archives extract to a subdirectory
named with the tag without the leading 'v', e.g. "openexr-3.2.4". The release tarball has the same name.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Set job-specific write permission

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-31 17:00:33 -07:00
Cary Phillips e39ec0c817 Build website on windows/macos, and remote unnecessary installs (#1701)
Readthedocs builds the website on ubuntu-20.04, so technically that's
the only system that requires the website to build properly, but
developers contributing to the website may work on Windows or macOS,
so this confirms that it builds properly there, too.

Now that the test image files are no longer generated at build time,
no need to install imagemagic and openexr or run the test_image.py
script.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-31 16:51:49 -07:00
Aliaksei Urbanski 9d3e061a0b 📝 Fix OPENEXR_DEFLATE_REPO option's description (#1699)
Signed-off-by: Aliaksei Urbanski <aliaksei.urbanski@gmail.com>
2024-03-27 10:58:49 -07:00
Cary Phillips ddd116bb0b Add website news items for v3.2.4, v3.2.3, and v3.1.13 (#1691)
* Release notes for v3.2.4

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add additional PRs to to release notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* Release notes for v3.1.13

Signed-off-by: Cary Phillips <cary@ilm.com>

* New for v3.2.4 and v3.1.13

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-26 09:54:02 -07:00
Cary Phillips 076c8324c5 Improve workflow files (#1693)
- Per OpenSSF, permissions should be read at the top level, with
  additional permissions only for the necessary run.
- Add .github/dependabot.yml
- Fix a typo in the website_workflow's filters.
- Run the snyk-scan only on the main repo, not forks, since it
  requires secrets.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-26 09:53:39 -07:00
peterhillman 0e92e7d40b add page on scene-linear images to website (#1683)
* add page on scene-linear to website

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* require 'dot' in website workflow test. Add helpful links

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* require graphviz for chart

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* separate chart-to-png conversion, move synonyms to footnotes

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* add caveat about EXR contents; clarify input and scene linear

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* tweaks to introduction and gray card section

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* terminology tweaks and other fixes suggested by Cary

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* add carrots image and link

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* simplify scene-linear explanation in website home page

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* improve graph rendering; fix more typos

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2024-03-24 16:49:00 -07:00
peterhillman c28c320c11 Extend exrstdattr to add -erase option (#1688)
* add -erase option to exrstdattr

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* reorder operations and add test for erase in exrstdattr

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2024-03-22 17:09:10 -07:00
Philippe Leprince 272e4b356d Document steps to add a new compression method in ImfCompression.h (#1672)
* Document steps in ImfCompression.h

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Add some steps I had missed.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Move description to ImfCompression.cpp and mention the C API first.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* no functional change: use regular comment style and trim trailing whitespace.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

---------

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
2024-03-22 17:05:19 -07:00
Gabriela Gutierrez 3c9e34a372 Update scorecard v2.3.1 (#1686)
Fix Scorecard breaking due to not being able to sign the results. Scorecard uses Sigstore tool to sign its results and Sigstore has done an update (https://blog.sigstore.dev/tuf-root-update/). This update is not compatible with older Scorecard versions (for example, v.2.1.2 used here), but Scorecard v2.3.1 is compatible with Sigstore changes.

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
2024-03-22 17:04:10 -07:00
Kimball Thurston bfbdccb482 Fix typo causing prefix len to be wrong (#1684)
When constructing the decompress side of dwaa/b compression support,
simple typo when computing the prefix length as distance between
pointers causing the length to be wrong, triggering csc decompression
values to be wrong when decompressed.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-21 16:23:28 -07:00
Kimball Thurston 9fa6984f22 fix rebase commit id (#1685)
rebase and merge actually ran rebase and generated a new commit id

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-21 16:22:34 -07:00
xiaoxiaoafeifei 7aa89e1d09 prevent integer overflows in file exrmultipart.cpp (#1681)
Signed-off-by: ZhaiLiangliang <zhailiangliang@loongson.cn>
2024-03-19 09:09:05 -07:00
Christina Tempelaar-Lietz d822c79707 Update docker images to 2024. (#1679)
Signed-off-by: Christina Tempelaar-Lietz <xlietz@gmail.com>
2024-03-18 11:25:01 -07:00
Peter StenetegandCary Phillips d623158e7d CMake packaging fix. (#1674)
* CMake packaging fix.

Add find_dependency for the new dependency libdeflate, and remove the REQUIRED flag. find_dependency will pickup the correct flag from the calling find_package call.

Signed-off-by: Peter Steneteg <peter@steneteg.se>

* find_dependency only if libdeflate_FOUND

Signed-off-by: Cary Phillips <cary@ilm.com>

* Need to expand the libdeflate_FOUND variable at configure_file time

Signed-off-by: Peter Steneteg <peter@steneteg.se>

---------

Signed-off-by: Peter Steneteg <peter@steneteg.se>
Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2024-03-18 11:21:32 -07:00
Cary Phillips 00a11d8c36 Add custom website footer with ASWF logo and proper copyright (#1669)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-18 11:18:01 -07:00
Cary Phillips 7b1556baaa Replace auto-generation of test image .jpgs with explicit sidecars (#1667)
Automatically generating .jpg images for display under "Test Images"
as a step in building the website seemed like a good idea a the time,
but is too hard to maintain. I couldn't get the process to work across
Linux, macOS, and Windows, which means no Windows/macOS-based
developers can contribute to the website.

The https://github.com/AcademySoftwareFoundation/openexr-images repo
now has a permenant sidecar .jpg file associated with each .exr which
serves as a proxy for display on the website.

The `website/scripts/test_images.py` is still in place but is now to
be run manually to generate the website `.rst` and the associated
`.rst` files describing each image. Anyone providing additional test
images to the`openexr-image` repo should contribute an associated
`.jpg` for display.

To contribute additional images, first add the images to the image
repo, then run the `website/scripts/test_image.py`, and commit the
new/modified `.rst` files(s).

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-18 11:17:46 -07:00
Kimball Thurston 5f18d4854d register clang-format run to avoid blame
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-17 22:03:02 +13:00
Kimball Thurston 84f58b85ae Run clang-format
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-17 22:03:02 +13:00
Kimball Thurston 915cb814ca Simplify and clarify names for internal convenience macros
The macros used to check the context arguments and define a part to
reduce boilerplate were confusingly named and with collapsing type
names, creating duplicate / unnecessary variables

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-17 22:03:02 +13:00
Kimball Thurston 01e9f18f0b Simplify internal part type structure usage
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-17 22:03:02 +13:00
Kimball Thurston ada8e4e43d Eliminate more use of explicit internal structure names
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-17 22:03:02 +13:00
Kimball Thurston d261527005 disable some warnings when compiling deflate internally
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-17 22:03:02 +13:00
Kimball Thurston 40c2237e8e collapse internal types to avoid warnings
rename the internal struct to match the priv struct in the context
declaration, such that we can avoid extra variables and just access the
context, and make a similar change for part.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-17 22:03:02 +13:00
Cary Phillips 1719d067dc Pin RTD to sphinx 5.3 (#1673)
Sphinx handling of `html_logo` and `html_favicon` changed in version 6,
but changing to the documented logo_url and favicon_url still doesn't
work for some reason. But Sphinx 5.3 works, so let's pin to that. This
will need to get sorted out at some point, when there's a need to move
to a newer sphinx.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-13 17:49:45 -07:00
Cary Phillips c60c0ebde3 Improve workflow filters (#1668)
Run the ci_workflow and website_workflow only on changes to the
appropriate source files and workflow files.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-13 17:49:24 -07:00
Cary Phillips f0da5b700d Add link to PR description to readthedocs build (#1664)
Readthedocs triggers a build on PR, and a link is provided in the PR
checks, but it's obscure. This action adds a link to the PR
description, but only for PR's that actually modify the website.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-10 15:23:23 -07:00
Aliaksei UrbanskiandCary Phillips 82d027505b 🐛 Remove the OPENEXR_INSTALL_EXAMPLES CMake option (#1666)
The OPENEXR_INSTALL_EXAMPLES option is misleading and doesn't have any effect.
It might be safely removed in favor of the OPENEXR_BUILD_EXAMPLES option.

Signed-off-by: Aliaksei Urbanski <aliaksei.urbanski@gmail.com>
Co-authored-by: Cary Phillips <cary@ilm.com>
2024-03-10 15:05:05 -07:00
Cary Phillips 502b246ce1 website news for v3.2.3 (#1663)
* news for v3.2.3

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix links

Signed-off-by: Cary Phillips <cary@ilm.com>

* spacing

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-06 17:18:19 -08:00
Cary Phillips b057235dcb Add reference to TSC meeting notes to README and website (#1658)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-06 15:42:00 -08:00
Cary Phillips c27ea89334 Argument to isValidCompression should be int rather than Compression (#1661)
The sanitizer flags invalid enum values. By definition, the argument
might not be a valid enum value.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-06 15:41:48 -08:00
Cary Phillips bea5cca8fb Initialize _ySampling to 0 (#1662)
Caught by the santizer as potential use-before-initialization

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-06 15:28:59 -08:00
Vertexwahn ad9d698035 Bazel support: Support only Bzmlod and bump Imath version (#1660)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2024-03-06 14:12:14 -08:00
Cary Phillips f2a71f71b7 Use size_t as iterator instead of int (#1659)
Caught by the sanitizer

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-06 13:03:49 -08:00
Cary Phillips 4e37911922 Add test and website reference for exrmanifest (#1657)
`test_exrmanifest.py` mirrors the other tool tests in validating
command line arguments. The test images were generated by running the
`deepidexample` example program with its various arguments. The
associated `.txt` are snapshots of the output of `exrmanifest`, so
they validate that the output hasn't changed. Should a future change
to the library/program change the format or content of the output, the
files will need to be updated.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-06 13:03:27 -08:00
Cary Phillips 2a579fd392 Add table of linux distro openexr versions to website install page (#1656)
https://repology.org provides autogenerated tables of package versions
for many linux distros

Also, add workflow_dispatch trigger, because it's handy during debugging.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-05 15:19:22 -08:00
Philippe Leprince 60898ada40 Automate compression method detection (#1616)
* cmake generates relevant files to integrate all compression methods.
See CMakeLists.txt for details.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* update utilities

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* fix gitignore

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* sanity check for gaps in enum ids.
suggested by @peterhillman.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Use isValidCompressionId() instead of hard-coded test.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* generate ImfCRgbaFile.h

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* move implementation to ImfCompression.cpp to hide CompressionDesc.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* convert IdToDesc to a static array.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* ImfCompressor.h was not correctly removed from the list.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* replace cmake_path() with string() if cmake version < 3.20.0. Flagged by @cary-ilm.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Only generate the files with option UPDATE_COMPRESSOR_LIST=ON.
All files are generated during configuration, making them available for bazel. See comments at the top of src/lib/OpenEXR/CMakeLists.txt.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Fix incorrect defines.
spotted by @peterhillman

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Improve DO NOT EDIT messages.
suggested by @peterhillman.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Add new testCompressionApi test.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Enable UPDATE_COMPRESSOR_LIST in ci_workflow.yml.
Suggested by @peterhillman.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Add missing ImfCompression.cpp to BUILD.bazel

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Remove cmake file generation but keep codec API and tests.
Thanks to @cary-ilm and @peterhillman.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

Fixed: I missed a couple of lines in the CI setup.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

fix whitespace to minimize diff

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

fix whitespace to minimize diff

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

fix whitespace to minimize diff

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Restore comments describing the codecs.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

* Move isValidCompression, isValidCompression, isValidDeepCompression from ImfCompressor to ImfCompression.
- simplify logic in isLossyCompression and isValidDeepCompression.
- additional clarifications in comments / doc strings.

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>

---------

Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
2024-03-05 15:18:38 -08:00
Todica Ionut b7e936c60b centered colon (#1654)
Signed-off-by: Todica Ionut <todicaionut2000111@gmail.com>
2024-03-04 12:47:30 -08:00
Cary Phillips 44488f1fc0 Add recent releases to website news (#1651)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-02 16:59:08 -08:00
Cary Phillips 9c6c12f097 Run release-sign workflow on published instead of created (#1650)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-03-02 16:58:57 -08:00
Kimball Thurston 403740625b Allow partial chunk tables (#1653)
* fix sporadic UB in dwa

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Allow partial chunk tables

This will fix #1642, re-enabling partial chunk tables during
reconstruction (at least for the last part read). Correctly handles
reconstructing tables where discovered tiles are shifted from expected
indices

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Avoid OOB write

When reconstructing chunk table with corrupt chunks, avoid writing out
of bounds

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* avoid undefined behavior

unaligned reads are UB, use (__builtin_) memcpy

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-02 15:51:02 +13:00
Kimball Thurston d37e681a65 Fix 0 samples in deep data (#1652)
Add some additional safety checks, but properly handle when there are 0
samples in a deep scanline / tile (chunk)

Should fix #1639 and OSS-Fuzz 66612

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-03-02 13:52:59 +13:00
Cary Phillips 23902642b9 Bump required cmake to 3.14 (#1644)
This should have gone in to #1624 since `file(CREATE_LINK)` requires
CMake 3.14.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-28 16:44:16 -08:00
Cary Phillips 37122bb8d4 Update release notes from recent releases (#1645)
* Release notes for v3.1.12

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add 1523, 1525, 1527 to notes

Signed-off-by: Cary Phillips <cary@ilm.com>

* Release notes for v3.2.2

Signed-off-by: Cary Phillips <cary@ilm.com>

* update release notes for v3.2.2

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-28 14:22:30 -08:00
Cary Phillips 35bf5cdaff Remove -Dsonar.login from sonar-scanner command line (#1647)
Addresses #1646

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-28 14:21:29 -08:00
Cary Phillips 5fe60f9448 Fix memory leaks in exrstdattr and example code (#1649)
Caught by the address sanitizer, worth addressing in the example code
as good programming practice.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-28 09:25:58 -08:00
Cary Phillips 32de807ca6 Add instructions for creating signed releases/tags (#1637)
* Add instructions for creating signed releases/tags

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add openexr.keyring

Signed-off-by: Cary Phillips <cary@ilm.com>

* Sign & upload release artifacts via sigstore

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add release-sign.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

* Use gh-action-sigstore-python

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-21 14:49:24 -08:00
Jean-Christophe Morin 222bc3d449 Use component for python (#1643)
* Add "COMPONENT python" to install() the python bindings and tell scikit-build-core to only install the python component

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>

* Update scikit-build-core to 0.8.1

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>

* Fix typo

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>

---------

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
2024-02-20 08:35:37 -08:00
Cary Phillips 68470dd26b Fix version tag for python wheel sdist (#1640)
* Fix version tag for sdist

Signed-off-by: Cary Phillips <cary@ilm.com>

* Don't set OPENEXR_RELEASE_CANDIDATE_TAG for the non-test publish

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-15 17:01:06 -08:00
6905396791 Build python wheels via scikit-build-core (#1629)
* Build python wheels via scikit-build-core

This converts the setuptools configuration for building python wheels
to use scikit-build-core, which has better support for CMake. There is
no more setup.py; the configuration is entirely in `pyproject.toml`
and the compile/link is done exclusively via cmake.

The build/publish policy is:

* A PR that changes any of the python wheel source/configuration
  (src/wrappers/python/* or .github/workflows/python-wheels.yml)
  triggers a build as a check.

* PRs that change other library source do *not* trigger a build of the
  python wheels. Note that the primary CI workflow does build and test
  the bindings, although only for a single python version on a single
  arch for Linux/macOS/Windows. The wheel building validates multiple
  python versions and architectures, but involves signifant
  computation/time.  Currently, the python wheels are a thin wrapper
  about basic read/write functions that don't add significant
  additional functionality to the library. Any potential problem will
  almost certainly get caught by the primary CI.

* A tag of the form `v3.[0-9]+.[0-9]+-rc*` (e.g. `v3.2.4-rc`) triggers
  a full build of the wheels followed by a publish to
  `test.pypi.org`. This validates release candidates.

* Publishing a release triggers a full build of the wheels followed by
  a publish to `pypi.org`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add custom README.md for pypi.org

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix typo

Signed-off-by: Cary Phillips <cary@ilm.com>

* reference src/wrappers/python/README.md in pyproject.toml

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add copyright notice

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update pyproject.toml

Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update pyproject.toml

Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Update src/wrappers/python/CMakeLists.txt

Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Add uninstall target (#1624)

* Add uninstall target

Satisfy the OpenSSF Best Practices Badge requirement for an
insta/uninstall process:
https://www.bestpractices.dev/en/criteria/1#1.installation_common

CMake does not support a standard "uninstall" target, but the
community recommends implementing an "uninstal" target that remove files named in the
`install_manifest.txt`:
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake

However, our existing process of installing the symlink to the "bare"
library, i.e. the symlink from libImath-3_2.so to libImath.so, fails
to add the symlink to the manifest, so "make uninstall" misses the
symlink. The existing mechanism use "install(CODE execute_process(cmake -E create_symlink))".

This changes that to use a simpler "file(CREATE_LINK)" and
"install(FILES)" to accomplish the same thing while also registering
the symlink the the manifest.

Also, this fixes an issue where `OpenEXRConfig.h` was passed to
`install()` twice, producing two entries in `install_manifest.txt`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention uninstall in install instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

* poke

Signed-off-by: Cary Phillips <cary@ilm.com>

* COPY_ON_ERROR

Signed-off-by: Cary Phillips <cary@ilm.com>

* clarify the uninstall instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add cmake.targets and OPENEXR_INSTALL=OFF

Signed-off-by: Cary Phillips <cary@ilm.com>

* INSTALL_TOOLS=OFF

Signed-off-by: Cary Phillips <cary@ilm.com>

* propogate OPENEXR_INSTALL to Imath

Signed-off-by: Cary Phillips <cary@ilm.com>

* test1

Signed-off-by: Cary Phillips <cary@ilm.com>

* OPENEXR_INSTALL_PKG_CONFIG

Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix CVE 2023 5841 (#1627)

* enable deep file checks for core

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* fix possible int overflow

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* fix validation of deep sample counts

Addresses CVE-2023-5841, fixing sample count check to not only check
against 0 but previous sample as well.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* add clarifying comment

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Bazel support: Bump Imath to 3.1.10 (#1626)

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Document security expectations (#1623)

* Document security expectations

Signed-off-by: Cary Phillips <cary@ilm.com>

* Menion Imath as a dependency

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update SECURITY.md

Co-authored-by: Nick Porcino <meshula@hotmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* change 'Threat Model' to 'Potential Vulnerabilties'

Signed-off-by: Cary Phillips <cary@ilm.com>

* Mention GitHub issue as fallback security contact

Signed-off-by: Cary Phillips <cary@ilm.com>

* github security advisory

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention exrcheck

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Nick Porcino <meshula@hotmail.com>

* Add uninstall target (#1624)

* Add uninstall target

Satisfy the OpenSSF Best Practices Badge requirement for an
insta/uninstall process:
https://www.bestpractices.dev/en/criteria/1#1.installation_common

CMake does not support a standard "uninstall" target, but the
community recommends implementing an "uninstal" target that remove files named in the
`install_manifest.txt`:
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake

However, our existing process of installing the symlink to the "bare"
library, i.e. the symlink from libImath-3_2.so to libImath.so, fails
to add the symlink to the manifest, so "make uninstall" misses the
symlink. The existing mechanism use "install(CODE execute_process(cmake -E create_symlink))".

This changes that to use a simpler "file(CREATE_LINK)" and
"install(FILES)" to accomplish the same thing while also registering
the symlink the the manifest.

Also, this fixes an issue where `OpenEXRConfig.h` was passed to
`install()` twice, producing two entries in `install_manifest.txt`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention uninstall in install instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

* poke

Signed-off-by: Cary Phillips <cary@ilm.com>

* COPY_ON_ERROR

Signed-off-by: Cary Phillips <cary@ilm.com>

* clarify the uninstall instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>

* Remove snyk-scan-pr.yml (#1631)

This workflow is causing errors on each PR:

  Snyk is missing auth token in order to run inside CI. You must include your API token as an environment value: `SNYK_TOKEN=12345678`
  Error: Process completed with exit code 2.

As discussed on #1608, the preferred workflow will run weekly, not on PR.

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix issue with unpacking sample counts (#1630)

When unpacking sample counts as "individual" counts (no longer
monotonic), it writes the total sample count to a value 1 past the
individual sample counts, but this is not in the packed data, so do not
expect to unpack that many values. The buffer just needs to be allocated
one value larger to avoid write past end of buffer which is taken care
of in the update_pack_unpack_ptrs function

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* adjust checks for core to better match c++ checks (#1632)

The core checks were not setting the same image / tile size limits and
not disabling reads at quite the same level.

Note: the core check does not read the entire image into a contiguous
slice, so does not replicate the maximum deep sample checks in the same
way, this is a source of potential false-negative failures

This should address OSS-Fuzz 66491 and 66489 (different forms of the
same failure where a large sample size allocation was happening), and
are only constrained memory (2.5Gb) issues.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Fix install of symlink (#1633)

PR #1624 caused the .so symlink without the `OPENEXR_LIB_SUFFIX`
(e.g. libOpenEXR.so which links to libOpenEXR-3_2.so) to get created
in the wrong directory. This caused certain invocations of cmake to
fail, even though the invocation in the CI succeeded. It's not at all
clear why.

This also changes the CI to invoke cmake in the way that previously
failed (e.g. from the top-level directory with `-B` and `-S`), as an additional check.

Signed-off-by: Cary Phillips <cary@ilm.com>

* adds a shortcut to avoid reconstructing every call (#1634)

When there is a loop trying to get scan / tile info that is ignoring
return values, add a shortcut to avoid trying to reconstruct the chunk
table every time. This will still respect the strict header flag, either
returning an error immediately (strict), or (non-strict) enabling a
multi-part file with only partially corrupt parts to work.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* check and control reduceMemory and reduceTime in stream mode (#1635)

exrcheck by default uses file mode, but the fuzzer and exrcheck -s use
stream mode, need to respect the memory and time flags consistently on
that path as well.

Will address OSS-Fuzz 66612, although real fix underlying is in #1634

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* Update .github/workflows/python-wheels-publish-test.yml

Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Add sdist

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update .github/workflows/python-wheels-publish-test.yml

Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* fix sdist; remove debugging

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Co-authored-by: Kimball Thurston <kdt3rd@gmail.com>
Co-authored-by: Vertexwahn <julian.amann@tum.de>
Co-authored-by: Nick Porcino <meshula@hotmail.com>
2024-02-13 15:32:43 -08:00
John Mertic a6668bc136 Do synk scans weekly on Sunday mornings (#1636)
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
2024-02-12 15:13:16 -08:00
Cary Phillips c7eadcb442 Remove duplicate line in release-notice.yml
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-11 20:13:23 -08:00
Kimball Thurston e60db963bc check and control reduceMemory and reduceTime in stream mode (#1635)
exrcheck by default uses file mode, but the fuzzer and exrcheck -s use
stream mode, need to respect the memory and time flags consistently on
that path as well.

Will address OSS-Fuzz 66612, although real fix underlying is in #1634

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-02-11 22:50:44 +13:00
Kimball Thurston ca27a212d6 adds a shortcut to avoid reconstructing every call (#1634)
When there is a loop trying to get scan / tile info that is ignoring
return values, add a shortcut to avoid trying to reconstruct the chunk
table every time. This will still respect the strict header flag, either
returning an error immediately (strict), or (non-strict) enabling a
multi-part file with only partially corrupt parts to work.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-02-11 22:50:24 +13:00
Cary Phillips c8276f7f1f Fix install of symlink (#1633)
PR #1624 caused the .so symlink without the `OPENEXR_LIB_SUFFIX`
(e.g. libOpenEXR.so which links to libOpenEXR-3_2.so) to get created
in the wrong directory. This caused certain invocations of cmake to
fail, even though the invocation in the CI succeeded. It's not at all
clear why.

This also changes the CI to invoke cmake in the way that previously
failed (e.g. from the top-level directory with `-B` and `-S`), as an additional check.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-10 14:05:09 -08:00
Kimball Thurston b56b9b0672 adjust checks for core to better match c++ checks (#1632)
The core checks were not setting the same image / tile size limits and
not disabling reads at quite the same level.

Note: the core check does not read the entire image into a contiguous
slice, so does not replicate the maximum deep sample checks in the same
way, this is a source of potential false-negative failures

This should address OSS-Fuzz 66491 and 66489 (different forms of the
same failure where a large sample size allocation was happening), and
are only constrained memory (2.5Gb) issues.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-02-09 18:00:03 -08:00
Kimball Thurston bc0fe433fe fix issue with unpacking sample counts (#1630)
When unpacking sample counts as "individual" counts (no longer
monotonic), it writes the total sample count to a value 1 past the
individual sample counts, but this is not in the packed data, so do not
expect to unpack that many values. The buffer just needs to be allocated
one value larger to avoid write past end of buffer which is taken care
of in the update_pack_unpack_ptrs function

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-02-09 17:34:16 -08:00
Cary Phillips 28c935b3c2 Remove snyk-scan-pr.yml (#1631)
This workflow is causing errors on each PR:

  Snyk is missing auth token in order to run inside CI. You must include your API token as an environment value: `SNYK_TOKEN=12345678`
  Error: Process completed with exit code 2.

As discussed on #1608, the preferred workflow will run weekly, not on PR.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-10 12:28:31 +13:00
Cary Phillips 08f5e69cd5 Add uninstall target (#1624)
* Add uninstall target

Satisfy the OpenSSF Best Practices Badge requirement for an
insta/uninstall process:
https://www.bestpractices.dev/en/criteria/1#1.installation_common

CMake does not support a standard "uninstall" target, but the
community recommends implementing an "uninstal" target that remove files named in the
`install_manifest.txt`:
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake

However, our existing process of installing the symlink to the "bare"
library, i.e. the symlink from libImath-3_2.so to libImath.so, fails
to add the symlink to the manifest, so "make uninstall" misses the
symlink. The existing mechanism use "install(CODE execute_process(cmake -E create_symlink))".

This changes that to use a simpler "file(CREATE_LINK)" and
"install(FILES)" to accomplish the same thing while also registering
the symlink the the manifest.

Also, this fixes an issue where `OpenEXRConfig.h` was passed to
`install()` twice, producing two entries in `install_manifest.txt`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention uninstall in install instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

* poke

Signed-off-by: Cary Phillips <cary@ilm.com>

* COPY_ON_ERROR

Signed-off-by: Cary Phillips <cary@ilm.com>

* clarify the uninstall instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-09 13:25:58 -08:00
Cary PhillipsandNick Porcino a3fe0eb813 Document security expectations (#1623)
* Document security expectations

Signed-off-by: Cary Phillips <cary@ilm.com>

* Menion Imath as a dependency

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update SECURITY.md

Co-authored-by: Nick Porcino <meshula@hotmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* change 'Threat Model' to 'Potential Vulnerabilties'

Signed-off-by: Cary Phillips <cary@ilm.com>

* Mention GitHub issue as fallback security contact

Signed-off-by: Cary Phillips <cary@ilm.com>

* github security advisory

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention exrcheck

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Nick Porcino <meshula@hotmail.com>
2024-02-08 15:58:52 -08:00
Vertexwahn 47f7cd2127 Bazel support: Bump Imath to 3.1.10 (#1626)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2024-02-07 14:46:42 -08:00
Kimball Thurston 46944c3a87 Fix CVE 2023 5841 (#1627)
* enable deep file checks for core

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* fix possible int overflow

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* fix validation of deep sample counts

Addresses CVE-2023-5841, fixing sample count check to not only check
against 0 but previous sample as well.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* add clarifying comment

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
2024-02-04 11:44:21 -08:00
Cary Phillips 8743203dfc Make 'Hello, World' example reader/writer downloadable (#1620)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-02 11:38:03 -08:00
Cary Phillips 95031106a8 Add a reference to building tools from source to the tools webpage. (#1622)
Signed-off-by: Cary Phillips <cary@ilm.com>
2024-02-02 11:37:38 -08:00
Cary PhillipsandNick Porcino 745681ca2d Add explanation of distinction between OpenEXR/OpenEXRCore to API section (#1621)
* Add explanation of the distinction between OpenEXR/OpenEXRCore to API section

This was described in the release notes but was never addressed in the
actual online documentation, where it was not, in fact, obvious.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Update website/API.rst

Co-authored-by: Nick Porcino <meshula@hotmail.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
Co-authored-by: Nick Porcino <meshula@hotmail.com>
2024-02-02 11:37:18 -08:00
Cary Phillips bafa35e16b GitHub action for release notices on Slack (#1601)
* GitHub action for release notices on Slack

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add missing 'on' trigger

Signed-off-by: Cary Phillips <cary@ilm.com>

* use openexr logo

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-01-21 16:45:40 -08:00
Cary Phillips f113a8f4ad Require sphinx 5.0 (#1617)
Apparently now required by other dependencies

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-01-21 16:45:11 -08:00
Brecht Van Lommel cb94fe1dfc Support cmake config for libdeflate (#1613)
* Support cmake config and shared library for libdeflate

When not using the internal deflate, the only option was pkgconfig which
is not well supported on Windows. This adds support for using the
libdeflate cmake config files when available.

This change also affects the generated OpenEXR cmake config files. For
a static OpenEXR library, INTERFACE_LINK_LIBRARIES now appropriately
includes libdeflate along with the existing dependencies like Imath.

It also turns the internal libdeflate into a target for consistency.

Resolves #1588

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

* Back out of adding a target for internal libdeflate

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

* Use Requires.private for generated pkgconfig file

Signed-off-by: Brecht Van Lommel <brecht@blender.org>

---------

Signed-off-by: Brecht Van Lommel <brecht@blender.org>
2024-01-21 16:44:43 -08:00
Cary Phillips ce7d59f270 Update MacPorts install instructions (#1611)
* Update MacPorts install instructions

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove sudo

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention vcpkg for Windows

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-01-21 16:43:42 -08:00
Cary Phillips ae1dde6646 Fix bswap on NetBSD (#1612)
The #includes were incorrect.

Signed-off-by: Cary Phillips <cary@ilm.com>
2024-01-21 16:43:19 -08:00
Vertexwahn d0cae91e8f Fix spelling of GitHub (#1615)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2024-01-21 16:42:56 -08:00
David Deal e571107f1e CI/CD - Added Snyk C/C++ Scanning Job (#1608)
- added example C/C++ Code scanner using the Snyk GitHub Action.
  The `--unmanaged` flag indicates this is for a C/C++ codebase. In this
  example, it currently scans on a new pull request to the 'main'
  branch. The repository administrator should set both the SNYK_ORG and
  SNYK_TOKEN environment variables before merging this PR. The
  environment variables can be obtained from the LFX Security team.
- added *.h, *.c, *.cpp filter to only run the scan when source files
  are changed

Signed-off-by: David Deal <ddeal@linuxfoundation.org>
2024-01-10 09:26:25 -08:00
Vertexwahn 86d0fb0985 Bump skylib in workspace approach (#1605)
Default behavior enable_bzlmod was switch (https://github.com/bazelbuild/bazel/issues/18958)

Bump Bazel version to 7.0.0

Update Bazel modules

Apply buildifier on MODULE.bazel

Signed-off-by: Vertexwahn <julian.amann@tum.de>
2023-12-30 19:31:35 -08:00
Cary Phillips 6258740337 Release notes and news for v2.5.10 (#1600)
* Release notes for v2.5.10

Signed-off-by: Cary Phillips <cary@ilm.com>

* News for v2.5.10

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-12-20 11:19:05 -08:00
Cary Phillips d65a626cba Account for duplicate emails with .mailmap (#1597)
The .mailmap file maps author/committer names and emails to canonical
real names and email addresses.

This also updates the CONTRIBUTORS.md file with missing names from the
git logs.

This information is to the best of our knowledge, but please submit
any corrections if you prefer.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-12-20 11:18:50 -08:00
Cary Phillips 1cac626750 Bump version on main to 3.3.0 (#1599)
The version on main stays a minor release ahead of the latest release,
currently 3.2.1. This should have gotten bump right after the 3.2.0
release.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-12-20 11:18:34 -08:00
Megha S e9400ca0ed Converting code-blocks to literalincludes in ReadingAndWritingImageFiles.rst (#1583)
* Converting code-blocks to literalincludes in ReadingAndWritingImageFiles.rst

Signed-off-by: Megha S <megha199501@gmail.com>

* Addressed review comments

Signed-off-by: Megha S <megha199501@gmail.com>

* Changing from std::clamp to Imath::clamp

Signed-off-by: Megha S <megha199501@gmail.com>

---------

Signed-off-by: Megha S <megha199501@gmail.com>
2023-12-18 17:53:41 -08:00
annguyen-ilm defea17b76 #1545 Fix formatting of sample exr file in OpenEXRFileLayout.rst - 3rd attempt (#1587)
* Replaced the sample exr file code blocks with a grid table formatted with bytes of the sample file in one column. The value in the second column and the third column being the description of the bytes and value.

Signed-off-by: An Nguyen <annguyen@ilm.com>

* * Updated so the ascii values for the bytes are aligned to each byte.
* Gave the table a title and reduce the width to 50%

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Added missing 4 bytes missing from the dataWindow value and displayWindow value

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Added the sample.exr file

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Annotated the attribute values more for the header. Should be a bit clearer.

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Adding the sample.exr file was documented.

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Added download link to the sample.exr file.

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Move the download link above the table. Updated the paragraph before the table to describe the table

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Move the sample.exr image into the downloads directory to match the target destination naming scheme to avoid confusion where the files go when built

Signed-off-by: An Nguyen <annguyen@ilm.com>

* Updated the table to annotate the type and literal as type.

Signed-off-by: An Nguyen <annguyen@ilm.com>

---------

Signed-off-by: An Nguyen <annguyen@ilm.com>
2023-12-18 15:24:53 -08:00
peterhillman 831d967aba add deep id/manifest tools and doc (#1595)
* add deep id/manifest tools and docs

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* fix const-ness in deepidexample

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* fix link on doc, better variable name

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* add discussion of cryptomatte and deep compositing

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* fix names of cryptomatte ID channels

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

---------

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
2023-12-18 15:22:59 -08:00
Dave Sawyer 9be75dc78f Remove some dead code when writing (#1592)
The file version is set to 2 above for writing files (it is impossible write version 1 data). Please refer to the history of history of ImfDwaCompressor.cpp or look at the reading code for details on the version 1 format.

Signed-off-by: Dave Sawyer <kingsawyer@gmail.com>
2023-12-09 22:53:55 -08:00
Anton Dukhovnikov 231d0e96ef Fix issue with decompressing fp32 dwa files (#1591)
There was an issue with the data type not passed to the DCT decompressor in the DWA decoder. That caused 32 bit DWA images to look squashed, as the decompressed 16 bit values were not getting expanded back to 32 bit.

Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
2023-11-10 08:44:27 -08:00
Ben Grimes fca936a964 Add tests for the Header class. (#1577)
These are intended to exercise methods that are currently not covered by
other tests according to the coverage report.

Signed-off-by: Ben Grimes <bgrimes@ilm.com>
2023-10-16 11:17:46 -04:00
cdleu430 de791a50ca adding better error reporting for bin tests (#1578)
forgot a few things

Signed-off-by: cdleu430 <cleu@ilm.com>
2023-10-14 16:47:01 -04:00
Barnaby Robson 4de528df6c python-wheels.yml - add arm64 builds for macOS (#1579)
The CI platform that builds the wheels is Intel based and
by default only builds Intel wheels.

Modern Macs are all based on Apple Silicon so to support them
we need to also build arm64. This is done via cross compiling.

It is not possible to test when cross compiling according to:

https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile

Signed-off-by: Barnaby Robson <brobson@ilm.com>
2023-10-14 16:44:04 -04:00
Barnaby Robson cc94a1949d python-wheels.yml - bumps cibuildwheel version (#1576) 2023-10-12 21:20:22 -04:00
Barnaby Robson a3b46d5cd9 fix typo in README.md (#1575)
* fix typo in README.md

change make -> cmake

Signed-off-by: Barnaby Robson <brobson@ilm.com>

* removes mkdir.

Suggested by Milos in review. I tested it and it works.

Signed-off-by: Barnaby Robson <brobson@ilm.com>

---------

Signed-off-by: Barnaby Robson <brobson@ilm.com>
2023-10-10 09:48:30 -07:00
ianianda 159e57120d install.rst - update $ to % in the example shell prompts (#1570)
Signed-off-by: ianianda <wyking1030@gmail.com>
2023-09-24 22:44:44 -04:00
Cary Phillips 3893e34a12 Add missing blank line in news.rst
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-23 09:08:33 -07:00
Cary Phillips 7c5c3126da Fix Imf/Iex/IlmThread namespaces in python bindings and website code (#1568)
* Fix Imf/Iex/IlmThread namespaces in python bindings and website code

Use OPENEXR_NAMESPACE, IEX_NAMESPACE, ILMTHREAD_NAMESPACE instead of
Imf, Iex, IlmThread, to support custom settings.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Use Iex:: namespace in example code instead of IEX_NAMESPACE

Requires this in all.cpp:

  namespace Iex = IEX_NAMESPACE;

Signed-off-by: Cary Phillips <cary@ilm.com>

* use #define Iex

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove explicit Iex namespace

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-23 08:48:00 -07:00
Cary Phillips dc50388ada Add missing blank line after news
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-22 22:32:00 -07:00
Cary Phillips 99d0737b01 Clean up handling of libdeflate when linking static (#1561)
* Set EXR_DEFLATE_LIB properly for static linking

This leads OpenEXRCore/CMakeLists.txt to do:

    target_link_libraries(OpenEXRCore PUBLIC libdeflate)

instead of:

    target_link_libraries(OpenEXRCore PUBLIC PkgConfig::deflate)

which is not recognized. With a target link library of
`PkgConfig::deflate`, the static build of the OpenEXR libraries builds
successfully, but configuring an application against those static
libraries fails, saying it can't find `PkgConfig::deflate`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add -ldeflate to pkgconfig for static builds

When static linking and referencing an external libdeflate (i.e. not
fetching and building internally), OpenEXR.pc needs -ldeflate.

This also adds a test for this condition to the CI's validation script.

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-22 16:47:10 -07:00
Cary Phillips 7273a3936a Add latest news to website homepage
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-22 10:41:07 -07:00
Cary Phillips 3fbb532bb2 add reference to dev days wiki to news
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-22 10:28:17 -07:00
Cary Phillips 9a7235462b Add Dev Days to website news
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-20 11:28:45 -07:00
Cary Phillips d537f40cd5 Omit OPENEXR_IMAGES_TAG from test image url if empty (#1560)
This allows the url for the test images to reference a local file:

  cmake -DOPENEXR_IMAGES_REPO=file:///my/clone/of/openexr-images -DOPENEXR_IMAGES_TAG=""

which avoids the remote downloading of the test images at cmake time.

Also, mention the test images in the install docs.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-19 09:54:47 -07:00
Cary Phillips af911099ab Set build-shared:OFF for Static build (#1557)
Looks like this somehow we've been building shared when we meant to be
building static.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-19 09:54:31 -07:00
Vertexwahn 71d1bc1b4d Bazel: Improve module (#1562)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2023-09-18 19:22:37 -07:00
Vertexwahn 1b12960b46 Update openexr_deps.bzl (#1565)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2023-09-17 21:38:25 -07:00
Cary Phillips dfb1b9ad00 Default value for chromaticities attribute constructor in exrstdattr (#1540)
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-12 11:19:33 -07:00
Cary Phillips 3c6560a354 Python wheel setup gets version from OpenEXR.pc/Imath.pc (#1536)
* Python wheel setup gets version from OpenEXR.pc/Imath.pc

OpenEXR and Imath have indepdenent versions that may not match. The
.pc files appear to be the simplest way to extract the versions and
library suffixes.

Running pkg-config itself doesn't work on Windows, hence the manual
file parsing.

Signed-off-by: Cary Phillips <cary@ilm.com>

* =

Signed-off-by: Cary Phillips <cary@ilm.com>

* Remove -DOPENEXR_INSTALL_PKG_CONFIG=ON since it's now on by default

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-12 11:05:30 -07:00
Cary Phillips f355c3b304 Remove SPDX license identifier in LICENSE.md
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-12 10:22:34 -07:00
Cary Phillips afd7492d2e OPENEXR_INSTALL_PKG_CONFIG is on by default, even on Windows (#1541)
There seems to be no downside to generating the OpenEXR.pc file even
on Windows, so for consistency, apply the setting to all platforms.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-12 10:14:08 -07:00
Diogo Teles Sant'Anna a66776f96d Add Scorecard GitHub Action (#1535)
* Add Scorecard GitHub Action

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* Add Scorecard badge to README.md

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

---------

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
2023-09-11 11:53:01 -07:00
Cary Phillips 4e9d5ecc22 Fix OPENEXR_VERSION_HEX (#1539)
* Fix OPENEXR_VERSION_HEX

* fix syntax error
* remove unnecessary uint32_t cast
* add validation test

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add #if statement with OPENEXR_VERSION_HEX

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-09-01 08:06:40 -07:00
Cary Phillips 1ee0ffec3a Fix warnings from cross-compiling with x86_64-w64-mingw32-gcc-posix (#1534)
* Fix compiler warnings from x86_64-w64-mingw32-g++-posix

* MSVCRT doesn't recognize printf("%l") so PRIu64 doesn't work, it
  expects "%I64u".

* Add to the cases that disable a strncpy warning

Signed-off-by: Cary Phillips <cary@ilm.com>

* %zu for size_t

Signed-off-by: Cary Phillips <cary@ilm.com>

* revert attempt to fix PRIu64 warnings

Signed-off-by: Cary Phillips <cary@ilm.com>

* revert blank line

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-31 13:30:32 -07:00
Cary Phillips 9a0cf1f1c8 Update 3.2.0 release date in news.rst
Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-30 11:06:26 -07:00
Cary Phillips ef9b27c91b Fix warnings in multipartExamples.cpp (#1533)
* Fix warnings in multipartExamples.cpp

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix indentation

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-30 08:39:10 -07:00
Cary Phillips 28d90d919c Don't trigger ci/bazel/ossfuzz builds on pushes/PRs to src/wrappers (#1532)
No need to rebuild/test OpenEXR on changes to the python wheels.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-30 08:38:54 -07:00
Cary Phillips b8aef3e690 Remove check for _MSC_VER in internal_cpuid.h (#1528)
As noted in #1445, _MSC_VER should only be used to detect msvc, not
for Windows. The _WIN32 check should be sufficient. The extra check
for _MSC_VER fails when cross-compiling from Linux to Windows.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-30 08:38:36 -07:00
Cary Phillips aa66972fd1 Propagate OPENEXR_INSTALL_PKG_CONFIG to internal Imath (#1531)
* Propagate OPENEXR_INSTALL_PKG_CONFIG to internal Imath

If OpenEXR is installing a pkg-config file, then the internal Imath
build (if there is one) should install it, too.

Also, add an explicit release version variable to the .pc file.

This is in preparation for the python wheel build to pick up the
version settings from the pkg-config files.

Signed-off-by: Cary Phillips <cary@ilm.com>

* remove version= from OpenEXR.pc

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-30 08:31:56 -07:00
Diogo Teles Sant'Anna 0c17c283fa Set minimal permissions for workflow python-wheels.yml (#1530)
The exact same changes done on other workflows through the PR #1417

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
2023-08-29 14:59:03 -07:00
Cary Phillips df91c16103 OpenEXRConfig.h.in uses version extracted from openexr_version.h (#1527)
* OpenEXRConfig.h.in uses version extracted from openexr_version.h

The logic was already in place to extract the version from
`openexr_version.h`, so the `.in` file just needed to reference the
proper CMake variables. This also duplicates the `OpenEXR_VERSION_*`
settings to `OPENEXR_VERSION_*`.

Signed-off-by: Cary Phillips <cary@ilm.com>

* bazel

Signed-off-by: Cary Phillips <cary@ilm.com>

* comment

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix formatting of core version test error message

Signed-off-by: Cary Phillips <cary@ilm.com>

* fix extra comparison test

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-28 10:43:47 -07:00
Vertexwahn cd854af9f7 Add bzlmod support (#1525)
Signed-off-by: Vertexwahn <julian.amann@tum.de>
2023-08-28 09:18:45 -07:00
Cary Phillips acdbda98d1 Add DEPENDENCIES Imath::Imath for OpenEXRCore (#1523)
This frees exrinfo and any other external application from any special
settings to pick up the necessary Imath #includes.

Signed-off-by: Cary Phillips <cary@ilm.com>
2023-08-28 09:18:33 -07:00
935 changed files with 135567 additions and 82468 deletions
+12
View File
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
common --enable_platform_specific_config
# Enable modern C++ features
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17
build:windows --cxxopt=/std:c++17
build:windows --host_cxxopt=/std:c++17
+1 -1
View File
@@ -1 +1 @@
6.3.2
9.0.0
+2
View File
@@ -6,3 +6,5 @@
# initial clang-format run
2a24ae77ab94f4c06b102eba73feb52e2f90cb46
# clang-format run 17-Mar-2024
84f58b85aef7a7844f0d3bfb1301e778eb22e42c
+40
View File
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
exclude-paths:
- ".github/workflows/ci_workflow_old.yml"
groups:
codeql:
patterns:
- "github/codeql-action/*"
- package-ecosystem: "pip"
directory: "/website"
schedule:
day: "monday"
interval: "weekly"
# Hashed lockfile is regenerated locally with pip-compile; do not let
# Dependabot rewrite it (transitive bumps belong in requirements.txt or
# a deliberate lock regen, not automated lock-only PRs).
exclude-paths:
- "website/requirements-lock.txt"
- "website/requirements.txt.lock"
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
day: "monday"
interval: "weekly"
- package-ecosystem: "bazel"
directory: "/"
schedule:
interval: "weekly"
+13 -17
View File
@@ -22,24 +22,20 @@ jobs:
# ---------------------------------------------------------------------------
linux_sonarcloud:
name: 'SonarCloud Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
name: 'SonarCloud Linux CentOS 7 VFX CY2024 <GCC 11.2.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
image: aswf/ci-openexr:2026
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
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 50
- name: Create build directories
@@ -51,7 +47,7 @@ jobs:
cmake .. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
-DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
-DCMAKE_C_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
@@ -86,20 +82,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: sonar-scanner -X -Dsonar.login=$SONAR_TOKEN
run: sonar-scanner -X
# ------------------------------------------------------------------------------
# Valgrind memcheck test
# ------------------------------------------------------------------------------
linux_valgrind:
name: 'Valgrind Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
name: 'Valgrind Linux CentOS 7 VFX CY2024 <GCC 11.2.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
image: aswf/ci-openexr:2024
env:
CXX: g++
CC: gcc
@@ -109,7 +105,7 @@ jobs:
- name: Setup container
run: sudo rm -rf /usr/local/lib64/cmake/glew
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 50
- name: Create build directories
@@ -126,7 +122,7 @@ jobs:
cmake .. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS='OFF' \
-DOPENEXR_BUILD_TOOLS='ON' \
@@ -157,14 +153,14 @@ jobs:
# Fuzz test
# ------------------------------------------------------------------------------
linux_fuzz:
name: 'Fuzz Test ${{ matrix.build-descrip }} Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
name: 'Fuzz Test ${{ matrix.build-descrip }} Linux CentOS 7 VFX CY2024 <GCC 11.2.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
image: aswf/ci-openexr:2024
strategy:
matrix:
build: [1, 2]
@@ -188,7 +184,7 @@ jobs:
- name: Setup container
run: sudo rm -rf /usr/local/lib64/cmake/glew
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 50
- name: Create build directories
@@ -201,7 +197,7 @@ jobs:
cmake .. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS='OFF' \
-DOPENEXR_BUILD_TOOLS='ON' \
+27 -31
View File
@@ -12,82 +12,78 @@ name: Bazel
on:
push:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/bazel_build.yml'
pull_request:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/bazel_build.yml'
permissions:
contents: read
jobs:
build_and_test_ubuntu:
name: Linux Ubuntu 22.04 Bazel build <GCC 11.4.0>
runs-on: ubuntu-22.04
name: Linux Ubuntu 24.04 Bazel build <GCC 13.3.0>
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mount Bazel cache
uses: actions/cache@v3
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: "/home/runner/.cache/bazel"
key: bazel-ubuntu-22
key: bazel-ubuntu-24
- name: Build
run: |
bazelisk build //...
bazelisk test //...
bazel build //...
bazel test --test_output=errors //...
build_and_test_windows:
name: Windows Server 2022 build <Visual Studio 2022>
runs-on: windows-2022
name: Windows Server 2025 build <Visual Studio 2022>
runs-on: windows-2025
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mount Bazel cache
uses: actions/cache@v3
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: "/home/runner/.cache/bazel"
key: bazel-windows-2022
key: bazel-windows-2025
- name: Build
run: |
bazelisk build //...
bazelisk test //...
bazel build //...
bazel test --test_output=errors //...
build_and_test_macos:
name: macOS 13 Bazel build <Apple Clang14>
runs-on: macos-13
name: macOS 15 Bazel build <Apple Clang14>
runs-on: macos-15
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mount Bazel cache
uses: actions/cache@v3
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: "/home/runner/.cache/bazel"
key: bazel-macos-13
key: bazel-macos-15
- name: Build
run: |
bazelisk build //...
bazelisk test //...
bazel build //...
bazel test --test_output=errors //...
+60
View File
@@ -0,0 +1,60 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
# Build and test on FreeBSD using a community VM action.
# GitHub does not provide native FreeBSD runners; this uses vmactions/freebsd-vm.
# Validates the pthread fallback in internal_thread.h (issue #2299).
name: CI (FreeBSD)
on:
push:
paths:
- '**'
- '!**.md'
- '!website/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ci_freebsd.yml'
pull_request:
paths:
- '**'
- '!**.md'
- '!website/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ci_freebsd.yml'
permissions:
contents: read
jobs:
freebsd:
name: FreeBSD
runs-on: ubuntu-latest
steps:
- name: Build and test on FreeBSD
uses: vmactions/freebsd-vm@5a72679103d223925653750faa878a143340fbd0 # v1.5.0
with:
release: '15.0'
envs: GITHUB_REPOSITORY GITHUB_REF GITHUB_SHA
usesh: true
prepare: |
pkg install -y cmake ninja git
run: |
set -e
git clone --depth 1 "https://github.com/${GITHUB_REPOSITORY}.git" src
cd src
# shallow clone, only the commit that triggered the run, i.e. GITHUB_SHA
git fetch --depth 1 origin "${GITHUB_SHA}"
git checkout "${GITHUB_SHA}"
cmake -B _build -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DOPENEXR_FORCE_INTERNAL_IMATH=ON \
-DOPENEXR_FORCE_INTERNAL_DEFLATE=ON \
-DOPENEXR_FORCE_INTERNAL_OPENJPH=ON \
-DBUILD_TESTING=ON
cmake --build _build
ctest --test-dir _build --output-on-failure
+474
View File
@@ -0,0 +1,474 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
# These are the steps for all CI jobs. Linux, macOS, and Windows all
# share a common set of configure/build/validate steps. The input
# variables control all variations of the jobs.
#
# Each job validates that the proper files are installed by comparing
# the install_manifest.txt to a reference for that job. This requires
# that each job have a corresponding reference, and that thes
# references are updated when any change is made to the installation
# headers/libraries/cmake/etc.
name: CI Steps
on:
workflow_call:
# This inputs receive values via the "with:" section in ci_workflow.yml
inputs:
build:
type: string
os:
type: string
container:
type: string
cmake:
type: string
cxx-standard:
type: string
cxx-compiler:
type: string
cc-compiler:
type: string
build-type:
type: string
msystem:
type: string
BUILD_SHARED_LIBS:
type: string
OPENEXR_ENABLE_THREADING:
type: string
OPENEXR_INSTALL_PKG_CONFIG:
type: string
OPENEXR_INSTALL_DOCS:
type: string
OPENEXR_BUILD_EXAMPLES:
type: string
OPENEXR_BUILD_TOOLS:
type: string
OPENEXR_FORCE_INTERNAL_IMATH:
type: string
OPENEXR_FORCE_INTERNAL_DEFLATE:
type: string
OPENEXR_FORCE_INTERNAL_OPENJPH:
type: string
CMAKE_OSX_ARCHITECTURES:
type: string
BUILD_TESTING:
type: string
RUN_TESTING:
type: string
namespace:
type: string
validate_install:
type: string
configure_install_prefix:
type: string
permissions:
contents: read
jobs:
steps:
runs-on: ${{ inputs.os }}
permissions:
contents: write # required for actions/upload-artifact
container:
image: ${{ inputs.container }}
env:
CXX: ${{ inputs.cxx-compiler }}
CC: ${{ inputs.cc-compiler }}
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set Up Directories & Environment
run: |
set -x
# Be careful to use consistent paths between Windows and
# Linux. Convert backslashed Windows paths to Linux style via cygpath,
# i.e. convert D:\a\Imath\Imath to /d/a/Imath/Imath.
# WORKSPACE is the root of the project directory
if [[ "$RUNNER_OS" == "Windows" ]]; then
WORKSPACE=$(cygpath -u "$GITHUB_WORKSPACE")
# remember the install location for Imath, libdeflate, openjph
PROGRAM_FILES=$(cygpath -u "C:/Program Files (x86)")
echo "PROGRAM_FILES=$PROGRAM_FILES" >> $GITHUB_ENV
else
WORKSPACE=$GITHUB_WORKSPACE
fi
echo "WORKSPACE=$WORKSPACE" >> $GITHUB_ENV
# BUILD_DIR is the CMake build directory
BUILD_DIR=$WORKSPACE/_build
echo "BUILD_DIR=$BUILD_DIR" >> $GITHUB_ENV
# INSTALL_DIR is the CMake install directory
INSTALL_DIR=$WORKSPACE/_install
echo "INSTALL_DIR=$INSTALL_DIR" >> $GITHUB_ENV
# Initialize the PATH necessary for the tests on Windows
echo "OPENEXR_PATH=$INSTALL_DIR/bin:$INSTALL_DIR/lib" >> $GITHUB_ENV
# Install gcc for macOS if necessary
if [[ "${{ inputs.cc-compiler }}" == "gcc" && "$RUNNER_OS" == "macOS" ]]; then
brew install gcc
fi
shell: bash
- name: Report C Runtime Version
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
ldd --version 2>&1 | head -1 || true
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "macOS SDK: $(xcrun --show-sdk-version 2>/dev/null || echo 'unknown')"
fi
shell: bash
- name: Install Build Dependencies (Fedora)
if: startsWith(inputs.container, 'fedora:')
run: |
dnf install -y gcc gcc-c++ cmake make git wget libdeflate-devel
shell: bash
- name: Determine MSYS2 Packages
if: inputs.msystem != ''
run: |
PACKAGES="cc:p cmake:p"
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}" == "OFF" ]; then
PACKAGES="$PACKAGES imath:p"
fi
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}" == "OFF" ]; then
PACKAGES="$PACKAGES libdeflate:p"
fi
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}" == "OFF" && "${{ inputs.msystem }}" != "MINGW32" ]; then
PACKAGES="$PACKAGES openjph:p"
fi
echo "PACBOY_PACKAGES=$PACKAGES" >> $GITHUB_ENV
shell: bash
- name: Install MSYS2 ${{ inputs.msystem }}
if: inputs.msystem != ''
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
with:
msystem: ${{ inputs.msystem }}
update: true
install: git
pacboy: ${{ env.PACBOY_PACKAGES }}
- name: Set Up CMake
# CMakeLists.txt specifies a minimum cmake version of 3.14 for
# the OpenEXR project, so use that for the CI by default. But
# install a specific version to test with if a different one
# is specified.
run: |
set -ex
CMAKE=cmake
CTEST=ctest
if [[ "${{ inputs.cmake }}" != "" && "$RUNNER_OS" == "Linux" ]]; then
CMAKE_VERSION=${{ inputs.cmake }}
CURRENT_CMAKE_VERSION=$(cmake --version | head -n 1 | cut -f3 -d' ')
if [ "$CMAKE_VERSION" != "$CURRENT_CMAKE_VERSION" ]; then
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
tar -xzf cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
CMAKE=$(find "$PWD" -type f -path "*/bin/cmake" | head -n 1)
CTEST=$(find "$PWD" -type f -path "*/bin/ctest" | head -n 1)
fi
fi
echo CMAKE="$CMAKE" >> $GITHUB_ENV
echo CTEST="$CTEST" >> $GITHUB_ENV
shell: bash
- name: Install Imath
# Pre-install Imath so the builds validate that find_package sees the external installation
if: inputs.OPENEXR_FORCE_INTERNAL_IMATH == 'OFF' && inputs.msystem == ''
run: |
set -x
share/ci/scripts/install_imath.sh main
echo "OPENEXR_PATH=$OPENEXR_PATH:$PROGRAM_FILES/Imath/bin:$PROGRAM_FILES/Imath/lib" >> $GITHUB_ENV
shell: bash
- name: Install libdeflate
# Pre-install libdeflate so the builds validate that find_package sees the external installation
if: inputs.OPENEXR_FORCE_INTERNAL_DEFLATE == 'OFF' && inputs.msystem == ''
run: |
set -x
share/ci/scripts/install_libdeflate.sh master
echo "OPENEXR_PATH=$OPENEXR_PATH:$PROGRAM_FILES/libdeflate/bin:$PROGRAM_FILES/libdeflate/lib" >> $GITHUB_ENV
shell: bash
- name: Install OpenJPH
# Pre-install OpenJPH so the builds validate finding the external installation
if: inputs.OPENEXR_FORCE_INTERNAL_OPENJPH == 'OFF' && inputs.msystem == ''
run: |
set -x
share/ci/scripts/install_openjph.sh 0.22.0
echo "OPENEXR_PATH=$OPENEXR_PATH:$PROGRAM_FILES/openjph/bin:$PROGRAM_FILES/openjph/lib" >> $GITHUB_ENV
shell: bash
- name: Install help2man
# TODO: this could go in the ASWF Linux docker
# container. Also, it doesn't currently work for Windows, so
# the windows builds have docs disabled.
if: inputs.OPENEXR_INSTALL_DOCS == 'ON'
run: share/ci/scripts/install_help2man.sh
shell: bash
- name: Construct CMake command
run: |
# Construct the cmake command as a variable, so the
# Configure step below can execute it, but also so we can store
# in in the install_manifest as a debugging reference
# Configure/build with a .tmp install prefix, so we can
# validate the install properly overrides it.
cmake_args=("-B" "$BUILD_DIR" -S "$WORKSPACE")
cmake_args+=("-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR${{ inputs.configure_install_prefix}}")
cmake_args+=("-DCMAKE_BUILD_TYPE=${{ inputs.build-type }}")
cmake_args+=("-DOPENEXR_CXX_STANDARD=${{ inputs.cxx-standard }}")
cmake_args+=("-DBUILD_SHARED_LIBS=${{ inputs.BUILD_SHARED_LIBS }}")
cmake_args+=("-DOPENEXR_ENABLE_THREADING=${{ inputs.OPENEXR_ENABLE_THREADING }}")
cmake_args+=("-DOPENEXR_INSTALL_PKG_CONFIG=${{ inputs.OPENEXR_INSTALL_PKG_CONFIG }}")
cmake_args+=("-DOPENEXR_INSTALL_DOCS=${{ inputs.OPENEXR_INSTALL_DOCS }}")
cmake_args+=("-DOPENEXR_BUILD_EXAMPLES=${{ inputs.OPENEXR_BUILD_EXAMPLES }}")
cmake_args+=("-DOPENEXR_BUILD_TOOLS=${{ inputs.OPENEXR_BUILD_TOOLS }}")
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_IMATH=${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}")
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}")
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_OPENJPH=${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}")
cmake_args+=("-DBUILD_TESTING=${{ inputs.BUILD_TESTING }}")
cmake_args+=("-DOPENEXR_RUN_FUZZ_TESTS=OFF")
cmake_args+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
if [ -n "${{ inputs.namespace }}" ]; then
cmake_args+=("-DOPENEXR_IMF_NAMESPACE=${{ inputs.namespace }}")
cmake_args+=("-DILMTHREAD_NAMESPACE=${{ inputs.namespace }}")
cmake_args+=("-DIEX_NAMESPACE=${{ inputs.namespace }}")
fi
if [ "${{ inputs.msystem }}" == "MINGW32" ]; then
cmake_args+=("-DCMAKE_C_FLAGS=-msse2 -mfpmath=sse")
cmake_args+=("-DCMAKE_CXX_FLAGS=-msse2 -mfpmath=sse")
fi
if [ -n "${{ inputs.CMAKE_OSX_ARCHITECTURES }}" ]; then
cmake_args+=("CMAKE_OSX_ARCHITECTURES='${{ inputs.CMAKE_OSX_ARCHITECTURES }}'")
fi
quoted_args=$(printf '%q ' "${cmake_args[@]}")
echo "CMAKE_ARGS=$quoted_args" >> "$GITHUB_ENV"
# Set the install manifest name to include the os and build number.
# e.g. install_manifest.macos.1.txt. Note that $RUNNER_OS is "Linux",
# while input.os is "ubuntu".
os_name=$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]') # linux, macos, windows
build="${{ inputs.build }}"
echo INSTALL_MANIFEST_FILENAME="install_manifest.${os_name}.${build}.txt" >> $GITHUB_ENV
shell: bash
- name: Configure, Build, Install
if: inputs.msystem == ''
run: |
set -x
"$CMAKE" --version
"$CMAKE" ${{ env.CMAKE_ARGS }}
# Reconfigure in the same build dir to catch Imath include-path
# regressions on CMake reconfigure (see #2441).
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}" == "ON" ]; then
"$CMAKE" ${{ env.CMAKE_ARGS }}
fi
if [ -n "${{ inputs.configure_install_prefix }}" ]; then
"$CMAKE" --build "$BUILD_DIR" --config ${{ inputs.build-type }}
"$CMAKE" --install "$BUILD_DIR" --prefix "$INSTALL_DIR" --config ${{ inputs.build-type }}
else
"$CMAKE" --build "$BUILD_DIR" --target install --config ${{ inputs.build-type }}
fi
shell: bash
- name: Configure, Build, Install (msys2) # requires msys2 shell
if: inputs.msystem != ''
run: |
set -x
"$CMAKE" --version
"$CMAKE" ${{ env.CMAKE_ARGS }}
# Reconfigure in the same build dir to catch Imath include-path
# regressions on CMake reconfigure (see #2441).
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}" == "ON" ]; then
"$CMAKE" ${{ env.CMAKE_ARGS }}
fi
if [ -n "${{ inputs.configure_install_prefix }}" ]; then
"$CMAKE" --build "$BUILD_DIR" --config ${{ inputs.build-type }}
"$CMAKE" --install "$BUILD_DIR" --prefix "$INSTALL_DIR" --config ${{ inputs.build-type }}
else
"$CMAKE" --build "$BUILD_DIR" --target install --config ${{ inputs.build-type }}
fi
shell: msys2 {0}
- name: Test OpenEXR.pc
# Validate that OpenEXR.pc works by compiling/linking the test program
if: runner.os == 'Linux' && inputs.OPENEXR_INSTALL_PKG_CONFIG == 'ON'
run: |
set -x
if [ "${{ inputs.BUILD_SHARED_LIBS }}" == "OFF" ]; then
ARGS="-static"
fi
share/ci/scripts/validate_pkgconfig.sh $INSTALL_DIR website/src/exrwriter/exrwriter.cpp $ARGS
shell: bash
- name: Prepare install_manifest
# Store the cmake command as the first line of the manifest,
# and remove the path prefix, so the manifest contains only
# the local filenames.
run: |
set -x
INSTALL_MANIFEST_PATH="$BUILD_DIR/$INSTALL_MANIFEST_FILENAME"
echo "# SPDX-License-Identifier: BSD-3-Clause" > $INSTALL_MANIFEST_PATH
echo "# Copyright (c) Contributors to the OpenEXR Project." >> $INSTALL_MANIFEST_PATH
echo "# cmake ${{ env.CMAKE_ARGS }}" >> $INSTALL_MANIFEST_PATH
sort $BUILD_DIR/install_manifest.txt | sed -e "s:^.*/_install/::" >> $INSTALL_MANIFEST_PATH
if [[ "$RUNNER_OS" == "Windows" ]]; then
# upload-artifact expects a windows-style path
INSTALL_MANIFEST_PATH=$(cygpath -w $INSTALL_MANIFEST_PATH)
fi
echo INSTALL_MANIFEST_PATH=$INSTALL_MANIFEST_PATH >> $GITHUB_ENV
shell: bash
- name: Upload install_manifest.txt
# Upload the manifest to make it possible to download for inspection and debugging
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ env.INSTALL_MANIFEST_FILENAME }}
path: ${{ env.INSTALL_MANIFEST_PATH }}
- name: Validate install
if: inputs.validate_install == 'ON'
# Validate that the build has installed the proper files by
# comparing against the appropriate reference manifest
run: |
set -x
# Extract "#define VAR VALUE" statements from OpenEXRConfig.h
# and set corresponding env vars, which validate_install.py
# substitutes in the manifest files. This confirms that the
# manifests have the proper version strings in the library filenames.
OpenEXRConfig=$INSTALL_DIR/include/OpenEXR/OpenEXRConfig.h
for var in \
OPENEXR_VERSION_MAJOR \
OPENEXR_VERSION_MINOR \
OPENEXR_VERSION_PATCH \
OPENEXR_SOVERSION \
OPENEXR_IMATH_VERSION_MAJOR \
OPENEXR_IMATH_VERSION_MINOR \
OPENEXR_IMATH_VERSION_PATCH \
OPENEXR_IMATH_SOVERSION \
OPENEXR_OPENJPH_VERSION_MAJOR \
OPENEXR_OPENJPH_VERSION_MINOR \
OPENEXR_OPENJPH_VERSION_PATCH; do
export "$var"=$(grep -E "^#define[[:space:]]+$var" "$OpenEXRConfig" | awk '{print $3}')
done
share/ci/scripts/validate_install.py "$INSTALL_MANIFEST_PATH" "share/ci/install_manifest/$INSTALL_MANIFEST_FILENAME"
shell: bash
- name: Test
if: inputs.BUILD_TESTING == 'ON' && inputs.RUN_TESTING == 'ON' && inputs.msystem == ''
run: |
set -x
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PATH="$OPENEXR_PATH:$PATH"
fi
"$CTEST" -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
shell: bash
- name: Test (msys2) # requires msys2 shell
if: inputs.BUILD_TESTING == 'ON' && inputs.RUN_TESTING == 'ON' && inputs.msystem != ''
run: |
set -x
export PATH="$OPENEXR_PATH:$PATH"
"$CTEST" -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
shell: msys2 {0}
- name: Test website examples
# Build the "hello, world" exrwriter example program from the
# website, both to confirm it builds and as an example of an
# application building against the just-installed openexr
# libary, to validate the cmake configuration for downstream
# applications.
if: inputs.namespace == '' && inputs.msystem == '' && inputs.OPENEXR_BUILD_EXAMPLES != ''
run: |
set -x
EXRWRITER_BUILD_DIR=$WORKSPACE/_build.exrwriter
"$CMAKE" -S website/src/exrwriter -B $EXRWRITER_BUILD_DIR \
-DCMAKE_PREFIX_PATH=$INSTALL_DIR \
-DCMAKE_VERBOSE_MAKEFILE=ON
"$CMAKE" --build $EXRWRITER_BUILD_DIR --config ${{ inputs.build-type }}
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PATH="$OPENEXR_PATH:$PATH"
EXRWRITER=$EXRWRITER_BUILD_DIR/${{ inputs.build-type }}/exrwriter.exe
EXRINFO=$INSTALL_DIR/bin/exrinfo.exe
else
EXRWRITER=$EXRWRITER_BUILD_DIR/exrwriter
EXRINFO=$INSTALL_DIR/bin/exrinfo
fi
"$EXRWRITER"
# Validate that the image is as expected
if [ -x "$EXRINFO" ]; then
expected_output=$(<website/src/exrwriter/stripes.exrinfo.txt)
actual_output=$("$EXRINFO" stripes.exr)
if [[ "$actual_output" != "$expected_output" ]]; then
echo "error: exrwriter produced incorrect results:"
echo $actual_output
exit 1
fi
else
echo "skipping exrinfo, no tool found."
fi
shell: bash
- name: Test add_subdirectory
# Build the "hello, world" exrwriter example program from the
# src/test/add_subdirectory folder, which is the same program as
# above but configured via add_subdirectory(ext/openexr).
# Create ext/openexr as a symlink to the repo root. This
# confirms that downstream applications can use openexr in
# that way.
if: inputs.msystem == ''
run: |
set -x
"$CMAKE" --version
SRC="$RUNNER_TEMP/add_subdirectory"
cp -r "$WORKSPACE/src/test/add_subdirectory" "$SRC"
cp "$WORKSPACE/website/src/exrwriter/exrwriter.cpp" "$SRC"
mkdir -p "$SRC/ext"
ln -s "$WORKSPACE" "$SRC/ext/openexr"
ADD_SUBDIRECTORY_BUILD_DIR=$WORKSPACE/_build.add_subdirectory
cmake_args=("-B" "$ADD_SUBDIRECTORY_BUILD_DIR" -S "$SRC")
cmake_args+=("-DCMAKE_POLICY_VERSION_MINIMUM=3.26")
cmake_args+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
if [ -n "${{ inputs.namespace }}" ]; then
cmake_args+=("-DOPENEXR_IMF_NAMESPACE=${{ inputs.namespace }}")
fi
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_IMATH=${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}")
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}")
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_OPENJPH=${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}")
cmake_args+=("-DOPENEXR_BUILD_EXAMPLES=OFF")
cmake_args+=("-DOPENEXR_BUILD_TOOLS=OFF")
quoted_args=$(printf '%q ' "${cmake_args[@]}")
"$CMAKE" $quoted_args
"$CMAKE" --build $ADD_SUBDIRECTORY_BUILD_DIR --config ${{ inputs.build-type }}
EXRWRITER=$ADD_SUBDIRECTORY_BUILD_DIR/exrwriter
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PATH="$OPENEXR_PATH:$PATH"
EXRWRITER=$ADD_SUBDIRECTORY_BUILD_DIR/${{ inputs.build-type }}/exrwriter.exe
else
EXRWRITER=$ADD_SUBDIRECTORY_BUILD_DIR/exrwriter
fi
$EXRWRITER
shell: bash
+280 -482
View File
@@ -1,552 +1,350 @@
# 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
# The CI workflow uses steps defined in ci_steps.yml, via the "uses:"
# directive. Linux, macOS, and Windows all share a common set of
# configure/build/validate steps.
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.
# Run on all changes except:
# - markdown/doc changes
# - changes to the website, *except* for "website/src", since that
# code needs validation. The website has a separate workflow
# - changes to the bazel config (it has its own workflow
# - changes to the python bindings (they have their own workflow)
# - changes to workflows other than this one
on:
push:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow.yml'
- '.github/workflows/ci_steps.yml'
pull_request:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow.yml'
- '.github/workflows/ci_steps.yml'
permissions:
contents: read
# NOTE: All jobs have a "build" number that appears in the "jobs"
# listing on the GitHub actions page. This build number also
# identifies the reference install manifest in
# share/ci/install_manifest. The validate_install.py script compares
# the job's generated install_manifest.txt to the reference file to
# validate that the proper files have been installed.
#
# If you add jobs, you must add a corresponding
# share/ci/install_manifest file.
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:
name: 'Linux.${{ matrix.build}}: ${{ matrix.label }}'
permissions:
contents: write # required by ci_steps (upload-artifact)
uses: ./.github/workflows/ci_steps.yml
with:
# Set values for the "inputs:" as defined in ci_steps.yml
# Note the defaults provided here for the builds that don't specify
# values.
os: ubuntu-latest
build: ${{ matrix.build }}
# DockerHub: https://hub.docker.com/u/aswf
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
image: aswf/ci-openexr:${{ matrix.vfx-cy }}
container: ${{ matrix.container || format('aswf/ci-openexr:{0}', matrix.vfx-cy || '2024') }}
cmake: ${{ matrix.cmake || '3.14.7' }}
cxx-standard: ${{ matrix.cxx-standard || '17' }}
cxx-compiler: ${{ matrix.cxx-compiler || 'g++' }}
cc-compiler: ${{ matrix.cc-compiler || 'gcc' }}
build-type: ${{ matrix.build-type || 'Release' }}
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
OPENEXR_ENABLE_THREADING: ${{ matrix.OPENEXR_ENABLE_THREADING || 'ON' }}
OPENEXR_INSTALL_PKG_CONFIG: ${{ matrix.OPENEXR_INSTALL_PKG_CONFIG || 'ON' }}
OPENEXR_INSTALL_DOCS: ${{ matrix.OPENEXR_INSTALL_DOCS || 'ON' }}
OPENEXR_BUILD_EXAMPLES: ${{ matrix.OPENEXR_BUILD_EXAMPLES || 'ON' }}
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
RUN_TESTING: ${{ matrix.RUN_TESTING || 'ON' }}
namespace: ${{ matrix.namespace }}
validate_install: ${{ matrix.validate_install || 'ON' }}
configure_install_prefix: ${{ matrix.configure_install_prefix }}
strategy:
fail-fast: false
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:
label: Release
# 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
label: Debug
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: 3
label: static
BUILD_SHARED_LIBS: 'OFF'
- 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:
label: threads=OFF
OPENEXR_ENABLE_THREADING: 'OFF'
# 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:
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal deflate
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
OPENEXR_INSTALL_DOCS: 'OFF'
OPENEXR_BUILD_EXAMPLES: 'OFF'
OPENEXR_BUILD_TOOLS: 'OFF'
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
BUILD_TESTING: 'OFF'
configure_install_prefix: '.tmp'
cmake: 3.15.7
# -------------------------------------------------------------------
# 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:
label: custom namespace
namespace: 'TEST_NAMESPACE'
# -------------------------------------------------------------------
# VFX CY2023 - Clang 14.0
# -------------------------------------------------------------------
# Release
- build: 7
build-type: Release
build-shared: 'ON'
cxx-standard: 17
label: clang
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:
label: vfx2023
vfx-cy: 2023
# -------------------------------------------------------------------
# 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:
label: cmake 4
cmake: 4.0.3
# -------------------------------------------------------------------
# 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:
label: clang c++20
cxx-compiler: clang++
cc-compiler: clang
cxx-standard: 20
RUN_TESTING: OFF
validate_install: OFF
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
- build: 11
label: gcc c++20
cxx-standard: 20
RUN_TESTING: OFF
validate_install: OFF
- build: 12
label: Fedora Rawhide
container: fedora:rawhide
cmake: '3.31.6'
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
OPENEXR_FORCE_INTERNAL_DEFLATE: 'OFF'
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
OPENEXR_INSTALL_DOCS: 'OFF'
validate_install: 'OFF'
- build: 13
label: STATIC w/vendored OpenJPH
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
BUILD_SHARED_LIBS: 'OFF'
RUN_TESTING: OFF
macOS:
name: 'macOS.${{ matrix.build}}: ${{ matrix.label }}'
permissions:
contents: write # required by ci_steps (upload-artifact)
uses: ./.github/workflows/ci_steps.yml
with:
# Set values for the "inputs:" as defined in ci_steps.yml
# Note the defaults provided here for the builds that don't specify
# values.
os: ${{ matrix.os || 'macos-15' }}
build: ${{ matrix.build }}
cc-compiler: ${{ matrix.cc-compiler || 'clang' }}
cxx-compiler: ${{ matrix.cxx-compiler || 'clang++' }}
cxx-standard: ${{ matrix.cxx-standard || '17' }}
build-type: ${{ matrix.build-type || 'Release' }}
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
OPENEXR_ENABLE_THREADING: ${{ matrix.OPENEXR_ENABLE_THREADING || 'ON' }}
OPENEXR_INSTALL_PKG_CONFIG: ${{ matrix.OPENEXR_INSTALL_PKG_CONFIG || 'ON' }}
OPENEXR_INSTALL_DOCS: ${{ matrix.OPENEXR_INSTALL_DOCS || 'ON' }}
OPENEXR_BUILD_EXAMPLES: ${{ matrix.OPENEXR_BUILD_EXAMPLES || 'ON' }}
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
CMAKE_OSX_ARCHITECTURES: ${{ matrix.CMAKE_OSX_ARCHITECTURES }}
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
RUN_TESTING: ${{ matrix.RUN_TESTING || 'ON' }}
validate_install: ${{ matrix.validate_install || 'ON' }}
configure_install_prefix: ${{ matrix.configure_install_prefix }}
# ---------------------------------------------------------------------------
# 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:
fail-fast: false
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
label: Release
# 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
label: Debug
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
label: static
BUILD_SHARED_LIBS: 'OFF'
# -------------------------------------------------------------------
# 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
label: threads=OFF
OPENEXR_ENABLE_THREADING: 'OFF'
# 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
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal imath+deflate
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
OPENEXR_INSTALL_DOCS: 'OFF'
OPENEXR_BUILD_EXAMPLES: 'OFF'
OPENEXR_BUILD_TOOLS: 'OFF'
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
BUILD_TESTING: 'OFF'
configure_install_prefix: '.tmp'
cmake: 3.15.7
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
- build: 6
label: macos-15-intel
os: macos-15-intel
- build: 7
label: macos-14
os: macos-14
- build: 8
label: universal2
CMAKE_OSX_ARCHITECTURES: "x86_64;arm64"
- build: 9
label: clang c++20
cxx-standard: 20
RUN_TESTING: OFF
validate_install: OFF
- build: 10
label: gcc c++20
cc-compiler: gcc
cxx-compiler: g++
cxx-standard: 20
RUN_TESTING: OFF
validate_install: OFF
windows:
name: 'Windows.${{ matrix.build}}: ${{ matrix.label }}'
permissions:
contents: write # required by ci_steps (upload-artifact)
uses: ./.github/workflows/ci_steps.yml
with:
# Set values for the "inputs:" as defined in ci_steps.yml
# Note the defaults provided here for the builds that don't specify
# values.
os: ${{ matrix.os || 'windows-2022' }}
build: ${{ matrix.build }}
cxx-standard: ${{ matrix.cxx-standard || '17' }}
build-type: ${{ matrix.build-type || 'Release' }}
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
OPENEXR_ENABLE_THREADING: ${{ matrix.OPENEXR_ENABLE_THREADING || 'ON' }}
OPENEXR_INSTALL_PKG_CONFIG: ${{ matrix.OPENEXR_INSTALL_PKG_CONFIG || 'ON' }}
OPENEXR_INSTALL_DOCS: ${{ matrix.OPENEXR_INSTALL_DOCS || 'OFF' }}
OPENEXR_BUILD_EXAMPLES: ${{ matrix.OPENEXR_BUILD_EXAMPLES || 'ON' }}
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
msystem: ${{ matrix.msystem }}
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
RUN_TESTING: ${{ matrix.RUN_TESTING || 'ON' }}
validate_install: ${{ matrix.validate_install || 'ON' }}
configure_install_prefix: ${{ matrix.configure_install_prefix }}
strategy:
fail-fast: false
matrix:
include:
- build: 1
label: Release
- build: 2
label: Debug
build-type: Debug
- build: 3
label: static
BUILD_SHARED_LIBS: 'OFF'
- build: 4
label: threads=OFF
# TODO: this currently fails to compile; switch to OFF once the fix is in.
OPENEXR_ENABLE_THREADING: 'ON'
- build: 5
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal imath+deflate
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
OPENEXR_INSTALL_DOCS: 'OFF'
OPENEXR_BUILD_EXAMPLES: 'OFF'
OPENEXR_BUILD_TOOLS: 'OFF'
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
BUILD_TESTING: 'OFF'
configure_install_prefix: '.tmp'
cmake: 3.15.7
- build: 6
label: vfx2023
os: windows-2022
# Build w/msys2, mingw32 and ucrt64, shared and static.
- build: 7
label: msys2-mingw32
msystem: MINGW32
- build: 8
label: msys2-mingw32, static
msystem: MINGW32
BUILD_SHARED_LIBS: 'OFF'
- build: 9
label: msys2-ucrt64
msystem: UCRT64
- build: 10
label: msys2-ucrt64, static
msystem: UCRT64
BUILD_SHARED_LIBS: 'OFF'
- build: 11
label: c++20
cxx-standard: 20
RUN_TESTING: OFF
validate_install: OFF
+108
View File
@@ -0,0 +1,108 @@
# 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-old
# Build for VFX reference platform prior to 2023, which requires a
# workaround to run an old version of glibc required by the ASWF Docker
# images.
#
# This doesn't easily integrate with the existing CI workflow, and it
# can be depreciated entirely once we've moved beyond support for the
# old CentOS-based VFX reference platform years.
#
# See this discussion for details:
# https://academysoftwarefdn.slack.com/archives/C0169RX7MMK/p1732574400981949
# Run on all changes except:
# - doc file changes
# - changes to the website, *except* for "website/src", since that
# code needs validation. The website has a separate workflow
# - changes to the bazel config, since it has its own workflow
# - changes to the python bindings
# - changes to workflows other than this one
on:
push:
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!share/ci/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow_old.yml'
pull_request:
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!share/ci/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow_old.yml'
permissions:
contents: read
jobs:
linux:
name: 'Linux vfx${{ matrix.vfx-cy }}'
runs-on: ubuntu-latest
container:
image: aswf/ci-openexr:${{ matrix.vfx-cy }}
volumes:
- /node20217:/node20217:rw,rshared
- /node20217:/__e/node20:ro,rshared
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
strategy:
matrix:
include:
- build: 2022
vfx-cy: 2022
- build: 2021
vfx-cy: 2021
steps:
- name: install nodejs20glibc2.17
run: |
curl --silent https://unofficial-builds.nodejs.org/download/release/v20.18.1/node-v20.18.1-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217 -f -
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Create build directories
run: |
mkdir _install
mkdir _build
- name: Configure
run: |
cmake -B _build -S . \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='ON'
- name: Build
run: |
cmake --build _build \
--target install \
--config Release
- name: Test
run: |
ctest -T Test \
-C Release \
--timeout 7200 \
--output-on-failure \
-VV
working-directory: _build
+109
View File
@@ -0,0 +1,109 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "main", "**/**" ]
pull_request:
branches: [ "main", "**/**" ]
schedule:
- cron: '37 10 * * 0'
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: autobuild
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
# cary: Pin the version to the SHA for 2.18.0, since there appears to
# be a problem with 2.18.1 leading to a "No space left on
# device" failure
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
# cary: the "linked" setting is necessary to force the run to pick up
# the version specified in the action.
tools: linked
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
# Pin the version to the SHA for 2.18.0
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
category: "/language:${{matrix.language}}"
# For pull_request, upload against refs/pull/<n>/head + head SHA so the Code
# Scanning API does not require refs/heads/<branch> (e.g. Dependabot branches
# can trigger "ref ... not found"). Ignored for fork PRs by the action.
ref: ${{ github.event_name == 'pull_request' && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+9 -13
View File
@@ -8,27 +8,23 @@ name: OSS-Fuzz
on:
push:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ossfuzz_workflow.yml'
pull_request:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ossfuzz_workflow.yml'
permissions:
contents: read
@@ -39,20 +35,20 @@ jobs:
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@32f1d4deadc82279ec9001a837f2424e185c69a2 # 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
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@32f1d4deadc82279ec9001a837f2424e185c69a2 # master
with:
oss-fuzz-project-name: 'openexr'
fuzz-seconds: 300
dry-run: false
language: c++
- name: Upload Crash
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
@@ -0,0 +1,144 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
name: Publish python distribution 📦 to TestPyPI
on:
# Publish python wheels to test.pypi when a release candidate is tagged,
# e.g. v3.4.5-rc, v3.4.5-rc6, etc.
push:
tags:
- v3.[0-9]+.[0-9]+-rc*
workflow_dispatch:
concurrency:
group: testpypi-publish-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
guard:
name: Verify RB-* release ref
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Verify RB-* release ref
env:
EVENT_NAME: ${{ github.event_name }}
REF_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail
if [[ "$EVENT_NAME" == "workflow_dispatch" && "$REF_NAME" != RB-* ]]; then
echo "::error::workflow_dispatch must use an RB-* branch (not $REF_NAME)."
exit 1
fi
git fetch origin '+refs/heads/RB-*:refs/remotes/origin/RB-*' || git fetch origin
if ! git branch -r --contains HEAD | grep -E -q 'origin/RB-'; then
echo "::error::Ref must be on an RB-* release branch (not main)."
git branch -r --contains HEAD || true
exit 1
fi
build:
name: Python Wheels - ${{ matrix.os }}-${{ matrix.arch }}
needs: guard
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: ubuntu-24.04-arm
arch: arm64
- os: macos-15-intel
arch: x64
cibw_archs_macos: x86_64 universal2
- os: macos-latest
arch: arm64
cibw_archs_macos: arm64
- os: windows-latest
arch: x64
permissions:
contents: read
actions: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Python
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.x'
- name: Create sdist
# Only create it once.
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
OPENEXR_RELEASE_CANDIDATE_TAG: ${{ github.ref_name }}
run: pipx run build==1.2.2.post1 --sdist . --outdir wheelhouse
- name: Build wheel
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
with:
output-dir: wheelhouse
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
# Split macOS arches across runners so artifact merge does not collide on filenames.
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
# Build Python 3.9 through 3.13.
# Skip 32-bit wheels builds on Windows
# Also skip the PyPy builds, since they fail the unit tests
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
CIBW_SKIP: "*-win32 *_i686"
CIBW_ENVIRONMENT: OPENEXR_RELEASE_CANDIDATE_TAG="${{ github.ref_name }}"
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/openexr
permissions:
contents: read
actions: read
id-token: write
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
repository-url: https://test.pypi.org/legacy/
+135
View File
@@ -0,0 +1,135 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
name: Publish python distribution 📦 to PyPI
on:
# Publish wheels to pypi on release
release:
types: [published]
workflow_dispatch:
concurrency:
group: pypi-publish-${{ github.event.release.tag_name || github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
guard:
name: Verify RB-* release ref
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
- name: Verify RB-* release ref
env:
EVENT_NAME: ${{ github.event_name }}
REF_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail
if [[ "$EVENT_NAME" == "workflow_dispatch" && "$REF_NAME" != RB-* ]]; then
echo "::error::workflow_dispatch must use an RB-* branch (not $REF_NAME)."
exit 1
fi
git fetch origin '+refs/heads/RB-*:refs/remotes/origin/RB-*' || git fetch origin
if ! git branch -r --contains HEAD | grep -E -q 'origin/RB-'; then
echo "::error::Ref must be on an RB-* release branch (not main)."
git branch -r --contains HEAD || true
exit 1
fi
build:
name: Python Wheels - ${{ matrix.os }}-${{ matrix.arch }}
needs: guard
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: ubuntu-24.04-arm
arch: arm64
- os: macos-15-intel
arch: x64
cibw_archs_macos: x86_64 universal2
- os: macos-latest
arch: arm64
cibw_archs_macos: arm64
- os: windows-latest
arch: x64
permissions:
contents: read
actions: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Python
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.x'
- name: Create sdist
# Only create it once.
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pipx run build==1.2.2.post1 --sdist . --outdir wheelhouse
- name: Build wheel
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
with:
output-dir: wheelhouse
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
# Split macOS arches across runners so artifact merge does not collide on filenames.
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
# Build Python 3.9 through 3.13
# Skip 32-bit wheels builds on Windows
# Also skip the PyPy builds, since they fail the unit tests
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
CIBW_SKIP: "*-win32 *_i686"
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/openexr
permissions:
contents: read
actions: read
id-token: write
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
+132 -60
View File
@@ -1,82 +1,154 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
name: Python wheels
name: Python Wheels
on:
# Run on all changes (PR and push) to the python binding
# source/configuration files, except on the release branches, which
# have their own workflow, which also publish to pypi/test.pypi.
# Note that changes to the core libraries will *not*
# trigger building the wheels. However, the main ci workflow does
# build and test the bindings (for a single python version on a
# single arch)
push:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- 'cmake/**'
- 'src/lib/**'
- 'src/wrappers/python/**'
- 'pyproject.toml'
- '!share/ci/**'
- '!.github/workflows/**'
- '.github/workflows/python-wheels.yml'
pull_request:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- 'cmake/**'
- 'src/lib/**'
- 'src/wrappers/python/**'
- 'pyproject.toml'
- '!share/ci/**'
- '!.github/workflows/**'
- '.github/workflows/python-wheels.yml'
permissions:
contents: read
jobs:
build_wheels:
name: Build Python wheels
name: Python Wheels - ${{ matrix.os }}-${{ matrix.arch }}
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/
include:
- os: ubuntu-latest
arch: x64
- os: ubuntu-24.04-arm
arch: arm64
- os: macos-15-intel
arch: x64
cibw_archs_macos: x86_64 universal2
- os: macos-latest
arch: arm64
cibw_archs_macos: arm64
- os: windows-latest
arch: x64
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# Used to host cibuildwheel
- uses: actions/setup-python@v4
- name: Install Python
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.x'
python-version: '3.x'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.8.1
- name: Create sdist
# Only create it once.
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pipx run build==1.2.2.post1 --sdist . --outdir wheelhouse
- 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
- name: Build wheel
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
with:
name: "Python wheels"
path: ./wheelhouse/*.whl
output-dir: wheelhouse
env:
# Split macOS arches across runners so artifact merge does not collide on filenames.
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
# Build Python 3.9 through 3.13
# Skip 32-bit wheels builds on Windows
# Also skip the PyPy builds, since they fail the unit tests
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
CIBW_SKIP: "*-win32 *_i686"
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
verify_publish_artifacts:
name: Verify merged wheel artifacts
needs: build_wheels
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
steps:
- name: Download wheel artifacts separately
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: wheels-*
path: artifacts
- name: Detect duplicate distribution filenames
run: |
set -euo pipefail
mapfile -t dupes < <(
find artifacts -type f \( -name '*.whl' -o -name '*.tar.gz' \) -exec basename {} \; \
| sort \
| uniq -d
)
if ((${#dupes[@]} > 0)); then
echo "::error::Duplicate distribution filenames across build artifacts:"
printf ' %s\n' "${dupes[@]}"
exit 1
fi
- name: Download wheel artifacts (as publish does)
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Verify wheel ZIP integrity
run: |
set -euo pipefail
shopt -s nullglob
wheels=(dist/*.whl)
if ((${#wheels[@]} == 0)); then
echo "::error::No wheels found in dist/"
exit 1
fi
for wheel in "${wheels[@]}"; do
echo "Checking $wheel"
python3 -m zipfile -t "$wheel"
done
- name: Validate distribution metadata
run: pipx run twine==6.1.0 check dist/*
+38
View File
@@ -0,0 +1,38 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
name: Publish Release Notice to ASWF Slack
on:
release:
types:
- published
# published should cover both 'released' and 'prereleased'
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Notify Slack #release-announcements'
id: slack1
with:
project_name: "OpenEXR"
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: "#release-announcements"
project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png"
uses: jmertic/slack-release-notifier@9d7d3a84563d2ebc8f7b2271be6c9568fedd7f3a # main
- name: 'Notify Slack #openexr'
id: slack2
with:
project_name: "OpenEXR"
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: "#openexr"
project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png"
uses: jmertic/slack-release-notifier@9d7d3a84563d2ebc8f7b2271be6c9568fedd7f3a # main
+76
View File
@@ -0,0 +1,76 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
# Releases are signed via https://github.com/sigstore/sigstore-python.
# See https://docs.sigstore.dev for information about sigstore.
#
# This action creates a .tar.gz of the complete OpenEXR source tree at
# the given release tag, signs it via sigstore, and uploads the
# .tar.gz and the associated .tar.gz.sigstore credential bundle.
#
# To verify a downloaded release at a given tag:
#
# % pip install sigstore
# % sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/openexr/.github/workflows/release-sign.yml@refs/tags/<tag> openexr-<tag>.tar.gz
#
# To sign an existing release after publish (e.g. workflow fix): Actions →
# Sign Release → Run workflow → enter the release tag (e.g. v3.2.8).
name: Sign Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Release tag to sign (e.g. v3.2.8)"
required: true
type: string
permissions:
contents: read
jobs:
release:
name: Sign & upload release artifacts
runs-on: ubuntu-latest
env:
TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
permissions:
contents: write # required for gh release upload (attach assets)
id-token: write # required for sigstore OIDC signing
steps:
- name: Set Prefix
# The tag name begins with a 'v', e.g. "v3.2.4", but the prefix
# should omit the 'v', so the tarball "openexr-3.2.4.tar.gz"
# extracts files into "openexr-v3.2.4/...". This matches
# the GitHub release page autogenerated artifact conventions.
run: |
echo OPENEXR_PREFIX=openexr-${TAG//v}/ >> $GITHUB_ENV
echo OPENEXR_TARBALL=openexr-${TAG//v}.tar.gz >> $GITHUB_ENV
shell: bash
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
- name: Create archive
run: git archive --format=tar.gz -o ${OPENEXR_TARBALL} --prefix ${OPENEXR_PREFIX} ${TAG}
- name: Sign archive with Sigstore
uses: sigstore/gh-action-sigstore-python@5b79a39c381910c090341a2c9b0bf022c8b387e1 # v3.4.0
with:
inputs: ${{ env.OPENEXR_TARBALL }}
upload-signing-artifacts: false
release-signing-artifacts: false
- name: Upload release archive
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload ${TAG} ${OPENEXR_TARBALL} ${OPENEXR_TARBALL}.sigstore.json
+59
View File
@@ -0,0 +1,59 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '32 3 * * 1'
push:
branches: [ "main" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
steps:
- name: "Checkout code"
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
publish_results: true
# Upload the results as artifacts (optional)
- name: "Upload artifact"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
sarif_file: results.sarif
+44
View File
@@ -0,0 +1,44 @@
---
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
name: Snyk Scan Code
on:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
schedule:
- cron: "0 4 * * 0"
permissions:
contents: read
jobs:
snyk-scan-pr:
runs-on: ubuntu-latest
if: github.repository == 'AcademySoftwareFoundation/openexr'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: snyk/actions/setup@9adf32b1121593767fc3c057af55b55db032dc04 # v1.0.0
id: snyk
- name: Snyk version
run: echo "${{ steps.snyk.outputs.version }}"
- name: Snyk Auth
run: snyk auth ${{ secrets.SNYK_TOKEN }}
- name: Snyk Scan Code
# Scan the C/C++ code for vulnerabilities using the Snyk CLI with the unmanaged flag
# https://docs.snyk.io/scan-using-snyk/supported-languages-and-frameworks/c-c++ for options
run: snyk test --unmanaged --print-dep-paths --org=${{ secrets.SNYK_ORG }}
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true # optional
- name: Monitor for Vulnerabilities
# To import the test results (issues and dependencies) in the Snyk CLI, run the snyk monitor --unmanaged command:
run: snyk monitor --unmanaged --org=${{ secrets.SNYK_ORG }}
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true # optional
+77
View File
@@ -0,0 +1,77 @@
# 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 or workflow file.
# Skip the release branches, since the website is built from main.
#
# Readthedocs builds the website on ubuntu-20.04, so technically
# that's the only system that requires the website to build properly,
# but developers contributing to the website may work on Windows or
# macOS, so this confirms that it builds properly there, too.
#
# Note that this does not build the OpenEXR libraries, it only runs
# doxygen and sphinx to generate the website html.
#
on:
push:
branches-ignore:
- RB-*
paths:
- 'website/**'
- '.github/workflows/website.yml'
pull_request:
branches-ignore:
- RB-*
paths:
- 'website/**'
- '.github/workflows/website.yml'
permissions:
contents: read
jobs:
Website:
name: "Website"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
# doxygen 1.10 causes sphinx to fail, so pin to 1.9 for now.
DOXYGEN_VERSION: 1.9.1
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Create build directory
run: mkdir _build
- name: Install doxygen
run: ./website/scripts/install_doxygen.sh ${DOXYGEN_VERSION}
shell: bash
- name: Install sphinx requirements
run: |
python3 -m venv _venv
source _venv/*/activate
pip3 install --require-hashes -r ../website/requirements-lock.txt
cmake .. -DBUILD_WEBSITE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DSPHINX_OPTS=""
working-directory: _build
shell: bash
- name: Build
run: |
cmake --build . --target website --config Release
working-directory: _build
shell: bash
-64
View File
@@ -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
+8
View File
@@ -48,12 +48,20 @@ Contrib/DtexToExr/DtexToExr
*.cproject
.DS_Store
abi_check
_build/
build/
build-win/
build-nuget/
*~
.vscode
docs/_test_images/
dist/*
__pycache__/
*.py[cod]
*$py.class
*.swp
# Ignore Bazel generated files
bazel-*
MODULE.bazel.lock
*.vsidx
+163
View File
@@ -0,0 +1,163 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
# This file establishes email equivalences so we can resolve what look like
# multiple authors, but actually are the same author who has used multiple
# emails over the course of their involvement with the project.
#
# The format is any of the following:
# <CANONICAL-EMAIL> <alternate-email>
# CANONICAL-NAME <CANONICAL-EMAIL> <alternate-email>
# CANONICAL-NAME <CANONICAL-EMAIL> alternate-name <alternate-email>
#
# You can check for duplicates with this command:
# git shortlog -sne --all
# That command (and others) will use this file to collapse the duplicates.
#
# If you see any duplicates we don't account for here, or if you look at your
# own entry here and want a different name or email to be your canonical one
# (we may not have guessed correctly and matched your preferences), please
# file a PR with the edits to this file.
Aaron Demolder <aaron.demolder@gmail.com>
Abe Fettig <abe@fettig.net>
Aloys Baillet <aloys.baillet+github@gmail.com> aloysb <aloysb@al.com.au>
Andrew Kunz <akunz@ilm.com>
Anton Dukhovnikov <antond@wetafx.co.nz> Anton Dukhovnikov <131838425+antond-weta@users.noreply.github.com>
Antonio Rojas <arojas@archlinux.org>
Aras Pranckevičius <nearaz@gmail.com> Aras Pranckevičius <aras@nesnausk.org>
Aras Pranckevičius <nearaz@gmail.com> Aras Pranckevičius <aras@unity3d.com>
Arkady Shapkin <arkady.shapkin@gmail.com>
Arkell Rasiah <arkellrasiah@gmail.com> Arkell Rasiah <arasiah@ilm.com>
Arkell Rasiah <arkellrasiah@gmail.com> Arkell Rasiah <arasiah@pixsystem.com>
Axel Waggershauser <awagger@gmail.com>
axxel <awagger@gmail.com>
Balázs Oroszi <ignus2@users.noreply.github.com>
Barnaby Robson <brobson@ilm.com> Barnaby Robson <mail@barnaby.org>
Ben Grimes <72311676+MrGlobby@users.noreply.github.com>
Bernd <waebbl-gentoo@posteo.net>
Brendan Bolles <brendan@fnordware.com>
CAHEK7 <ghosts.in.a.box@gmail.com>
Cary Phillips <cary@ilm.com> cary-ilm <cary@ilm.com>
Cary Phillips <cary@ilm.com> Cary Phillips <cary@rnd-build7-sf-38.lucasfilm.com>
Cary Phillips <cary@ilm.com> seabeepea <seabeepea@gmail.com>
Catherine <catyeo18@users.noreply.github.com>
Chris Leu <cdleu430@gmail.com> cdleu430 <cdleu430@gmail.com>
Christina Tempelaar-Lietz <xlietz@gmail.com> ¨Christina Tempelaar-Lietz¨ <xlietz@gmail.com>
Christina Tempelaar-Lietz <xlietz@gmail.com> xlietz <31363633+xlietz@users.noreply.github.com>
Christopher Horvath <blackencino+git@gmail.com>
Christopher Kulla <fpsunflower@users.noreply.github.com>
Christoph Gohlke <cgohlke@cgohlke.com>
cia-rana <kiwamura0314@gmail.com>
Cristian Martínez <cfuga@cfuga.mx>
Dan Horák <dan@danny.cz>
Daniel Kaneider <danielkaneider@users.sf.net>
Darby Johnston <darbyjohnston@yahoo.com>
Dave Sawyer <kingsawyer@gmail.com>
David Korczynski <david@adalogics.com>
Developer-Ecosystem-Engineering <65677710+Developer-Ecosystem-Engineering@users.noreply.github.com>
dgmzc <dorian.gmz@hotmail.com>
Diogo Teles Sant'Anna <diogoteles@google.com>
Dirk Lemstra <dirk@lemstra.org> dirk <dirk@git.imagemagick.org>
dracwyrm <j.scruggs@gmail.com>
Drew Hess <dhess@ilm.com>
Ed Hanway <ehanway@ilm.com> Ed Hanway <ehanway-ilm@users.noreply.github.com>
Edward Kmett <ekmett@gmail.com>
Eric Sommerlade <es0m@users.noreply.github.com>
Eric Wimmer <ewimmer@ilm.com>
E Sommerlade <es0m@users.noreply.github.com>
fgc <fgc>
Florian Kainz <kainz@ilm.com>
Grant Kim <6302240+enpinion@users.noreply.github.com>
Gregorio Litenstein <g.litenstein@gmail.com>
Gyula Gubacsi <gyula.gubacsi@foundry.com>
Halfdan Ingvarsson <halfdan@sidefx.com>
Harry Mallon <hjmallon@gmail.com>
Huibean Luo <huibean.luo@gmail.com>
ianianda <wyking1030@gmail.com>
Ibraheem Alhashim <ibraheem.alhashim@gmail.com>
Jack Kingsman <jack.kingsman@gmail.com>
Jamie Kenyon <jamie.kenyon@thefoundry.co.uk>
Jan Tojnar <jtojnar@gmail.com>
jbradley <jbradley@dreamworks.com>
Jean-Francois Panisset <32653482+jfpanisset@users.noreply.github.com>
Jens Lindgren <lindgren_jens@hotmail.com>
Ji Hun Yu <jihun@ilm.com>
Johannes Vollmer <32042925+johannesvollmer@users.noreply.github.com>
John Loy <jloy@pixar.com>
John Mertic <jmertic@linuxfoundation.org>
Jonathan Stone <stonej@github.com>
Jose Luis Cercos-Pita <jlcercos@gmail.com> Jose Luis Cercós Pita <lacigarracomunista@gmail.com>
Joseph Goldstone <joseph.goldstone@mac.com> Joseph Goldstone <jgoldstone@arri.com>
Juha Reunanen <juha.reunanen@tomaattinen.com>
Julian Amann <julian.amann@tum.de>
Juri Abramov <openexr@dr-abramov.de> Juri Abramov <gabramov@nvidia.com>
Juri Abramov <openexr@dr-abramov.de> JuriAbramov <openexr@dr-abramov.de>
Karl Hendrikse <karlhendrikse@gmail.com> karlhendrikse <karlhendrikse@gmail.com>
Karl Rasche <karl.rasche@dreamworks.com> Karl Rasche <karlrasche@users.noreply.github.com>
Kevin Wheatley <kevin.wheatley@framestore.com>
Kimball Thurston <kdt3rd@gmail.com>
kwizart <kwizart@gmail.com>
Larry Gritz <lg@larrygritz.com>
Laurens Voerman <l.voerman@rug.nl>
L. E. Segovia <amy@amyspark.me>
Liam Fernandez <liam@utexas.edu>
lilinjie <lilinjie@uniontech.com>
Lucy Wilkes <lucywilkes@users.noreply.github.com>
luzpaz <luzpaz@users.noreply.github.com>
mancoast <RobertPancoast77@gmail.com>
mandree <mandree@users.noreply.github.com>
Mark Reid <mindmark@gmail.com>
Mark Sisson <5761292+marksisson@users.noreply.github.com>
Martin Aumüller <aumuell@reserv.at>
Martin Husemann <martin@NetBSD.org>
Matthäus G. Chajdas <Anteru@users.noreply.github.com>
Matthias C. M. Troffaes <matthias.troffaes@gmail.com>
Matt Pharr <matt@pharr.org>
Md Sadman Chowdhury <61442059+SpicyCatGames@users.noreply.github.com>
Michael Thomas (malinka) <malinka@entropy-development.com>
Nicholas Yue <yue.nicholas@gmail.com>
Nick Porcino <meshula@hotmail.com> meshula <nick.porcino@gmail.com>
Nick Porcino <meshula@hotmail.com> Nick Porcino <nick.porcino@oculus.com>
Nick Porcino <meshula@hotmail.com> Nick Porcino <nporcino@pixar.com>
Nick Porcino <meshula@hotmail.com> nporcino-pixar <78001580+nporcino-pixar@users.noreply.github.com>
Nick Rasmussen <nick@ilm.com> Nick Rasmussen <nick@jive.org>
Nick Rasmussen <nick@ilm.com> Nick Rasmussen <nick.rasmussen@gmail.com>
Nicolas Chauvet <kwizart@gmail.com>
Niklas Hambüchen <mail@nh2.me>
OgreTransporter <OgreTransporter@users.noreply.github.com>
oleksii.vorobiov <oleksii.vorobiov@globallogic.com>
Owen Thompson <oxt3479@rit.edu>
patlefort <northon_patrick3@yahoo.ca>
Paul Schneider <pauls@ilm.com>
Peter Hillman <peterh@wetafx.co.nz> peterhillman <peterh@wetafx.co.nz>
Peter Hillman <peterh@wetafx.co.nz> peterhillman <peter@peterhillman.org.uk>
Peter Steneteg <peter@steneteg.se>
Peter Urbanec <peterurbanec@users.noreply.github.com>
Phyrexian <jarko.paska@gmail.com>
Piotr Stanczyk <piotr.stanczyk@gmail.com> Piotr <pstanczyk@ilm.com>
Piotr Stanczyk <piotr.stanczyk@gmail.com> Piotr Stanczyk <pstanczyk@ilm.com>
Piotr Stanczyk <piotr.stanczyk@gmail.com> pstanczyk <pstanczyk@ilm.com>
Ralph Potter <r.potter@bath.ac.uk>
r-a-sattarov <r.a.sattarov@yandex.ru>
Rémi Achard <remiachard@gmail.com>
Reto Kromer <retokromer@users.noreply.github.com>
Richard Goedeken <Richard@fascinationsoftware.com>
Sergey Fedorov <vital.had@gmail.com>
Shawn Walker-Salas <shawn.walker@oracle.com>
Simon Boorer <sboorer@ilm.com>
Simon Otter <skurmedel@gmail.com>
Srinath Ravichandran <srinath.pop@gmail.com>
Thanh Ha <thanh.ha@linuxfoundation.org>
Thomas Debesse <dev@illwieckz.net>
Thorsten Kaufmann <thorsten.kaufmann@mackevision.de>
Timothy Lyanguzov <theta682@gmail.com>
Transporter <ogre.transporter@gmail.com>
Vertexwahn <julian.amann@tum.de>
Wenzel Jakob <wenzel@inf.ethz.ch>
Wojciech Jarosz <wkjarosz@users.noreply.github.com> wjarosz <wjarosz>
Xo Wang <xow@google.com>
Yaakov Selkowitz <yselkowi@redhat.com>
Yining Karl Li <betajippity@gmail.com>
Yujie Shu <yshu@ilm.com> Yujie Shu (Intern) <yshu@ilm.com>
zengwei2000 <102871671+zengwei2000@users.noreply.github.com>
+2 -8
View File
@@ -11,14 +11,8 @@ 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
# urllib3>=2.7 (website/requirements.txt) requires Python >=3.10
python: "3.11"
sphinx:
configuration: website/conf.py
+55 -20
View File
@@ -2,6 +2,9 @@
# Copyright (c) Contributors to the OpenEXR Project.
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("@rules_cc//cc:defs.bzl", "cc_library")
config_setting(
name = "windows",
@@ -12,7 +15,7 @@ expand_template(
name = "IexConfig",
out = "src/lib/Iex/IexConfig.h",
substitutions = {
"@IEX_INTERNAL_NAMESPACE@": "Iex_3_2",
"@IEX_INTERNAL_NAMESPACE@": "Iex_3_4",
"@IEX_NAMESPACE_CUSTOM@": "0",
"@IEX_NAMESPACE@": "Iex",
},
@@ -34,11 +37,12 @@ expand_template(
name = "IlmThreadConfig",
out = "src/lib/IlmThread/IlmThreadConfig.h",
substitutions = {
"@ILMTHREAD_INTERNAL_NAMESPACE@": "IlmThread_3_2",
"@ILMTHREAD_INTERNAL_NAMESPACE@": "IlmThread_3_4",
"@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",
"#cmakedefine01 ILMTHREAD_USE_TBB": "#define ILMTHREAD_USE_TBB 0",
},
template = "cmake/IlmThreadConfig.h.in",
)
@@ -48,13 +52,17 @@ expand_template(
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_INTERNAL_IMF_NAMESPACE@": "Imf_3_4",
"@OPENEXR_LIB_VERSION@": "3.4.0",
"@OPENEXR_NAMESPACE_CUSTOM@": "3.4.0",
"@OPENEXR_PACKAGE_NAME@": "OpenEXR 3.4.0",
"@OPENEXR_VERSION_EXTRA@": "",
"@OPENEXR_VERSION@": "3.2.0",
"@OPENEXR_VERSION@": "3.4.0",
"@OPENEXR_VERSION_MAJOR@": "3",
"@OPENEXR_VERSION_MINOR@": "4",
"@OPENEXR_VERSION_PATCH@": "0",
"#cmakedefine OPENEXR_ENABLE_API_VISIBILITY": "#define OPENEXR_ENABLE_API_VISIBILITY",
"#cmakedefine OPENEXR_CORE_FUNCTIONS_EMBEDDED": "/* #undef OPENEXR_CORE_FUNCTIONS_EMBEDDED */",
"#cmakedefine OPENEXR_HAVE_LARGE_STACK 1": "/* #undef OPENEXR_HAVE_LARGE_STACK */",
},
template = "cmake/OpenEXRConfig.h.in",
@@ -64,6 +72,7 @@ expand_template(
name = "OpenEXRConfigInternal",
out = "src/lib/OpenEXR/OpenEXRConfigInternal.h",
substitutions = {
"#cmakedefine OPENEXR_USE_INTERNAL_DEFLATE 1": "#define OPENEXR_USE_INTERNAL_DEFLATE 0",
"#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 */",
@@ -105,6 +114,7 @@ cc_library(
"//conditions:default": [],
}),
includes = [
"src/lib",
"src/lib/Iex",
"src/lib/OpenEXR",
"src/lib/OpenEXRCore",
@@ -131,6 +141,7 @@ cc_library(
"src/lib/IlmThread/IlmThreadMutex.h",
"src/lib/IlmThread/IlmThreadNamespace.h",
"src/lib/IlmThread/IlmThreadPool.h",
"src/lib/IlmThread/IlmThreadProcessGroup.h",
"src/lib/IlmThread/IlmThreadSemaphore.h",
],
features = select({
@@ -138,6 +149,7 @@ cc_library(
"//conditions:default": [],
}),
includes = [
"src/lib",
"src/lib/IlmThread",
"src/lib/OpenEXRCore",
],
@@ -150,10 +162,10 @@ cc_library(
"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/bytes.c",
"src/lib/OpenEXRCore/channel_list.c",
"src/lib/OpenEXRCore/chunk.c",
"src/lib/OpenEXRCore/coding.c",
@@ -166,6 +178,8 @@ cc_library(
"src/lib/OpenEXRCore/internal_attr.h",
"src/lib/OpenEXRCore/internal_b44.c",
"src/lib/OpenEXRCore/internal_b44_table.c",
"src/lib/OpenEXRCore/internal_b44_table_init.c",
"src/lib/OpenEXRCore/internal_bytes.h",
"src/lib/OpenEXRCore/internal_channel_list.h",
"src/lib/OpenEXRCore/internal_coding.h",
"src/lib/OpenEXRCore/internal_compress.h",
@@ -180,8 +194,13 @@ cc_library(
"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_dwa_table.c",
"src/lib/OpenEXRCore/internal_dwa_table_init.c",
"src/lib/OpenEXRCore/internal_file.h",
"src/lib/OpenEXRCore/internal_float_vector.h",
"src/lib/OpenEXRCore/internal_ht.cpp",
"src/lib/OpenEXRCore/internal_ht_common.cpp",
"src/lib/OpenEXRCore/internal_ht_common.h",
"src/lib/OpenEXRCore/internal_huf.c",
"src/lib/OpenEXRCore/internal_huf.h",
"src/lib/OpenEXRCore/internal_memory.h",
@@ -195,6 +214,7 @@ cc_library(
"src/lib/OpenEXRCore/internal_string_vector.h",
"src/lib/OpenEXRCore/internal_structs.c",
"src/lib/OpenEXRCore/internal_structs.h",
"src/lib/OpenEXRCore/internal_thread.h",
"src/lib/OpenEXRCore/internal_util.h",
"src/lib/OpenEXRCore/internal_win32_file_impl.h",
"src/lib/OpenEXRCore/internal_xdr.h",
@@ -254,8 +274,9 @@ cc_library(
}),
visibility = ["//visibility:public"],
deps = [
"@Imath",
"@imath",
"@libdeflate//:deflate",
"@openjph",
],
)
@@ -266,14 +287,18 @@ cc_library(
"src/lib/OpenEXR/ImfAttribute.cpp",
"src/lib/OpenEXR/ImfB44Compressor.cpp",
"src/lib/OpenEXR/ImfBoxAttribute.cpp",
"src/lib/OpenEXR/ImfBytesAttribute.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/ImfCompression.cpp",
"src/lib/OpenEXR/ImfCompressionAttribute.cpp",
"src/lib/OpenEXR/ImfCompressor.cpp",
"src/lib/OpenEXR/ImfContext.cpp",
"src/lib/OpenEXR/ImfContextInit.cpp",
"src/lib/OpenEXR/ImfConvert.cpp",
"src/lib/OpenEXR/ImfDeepCompositing.cpp",
"src/lib/OpenEXR/ImfDeepFrameBuffer.cpp",
@@ -297,6 +322,7 @@ cc_library(
"src/lib/OpenEXR/ImfFramesPerSecond.cpp",
"src/lib/OpenEXR/ImfGenericInputFile.cpp",
"src/lib/OpenEXR/ImfGenericOutputFile.cpp",
"src/lib/OpenEXR/ImfHTCompressor.cpp",
"src/lib/OpenEXR/ImfHeader.cpp",
"src/lib/OpenEXR/ImfHuf.cpp",
"src/lib/OpenEXR/ImfIDManifest.cpp",
@@ -353,8 +379,6 @@ cc_library(
"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",
@@ -366,6 +390,7 @@ cc_library(
"src/lib/OpenEXR/ImfAutoArray.h",
"src/lib/OpenEXR/ImfB44Compressor.h",
"src/lib/OpenEXR/ImfBoxAttribute.h",
"src/lib/OpenEXR/ImfBytesAttribute.h",
"src/lib/OpenEXR/ImfCRgbaFile.h",
"src/lib/OpenEXR/ImfChannelList.h",
"src/lib/OpenEXR/ImfChannelListAttribute.h",
@@ -376,6 +401,8 @@ cc_library(
"src/lib/OpenEXR/ImfCompression.h",
"src/lib/OpenEXR/ImfCompressionAttribute.h",
"src/lib/OpenEXR/ImfCompressor.h",
"src/lib/OpenEXR/ImfContext.h",
"src/lib/OpenEXR/ImfContextInit.h",
"src/lib/OpenEXR/ImfConvert.h",
"src/lib/OpenEXR/ImfDeepCompositing.h",
"src/lib/OpenEXR/ImfDeepFrameBuffer.h",
@@ -391,7 +418,6 @@ cc_library(
"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",
@@ -403,6 +429,7 @@ cc_library(
"src/lib/OpenEXR/ImfFramesPerSecond.h",
"src/lib/OpenEXR/ImfGenericInputFile.h",
"src/lib/OpenEXR/ImfGenericOutputFile.h",
"src/lib/OpenEXR/ImfHTCompressor.h",
"src/lib/OpenEXR/ImfHeader.h",
"src/lib/OpenEXR/ImfHuf.h",
"src/lib/OpenEXR/ImfIDManifest.h",
@@ -475,17 +502,14 @@ cc_library(
"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"],
includes = [
"src/lib",
"src/lib/OpenEXR",
],
linkopts =
select({
":windows": [],
@@ -497,7 +521,8 @@ cc_library(
deps = [
":IlmThread",
":OpenEXRCore",
"@Imath",
"@imath",
"@openjph",
],
)
@@ -505,8 +530,12 @@ cc_test(
name = "IexTest",
srcs = [
"src/test/IexTest/main.cpp",
"src/test/IexTest/mathFuncs.cpp",
"src/test/IexTest/mathFuncs.h",
"src/test/IexTest/testBaseExc.cpp",
"src/test/IexTest/testBaseExc.h",
"src/test/IexTest/testMathExc.cpp",
"src/test/IexTest/testMathExc.h",
],
includes = ["src/test/IexTest"],
tags = ["manual"], # This test is not build and executed in the CI
@@ -557,3 +586,9 @@ cc_binary(
":OpenEXR",
],
)
alias(
name = "openexr",
actual = ":OpenEXR",
visibility = ["//visibility:public"],
)
+2606 -422
View File
File diff suppressed because it is too large Load Diff
+31 -22
View File
@@ -2,7 +2,7 @@
# Copyright (c) Contributors to the OpenEXR Project.
# We require this to get object library link library support
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
if(POLICY CMP0074)
# enable find_package(<Package>) to use <Package>_ROOT as a hint
@@ -21,13 +21,13 @@ endif()
file(READ "src/lib/OpenEXRCore/openexr_version.h" VERSION_H)
string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${VERSION_H})
set(VER_MAJ ${CMAKE_MATCH_1})
set(OPENEXR_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${VERSION_H})
set(VER_MIN ${CMAKE_MATCH_1})
set(OPENEXR_VERSION_MINOR ${CMAKE_MATCH_1})
string(REGEX MATCH "VERSION_PATCH ([0-9]*)" _ ${VERSION_H})
set(VER_PCH ${CMAKE_MATCH_1})
set(OPENEXR_VERSION_PATCH ${CMAKE_MATCH_1})
project(OpenEXR VERSION ${VER_MAJ}.${VER_MIN}.${VER_PCH} LANGUAGES C CXX)
project(OpenEXR VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} LANGUAGES C CXX)
set(OPENEXR_VERSION_RELEASE_TYPE "-dev" CACHE STRING "Extra version tag string for OpenEXR build, such as -dev, -beta1, etc.")
@@ -43,13 +43,19 @@ set(OPENEXR_VERSION_API "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}")
# 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_SOVERSION 99)
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")
if(OPENEXR_INSTALL OR OPENEXR_INSTALL_TOOLS OR OPENEXR_INSTALL_DEVELOPER_TOOLS)
# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
endif()
include(cmake/LibraryDefine.cmake)
@@ -73,18 +79,22 @@ if(BUILD_TESTING AND NOT OPENEXR_IS_SUBPROJECT)
endif()
# Include these two modules without enable/disable options
add_subdirectory(src/lib)
add_subdirectory(src/bin)
if (OPENEXR_BUILD_LIBS)
add_subdirectory(src/lib)
endif()
# Tell CMake where to find the OpenEXRConfig.cmake file. Makes it possible to call
if(OPENEXR_BUILD_TOOLS AND OPENEXR_BUILD_LIBS)
add_subdirectory(src/bin)
endif()
# 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.
# 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)
if(OPENEXR_BUILD_EXAMPLES AND OPENEXR_BUILD_LIBS)
add_subdirectory( src/examples )
endif()
@@ -92,7 +102,7 @@ endif()
# 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
#
@@ -103,7 +113,7 @@ endif()
# 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...
@@ -112,7 +122,7 @@ endif()
#set(CTEST_DROP_SITE_CDASH TRUE)
include(CTest)
if(BUILD_TESTING AND NOT OPENEXR_IS_SUBPROJECT)
if(BUILD_TESTING AND OPENEXR_BUILD_LIBS AND NOT OPENEXR_IS_SUBPROJECT)
add_subdirectory(src/test)
endif()
@@ -132,12 +142,11 @@ if (BUILD_WEBSITE AND NOT OPENEXR_IS_SUBPROJECT)
add_subdirectory(website)
endif()
if (NOT OPENEXR_IS_SUBPROJECT)
if (OPENEXR_BUILD_LIBS AND 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)
if (OPENEXR_BUILD_PYTHON AND OPENEXR_BUILD_LIBS AND NOT OPENEXR_IS_SUBPROJECT)
add_subdirectory(src/wrappers/python)
endif()
+50
View File
@@ -0,0 +1,50 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 15,
"patch": 0
},
"configurePresets": [
{
"name": "oss_fuzz",
"cacheVariables": {
"CMAKE_VERBOSE_MAKEFILE": "ON",
"BUILD_SHARED_LIBS": "OFF",
"OPENEXR_FORCE_INTERNAL_IMATH": "ON",
"OPENEXR_FORCE_INTERNAL_DEFLATE": "ON",
"OPENEXR_FORCE_INTERNAL_OPENJPH": "ON",
"OPENEXR_BUILD_TOOLS": "OFF",
"OPENEXR_BUILD_EXAMPLES": "OFF",
"OPENEXR_BUILD_DOCS": "OFF",
"OPENEXR_BUILD_OSS_FUZZ": "ON"
}
},
{
"name": "release",
"displayName": "Release (Unix Makefiles)",
"description": "Release build with Unix Makefiles",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/_build/release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"OPENEXR_BUILD_TOOLS": "ON",
"OPENEXR_BUILD_EXAMPLES": "ON",
"OPENEXR_BUILD_PYTHON": "ON"
}
},
{
"name": "debug",
"displayName": "Debug (Unix Makefiles)",
"description": "Debug build with Unix Makefiles",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/_build/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"OPENEXR_BUILD_TOOLS": "ON",
"OPENEXR_BUILD_EXAMPLES": "ON",
"OPENEXR_BUILD_PYTHON": "ON"
}
}
]
}
+280 -255
View File
@@ -11,8 +11,9 @@ explains our contribution process and procedures:
* [Development Workflow](#Development-Workflow)
* [Coding Style](#Coding-Style)
* [Versioning Policy](#Versioning-Policy)
* [Contributing to the Website](#Contributing-to-the-Website)
* [Creating a Patch Release](#Creating-a-Patch-Release)
* [Creating a Major/Minor Release](#Creating-a-Major/Minor-Release)
* [Creating a Major/Minor Release](#creating-a-majorminor-release)
For a description of the roles and responsibilities of the various
members of the OpenEXR community, see [GOVERNANCE](GOVERNANCE.md), and
@@ -38,7 +39,7 @@ There are two primary ways to connect with the OpenEXR project:
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
[openexr-dev](http://lists.aswf.io/g/openexr-dev) mailing list. This is
the place for question such has "How do I...".
### How to Report a Bug
@@ -80,7 +81,7 @@ To contribute code to the project, first read over the [GOVERNANCE](GOVERNANCE.m
* An understanding of the project's development workflow.
* Legal authorization, that is, you need to have signed a contributor
* Legal authorization, that is, you need to have signed a Contributor
License Agreement. See below for details.
## Legal Requirements
@@ -101,19 +102,23 @@ 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)
[EasyCLA](https://docs.linuxfoundation.org/lfx/easycla)
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 a contributor opens a pull request without having a CLA on file, the
contributor will be guided through the process to have the appropriate
CLA signed. Look in the PR comments for the "linux-foundation-easycla"
check that would fail, and a red "NOT COVERED" button will appear in the PR
comments; click the link in the comment to sign the CLA. For organizations,
you can alternatively go to [this
link](https://organization.lfx.linuxfoundation.org/foundation/a09410000182dD2AAI/project/a092M00001If9ujQAB/cla)
prior to submitting a pull request, which will guide you through the
process to have a CLA signed on behalf of the organization.
* 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**.
contribute, you can sign the CLA as an **Individual Contributor**. If you
are unsure, please contact your employer for clarity.
* 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
@@ -127,9 +132,11 @@ 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
The OpenEXR CLAs are the standard forms used by the Linux Foundation
projects and [recommended by the ASWF
TAC](https://github.com/AcademySoftwareFoundation/tac/blob/main/process/contributing.md#contributor-license-agreement-cla).
TAC](https://github.com/AcademySoftwareFoundation/tac/blob/main/process/contributing.md#contributor-license-agreement-cla).
Note that if you have signed a CLA for a different ASWF or LF project, that
CLA doesn't apply here and you need to sign for this project specifically.
### Commit Sign-Off
@@ -191,7 +198,7 @@ remains linear, avoiding the "bubbles" characteristic of the
[GitFlow](https://www.endoflineblog.com/gitflow-considered-harmful)
workflow.
### Use the Fork, Luke.
### 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
@@ -211,9 +218,9 @@ openexr-dev@lists.aswf.io mail list.
### Pull Requests
Contributions should be submitted as Github pull requests. See
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.
if you're unfamiliar with this concept.
The development cycle for a code change should follow this protocol:
@@ -227,14 +234,14 @@ with a separate pull request.
3. Push commits to your fork.
4. Create a Github pull request from your topic branch.
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
outlined in [Required Approvals](#code-review-and-required-approvals)), a committer
other than the PR contributor may merge changes into the ``main``
branch.
@@ -335,7 +342,7 @@ code.
* Function return types go on a separate line:
const float &
const float &
Header::pixelAspectRatio () const
{
...
@@ -451,301 +458,319 @@ 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
* ``patch`` - indicates backwards-compatible bug fixes
## Contributing to the Website
The https://openexr.com website is generated via
[Sphinx](https://www.sphinx-doc.org) with the
[Breathe](https://breathe.readthedocs.io) extension, using the
[sphinx-press-theme](https://pypi.org/project/sphinx-press-theme), and
is hosted by
[readthedocs](https://readthedocs.org/projects/openexr). The website
source is in [restructured
text](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html)
in the ``website`` directory.
To build the website locally from the source ``.rst`` files, set the
CMake option ``BUILD_WEBSITE=ON``. This adds the ``website`` CMake
target. Generation is off by default.
Building the website requires that ``sphinx``, ``breathe``, and
``doxygen`` are installed. It further requires the [sphinx-press-theme]
(https://pypi.org/project/sphinx-press-theme). Complete dependencies
are described in the [requirements.txt](website/requirements.txt)
file.
On Debian/Ubuntu Linux:
.. code-block::
% apt-get install doxygen python3-sphinx
% pip3 install breathe
% pip3 install sphinx_press_theme
% mkdir _build
% cd _build
% cmake .. -DBUILD_WEBSITE=ON
% cmake --build . --target website
### Testing a Website Build
When you have configured cmake with ``BUILD_WEBSITE=ON`` and done a
build, you should find a file ``website/sphinx/index.html`` in the
build directory which is the website source. Load this file in a
browser to preview the resulting website, that is, load
``file://<build-directory>/website/sphinx/index.html`` into your web
browser.
Once you submit a PR, a check labeled ``docs/readthedocs.org:openexr``
will validate the build. Click on the ``Details`` link to
preview. Also, a link to this preview will be added automatically to
the PR description.
### Test Images
To contribute a new test image, commit it to the
[openexr-images](https://github.com/AcademySoftwareFoundation/openexr-images)
repo, along with an associated ``.jpg`` file for display on the
website.
The [website/scripts/test_images.py](website/scripts/test_images.py)
utility processes images from
[openexr-images](https://github.com/AcademySoftwareFoundation/openexr-images)
to produce `.rst` files for input to Sphinx. It runs ``exrheader`` on
the ``.exr`` to generate the image description. It also processes
``README`` files in the image repo for additional website content,
useful for describing a collection of images. Once the new image is in
the ``openexr-images`` repo, run ``website/scripts/test_images.py``,
then commit the new/modified ``.rst`` files to git and submit a PR.
## 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.
These instructions are for project administrators who have "push"
access on the GitHub repo.
Making a patch release involves merging changes from the main branch
into the release branch, since all development takes place on the main
branch. The process involves these steps:
1. Cherry-pick commits from main to the RB- release branch
2. Bump the version number
3. Add release notes to CHANGES.md
4. Create a "release candidate" tag and announce it publicly
5. Draft the GitHub release
6. Create a signed release tag
7. Publish the release
8. Add an entry to the website news page
Helper scripts in ``share/util/release/`` automate many of the steps
in the process.
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.
### Labeling PRs for Release
The preferred workflow is:
Commits for the patch release are identified via labels on PRs. Create
a label for the release, beginning with a `v`, as in
``v3.4.11``. Assign this label to all PRs to be included in the
release.
1. Make a PR that merges appropriate changes from the main branch to
the release branch:
If a PR should be merged into more than one release branch, i.e. a fix
goes into v3.4 and v3.3, simply add multiple labels, one per release.
a. In a forked clone, create a branch to hold the patch commits,
e.g. ``v3.1.9-fixes``.
It's good practice to label _every_ PR to identify what
release it goes into, even if it's the next minor/major release. That
helps make sure PRs don't get overlooked.
b. Cherry-pick the appropriate commits from ``main``, resolving any
merge conflicts.
The `share/util/release/log.py` script prints all PRs in the order
they were merged, annotated by their release labels.
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):
### Security Issues
- Generate a list of links to merged pull requests.
When a PR addresses a security vulnerability, mention it in the
description or comments:
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.
Addresses CVE-2026-39886
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.
The release scripts will detect this and add an appropriate entry to the
release notes.
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.
When a PR addresses an OSS-Fuzz issue, mention it by url in the
description or comments:
- Generate a list of OSS-Fuzz issues addressed.
Addresses https://issues.oss-fuzz.com/issues/456158449
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.
The release scripts will detect this and add an appropriate entry to the
release notes.
- If there are any public CVE's, mention them explicitly with a
link to the CVE registry item.
### GPG
The signed git tags associated with the release require a [GPG
key](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key)
that is
[registered](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key)
with your GitHub account and git config.
## Release Workflow
Once all PRs have appropriate release labels, follow these steps, all
while on the appropriate `RB-` branch:
1. Cherry-pick commits from the main branch to the release branch.
This prints the SHAs for the commits associated with the
labeled PRs. The output will look something like:
- Provide an executive summary of the patch changes, in a few
sentences as well as bullet points if appropriate.
% python share/util/release/cherry.py v3.4.8
git cherry-pick 2e32c6b 3df0122 6155271
changes.py v3.4.8 2311 2294 2315
Copy/paste the `git cherry-pick` command to the shell.
- 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.
If there are conflicts, resolve them and continue.
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.
If the conflicts are too messy to resolve, consider
cherry-picking the commits one at a time. The `cherry.py`
script accepts a `--single` option that prints the commits one
`git cherry-pick` command per line:
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.
% python share/util/release/cherry.py --single v3.4.8
git cherry-pick 2e32c6b # Bump actions/cache from 5.0.3 to 5.0.4 (#2311)
git cherry-pick 3df0122 # Pin pypa/cibuildwheel actions to release sha (#2294)
git cherry-pick 6155271 # Force macos cibuildwheel to use Xcode clang (#2315)
changes.py v3.4.8 2311 2294 2315
2. Bump the OpenEXR version.
Edit the number in `src/lib/OpenEXRCore/openexr_version.h`. Commit
and push the change.
3. Create an entry in the release notes file `CHANGES.md`.
The `changes.py` script takes a list of PRs
and adds entries in the `CHANGES.md` file:
% python share/util/release/changes.py v3.4.8 2311 2294 2315
This adds the `Merged Pull Requests` and the
`Merged Workflow Requests` sections. It also adds a `Security` section
that lists the CVEs and OSS-Fuzz issues addressed.
2. Tag the release with a ``-rc`` "release candidate" tag,
e.g. ``v3.1.9-rc``.
Edit the section by hand to add a summary.
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. Create a `-rc` "release candidate" tag.
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.
Obviously, build locally and confirm nothing broke in the
cherry-picking commits and resolving conflicts.
Push the release branch and confirm the CI succeeds before creating
the release candidate tag.
5. Draft the release on the GitHub
Create the tag with a `-rc` suffix, e.g. `v3.4.12-rc`.
The `tag.py` script create a signed tag using the release notes as
the tag message:
% python share/util/release/tag.py v3.4.12-rc
Adding the release notes as the tag message is good practice.
Push the tags. This triggers the `python-wheels-publish-test`
CI workflow. Confirm it succeeds.
Run the `candidate.py` script to format a
message about the release candidate, formatted in HTML. Pipe the
output to a `.html` file:
% python share/util/release/candidate.py v3.4.12-rc > v3.4.12.html
Load the file in a browers to render the formatting, then
copy/paste the contents into an email to `openexr-dev@lists.aswf.io`
and the `#openexr` Slack channel.
If any problems arise after tagging the candidate, fix them in
subsequent commits and create an
additional tag with a number appended:
% python share/util/release/tag.py v3.4.12-rc2
5. Draft the GitHub release
% python share/util/release/draft.py v3.4.12
Verify the notes look correct on the
[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.
page and edit as appropriate. Save as a "draft". DO NOT PUBLISH THE
RELEASE YET.
Create the release from the latest ``--rc`` tag, and give it a name
that begins with ``v``, i.e. ``v3.1.9``.
6. Create a signed release tag
Assuming you have your PGP key set up, create the release tag at
the same commit as the release candidate:
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.
% python share/util/release/tag.py v3.4.12
7. Publish the release
a. Click the "Publish release" button on the GitHub release draft
Set the GitHub release to correspond to the release tag (the `Tag:
Select tag` option), then click the "Publish release" button on the
GitHub release draft.
b. Send an email to ``openexr-dev@lists.aswf.io`` officially
annoucing the release.
Monitor the GitHub actions on the
`https://github.com/AcademySoftwareFoundation/openexr` repo to
ensure everything builds properly.
8. Update the ``release`` branch, which should always point to the
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.
% git checkout release
% git merge RB-3.1
% git push
- If any changes have gone into [SECURITY.md](SECURITY), cherry-pick
the associated commit as well.
Publishing the release triggers a post on the `#openexr` Slack
channel, but you must manually send an email to
`openexr-dev@lists.aswf.io` officially announcing the release.
- Also include in this PR edits to [``docs/news.rst``](docs/news.rst)
that add an announcment of the release.
8. Add an entry to the website news page.
10. After review/merge of the updates to ``docs/news.rst``, build the
website at https://readthedocs.org/projects/openexr.
% python share/util/release/news.py v3.4.12
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.
This pulls the release notes from `CHANGES.md` and inserts a news
item in `website/news.rst` and `website/latest_news_title.rst`.
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.
Commit this change, and then cherry-pick the commit from the
release branch containing the notes and submit the pair as a
PR. This pulls the release notes for the patch into the main branch.
## 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.
accepted onto ``main`` should be intended for the next minor/major
(not _patch_)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``.
above, but it's simpler because there is no cherry-picking of
commits. The major/minor release is simply a snapshot of ``main``.
To create a new release from the ``main`` branch:
To create a new release from the ``main`` branch, start by creating
the new "release branch", e.g. `RB-3.5` from the tip of `main`. Then
follow the same instructions above as for a patch release.
1. Confirm that the ``OPENEXR_VERSION_MAJOR``,
Assuming all PRs that have _not_ been merged into a patch release are
labeled with the new minor release, e.g. `v3.5`, the helper scripts in
`share/util/release` will automate the various steps in generating the
release notes, drafting the release, and helping with the various
announcements.
In addition to the above:
1. 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.
Commit this change to the `RB-` branch.
2. 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.
are correct on the main branch. 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
3. 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.
+48 -2
View File
@@ -4,20 +4,37 @@
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.
If you know of missing, please email info@openexr.com or submit a PR.
* Aaron Demolder
* Abe Fettig
* Aloys Baillet
* Andre Mazzone
* Andrew Kunz
* Anton Dukhovnikov
* Antonio Rojas
* Aras Pranckevičius
* Arkady Shapkin
* Arkell Rasiah
* Axel Waggershauser
* Balázs Oroszi
* Barnaby Robson
* Ben Grimes
* Brendan Bolles
* Cary Phillips
* Chris Leu
* Christina Tempelaar-Lietz
* Christopher Horvath
* Christopher Kulla
* Christoph Gohlke
* Cristian Martínez
* Dan Horák
* Daniel Kaneider
* Darby Johnston
* Dave Sawyer
* David Korczynski
* Diogo Teles Sant'Anna
* Dirk Lemstra
* Drew Hess
* Ed Hanway
* Edward Kmett
@@ -25,47 +42,76 @@ If you know of missing, please email: info@openexr.com.
* Eric Wimmer
* E Sommerlade
* Florian Kainz
* Grant Kim
* Gregorio Litenstein
* Gyula Gubacsi
* Halfdan Ingvarsson
* Harry Mallon
* Huibean Luo
* Ibraheem Alhashim
* Jack Kingsman
* Jamie Kenyon
* Jan Tojnar
* Jean-Francois Panisset
* Jens Lindgren
* Ji Hun Yu
* Johannes Vollmer
* John Loy
* John Mertic
* Jonathan Stone
* Jose Luis Cercos-Pita
* Joseph Goldstone
* Juha Reunanen
* Julian Amann
* Juri Abramov
* Karl Hendrikse
* Karl Rasche
* Kevin Wheatley
* Kimball Thurston
* Larry Gritz
* Laurens Voerman
* L. E. Segovia
* Liam Fernandez
* Lucy Wilkes
* Mark Reid
* Mark Sisson
* Martin Aumüller
* Martin Husemann
* Matthäus G. Chajdas
* Matthias C. M. Troffaes
* Matt Pharr
* Md Sadman Chowdhury
* Michael Thomas
* Moira Shooter
* Nicholas Yue
* Nick Porcino
* Nick Rasmussen
* Nicolas Chauvet
* Niklas Hambüchen
* OgreTransporter
* Owen Thompson
* Paul Schneider
* Peter Hillman
* Peter Steneteg
* Peter Urbanec
* Phil Barrett
* Piotr Stanczyk
* Ralph Potter
* Rémi Achard
* Reto Kromer
* Richard Goedeken
* Sergey Fedorov
* Shawn Walker-Salas
* Simon Boorer
* Simon Otter
* Srinath Ravichandran
* Thanh Ha
* Thomas Debesse
* Thorsten Kaufmann
* Timothy Lyanguzov
* Wenzel Jakob
* Wojciech Jarosz
* Xo Wang
* Yaakov Selkowitz
* Yining Karl Li
* Yujie Shu
+9 -36
View File
@@ -110,10 +110,7 @@ ConvertDtexFile (
PXDU_THROW (
"error (" << dtexOpenError << " opening file: " << i_fileName);
}
else
{
PXDU_THROW ("missing file: " << i_fileName);
}
else { PXDU_THROW ("missing file: " << i_fileName); }
}
// Just handling the first image in the Dtex file for now.
@@ -438,34 +435,13 @@ ParseArguments (
}
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 == "--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)
@@ -493,10 +469,7 @@ ParseArguments (
"Invalid parameter for --sideways: " << argv[argi + 1]);
}
}
else
{
o_params.sideways = true;
}
else { o_params.sideways = true; }
}
else if (arg == "--compressionError")
{
+2 -8
View File
@@ -135,14 +135,8 @@ struct Span
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;
}
else if (in == i_other.in) { return index < i_other.index; }
else { return false; }
}
};
+4 -16
View File
@@ -44,10 +44,7 @@ DensityFromVizDz (double i_viz, double i_dz)
{
double d = -log (i_viz) / i_dz;
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0; }
else
{
return d;
}
else { return d; }
}
}
@@ -77,10 +74,7 @@ DensityTimesDzFromViz (double i_viz)
{
double d = -log (i_viz);
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0 * PXDU_DZ_OF_VIZ_0; }
else
{
return d;
}
else { return d; }
}
}
@@ -115,19 +109,13 @@ DzFromVizDensity (double i_viz, double i_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 { return dz; }
}
else
{
double dz = -log (i_viz) / i_density;
if (!isfinite (dz)) { return PXDU_MAX_DZ; }
else
{
return dz;
}
else { return dz; }
}
}
+1 -4
View File
@@ -287,10 +287,7 @@ inline T
ZeroNAN (T i_f)
{
if (!isfinite (i_f)) { return (T) 0; }
else
{
return i_f;
}
else { return i_f; }
}
//-*****************************************************************************
+1 -1
View File
@@ -113,7 +113,7 @@ represents the project at ASWF TAC meetings.
* Kimball Thurston - Weta Digital, Ltd.
* Nick Porcino - Pixar Animation Studios
* Christina Tempelaar-Lietz - Industrial Light & Magic
* Joseph Goldstone - ARRI
* Joseph Goldstone - Lilliputian Pictures LLC
* John Mertic - The Linux Foundation
### TSC Meetings
-3
View File
@@ -1,6 +1,3 @@
<!-- 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:
+14
View File
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenEXR Project.
module(
name = "openexr",
compatibility_level = 1,
)
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "imath", version = "3.2.2.bcr.1")
bazel_dep(name = "libdeflate", version = "1.25")
bazel_dep(name = "openjph", version = "0.27.3.bcr.1")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_cc", version = "0.2.22")
+48 -23
View File
@@ -3,6 +3,7 @@
[![License](https://img.shields.io/github/license/AcademySoftwareFoundation/openexr)](LICENSE.md)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2799/badge)](https://bestpractices.coreinfrastructure.org/projects/2799)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/AcademySoftwareFoundation/openexr/badge)](https://securityscorecards.dev/viewer/?uri=github.com/AcademySoftwareFoundation/openexr)
[![Build Status](https://github.com/AcademySoftwareFoundation/openexr/workflows/CI/badge.svg)](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3ACI)
[![Analysis Status](https://github.com/AcademySoftwareFoundation/openexr/workflows/Analysis/badge.svg)](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3AAnalysis)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=AcademySoftwareFoundation_openexr&metric=alert_status)](https://sonarcloud.io/dashboard?id=AcademySoftwareFoundation_openexr)
@@ -52,54 +53,70 @@ package.
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)
policies](GOVERNANCE.md), [contribution guidelines](CONTRIBUTING.md), and [code of conduct](CODE_OF_CONDUCT.md)
for more information.
# Building OpenEXR
See the [Install instructions](https://openexr.com/en/latest/install.html) for instructions on how to build
OpenEXR and its required prerequisites.
# Quick Start
See the [technical documentation](https://openexr.readthedocs.io) for
complete details, but to get started, the "hello, world" `.exr` writer program is:
complete details, but to get started, the "Hello, world" [`exrwriter.cpp`](https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr/main/website/src/exrwriter/exrwriter.cpp) writer program is:
#include <ImfRgbaFile.h>
#include <ImfArray.h>
#include <iostream>
using namespace OPENEXR_IMF_NAMESPACE;
int
main()
{
int width = 100;
int height = 50;
Array2D<Rgba> pixels(height, width);
for (int y=0; y<height; y++)
{
float c = (y / 5 % 2 == 0) ? (y / (float) height) : 0.0;
for (int x=0; x<width; x++)
pixels[y][x] = Rgba(c, c, c);
}
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);
RgbaOutputFile file ("stripes.exr", width, height, 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;
std::cerr << "error writing image file stripes.exr:" << e.what() << std::endl;
return 1;
}
return 0;
}
The `CMakeLists.txt` to build:
This creates an image 100 pixels wide and 50 pixels high with
horizontal stripes 5 pixels high of graduated intensity, bright on the
bottom of the image and dark towards the top. Note that ``pixel[0][0]``
is in the upper left:
cmake_minimum_required(VERSION 3.10)
![stripes](website/images/stripes.png)
The [`CMakeLists.txt`](https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr/main/website/src/exrwriter/CMakeLists.txt) to build:
cmake_minimum_required(VERSION 3.12)
project(exrwriter)
find_package(OpenEXR REQUIRED)
add_executable(${PROJECT_NAME} writer.cpp)
add_executable(${PROJECT_NAME} exrwriter.cpp)
target_link_libraries(${PROJECT_NAME} OpenEXR::OpenEXR)
To build:
$ mkdir _build
$ cmake -S . -B _build
$ make --build _build
$ cmake -S . -B _build -DCMAKE_PREFIX_PATH=<path to OpenEXR libraries/includes>
$ cmake --build _build
For more details, see [The OpenEXR
API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
@@ -117,7 +134,9 @@ API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
- 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
- Calendar: https://zoom-lfx.platform.linuxfoundation.org/meetings/openexr
- Meeting Notes: https://wiki.aswf.io/display/OEXR/TSC+Meetings
* **Report a bug:**
@@ -125,7 +144,10 @@ API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
* **Report a security vulnerability:**
- Email to security@openexr.com
- File a GitHub [security
advisory](https://github.com/AcademySoftwareFoundation/openexr/security/advisories/new).
Email security@openexr.com for private/secure discussion with the project
maintainers.
* **Contribute a Fix, Feature, or Improvement:**
@@ -133,9 +155,12 @@ API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
- 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
- If you'd like to contribute and could use some ideas of what to
do, browse "good first issues" [here](https://github.com/AcademySoftwareFoundation/openexr/contribute) or on [Clotributor](https://clotributor.dev/search?ts_query_web=openexr&page=1).
# Resources
- Website: http://www.openexr.com
+255 -43
View File
@@ -6,54 +6,266 @@
## 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.
report it by filing a GitHub [security
advisory](https://github.com/AcademySoftwareFoundation/openexr/security/advisories/new). Alternatively,
email security@openexr.com and provide your contact info for further
private/secure discussion. If your email does not receive a prompt
acknowledgement, your address may be blocked.
Our policy is to address critical security vulnerabilities rapidly and
post patches as quickly as possible.
Our policy is to acknowledge the receipt of vulnerability reports
within 48 hours. Our policy is to address critical security vulnerabilities
rapidly and post patches within 14 days if possible.
## CVE Assignment
Our criteria for requesting a CVE are:
- Memory safety violations (out-of-bounds write, use-after-free, heap
corruption) reachable on mainstream 64-bit architectures through the
public library API, confirmed in an unsanitized build on a mainstream
platform, and affecting library code so that every downstream consumer
inherits the risk.
We do not request a CVE for:
- 32-bit-only bugs — bugs on 32-bit systems are real and will be fixed,
but since the vast majority of downstream packages (Linux distros,
conda-forge, vcpkg) build for 64-bit exclusively, a CVE creates
unnecessary work for maintainers who are not actually affected.
- Developer-tool-only crashes (exrmetrics, exrcheck) — the library
itself and standard utility programs are safe; only users who run
one of the developer tools on untrusted input are exposed.
Flaws whose root cause lies in a bundled dependency (such as OpenJPH)
are fixed upstream; the upstream project owns the CVE when one is
warranted. This applies even when a flaw is detected in dependency code
vendored into OpenEXR's `external/` source directory. OpenEXR addresses
such flaws by updating the dependency and noting the upstream advisory
in the release notes. We request a CVE for OpenEXR itself only when the
flaw is in our code and untrusted input can reach it through normal use
of the library.
## Known Vulnerabilities
These vulnerabilities are present in the given versions:
| CVE | Affected Versions | Patched 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.*
| [CVE-2026-55373](https://www.cve.org/CVERecord?id=CVE-2026-55373) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.9, 3.3.0–3.3.11, 3.4.0–3.4.12 | 3.2.10, 3.3.12, 3.4.13 |
| [CVE-2026-55371](https://www.cve.org/CVERecord?id=CVE-2026-55371) | 3.4.0–3.4.12 | 3.4.13 |
| [CVE-2026-55059](https://www.cve.org/CVERecord?id=CVE-2026-55059) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.9, 3.3.0–3.3.11, 3.4.0–3.4.12 | 3.2.10, 3.3.12, 3.4.13 |
| [CVE-2026-54920](https://www.cve.org/CVERecord?id=CVE-2026-54920) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.9, 3.3.0–3.3.11, 3.4.0–3.4.12 | 3.2.10, 3.3.12, 3.4.13 |
| [CVE-2026-53532](https://www.cve.org/CVERecord?id=CVE-2026-53532) | 3.4.0–3.4.12 | 3.4.13 |
| [CVE-2026-45696](https://www.cve.org/CVERecord?id=CVE-2026-45696) | 3.4.0–3.4.11 | 3.4.12 |
| [CVE-2026-44663](https://www.cve.org/CVERecord?id=CVE-2026-44663) | 3.4.0–3.4.11 | 3.4.12 |
| [CVE-2026-42217](https://www.cve.org/CVERecord?id=CVE-2026-42217) | 3.2.0–3.2.8, 3.3.0–3.3.10, 3.4.0–3.4.10 | 3.2.9, 3.3.11, 3.4.11 |
| [CVE-2026-42216](https://www.cve.org/CVERecord?id=CVE-2026-42216) | 3.2.0–3.2.8, 3.3.0–3.3.10, 3.4.0–3.4.10 | 3.2.9, 3.3.11, 3.4.11 |
| [CVE-2026-41142](https://www.cve.org/CVERecord?id=CVE-2026-41142) | 3.2.0–3.2.8, 3.3.0–3.3.10, 3.4.0–3.4.10 | 3.2.9, 3.3.11, 3.4.11 |
| [CVE-2026-40250](https://www.cve.org/CVERecord?id=CVE-2026-40250) | 3.2.0–3.2.7, 3.3.0–3.3.9, 3.4.0–3.4.9 | 3.2.8, 3.3.10, 3.4.10 |
| [CVE-2026-40244](https://www.cve.org/CVERecord?id=CVE-2026-40244) | 3.2.0–3.2.7, 3.3.0–3.3.9, 3.4.0–3.4.9 | 3.2.8, 3.3.10, 3.4.10 |
| [CVE-2026-39886](https://www.cve.org/CVERecord?id=CVE-2026-39886) | 3.4.0–3.4.9 | 3.4.10 |
| [CVE-2026-34589](https://www.cve.org/CVERecord?id=CVE-2026-34589) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
| [CVE-2026-34588](https://www.cve.org/CVERecord?id=CVE-2026-34588) | 3.1.x, 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
| [CVE-2026-34545](https://www.cve.org/CVERecord?id=CVE-2026-34545) | 3.4.0–3.4.6 | 3.4.7 |
| [CVE-2026-34544](https://www.cve.org/CVERecord?id=CVE-2026-34544) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.7 | 3.2.7, 3.3.9, 3.4.8 |
| [CVE-2026-34543](https://www.cve.org/CVERecord?id=CVE-2026-34543) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.7 | 3.2.7, 3.3.9, 3.4.8 |
| [CVE-2026-34380](https://www.cve.org/CVERecord?id=CVE-2026-34380) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
| [CVE-2026-34379](https://www.cve.org/CVERecord?id=CVE-2026-34379) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
| [CVE-2026-34378](https://www.cve.org/CVERecord?id=CVE-2026-34378) | 3.4.0–3.4.8 | 3.4.9 |
| [CVE-2026-27622](https://www.cve.org/CVERecord?id=CVE-2026-27622) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.5, 3.3.0–3.3.7, 3.4.0–3.4.5 | 3.2.6, 3.3.8, 3.4.6 |
| [CVE-2026-26981](https://www.cve.org/CVERecord?id=CVE-2026-26981) | 3.3.0–3.3.6, 3.4.0–3.4.4 | 3.3.7, 3.4.5 |
| [CVE-2025-64183](https://www.cve.org/CVERecord?id=CVE-2025-64183) | 3.2.0–3.2.4, 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.2.5, 3.3.6, 3.4.3 |
| [CVE-2025-64182](https://www.cve.org/CVERecord?id=CVE-2025-64182) | 3.2.0–3.2.4, 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.2.5, 3.3.6, 3.4.3 |
| [CVE-2025-64181](https://www.cve.org/CVERecord?id=CVE-2025-64181) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
| [CVE-2025-48074](https://www.cve.org/CVERecord?id=CVE-2025-48074) | 3.3.2 | 3.3.3 |
| [CVE-2025-48073](https://www.cve.org/CVERecord?id=CVE-2025-48073) | 3.3.2 | 3.3.3 |
| [CVE-2025-48072](https://www.cve.org/CVERecord?id=CVE-2025-48072) | 3.3.2 | 3.3.3 |
| [CVE-2025-48071](https://www.cve.org/CVERecord?id=CVE-2025-48071) | 3.3.0–3.3.2 | 3.3.3 |
| [CVE-2025-12840](https://www.cve.org/CVERecord?id=CVE-2025-12840) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
| [CVE-2025-12839](https://www.cve.org/CVERecord?id=CVE-2025-12839) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
| [CVE-2025-12495](https://www.cve.org/CVERecord?id=CVE-2025-12495) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
| [CVE-2023-5841](https://nvd.nist.gov/vuln/detail/CVE-2023-5841) | 3.1.0–3.1.11, 3.2.0–3.2.1 | 3.2.2 |
| [CVE-2021-45942](https://nvd.nist.gov/vuln/detail/CVE-2021-45942) | 3.1.0–3.1.3 | 3.1.4 |
| [CVE-2021-20296](https://nvd.nist.gov/vuln/detail/CVE-2021-20296) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
| [CVE-2021-3479](https://nvd.nist.gov/vuln/detail/CVE-2021-3479) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
| [CVE-2021-3478](https://nvd.nist.gov/vuln/detail/CVE-2021-3478) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
| [CVE-2021-3477](https://nvd.nist.gov/vuln/detail/CVE-2021-3477) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
| [CVE-2021-3476](https://nvd.nist.gov/vuln/detail/CVE-2021-3476) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
| [CVE-2021-3475](https://nvd.nist.gov/vuln/detail/CVE-2021-3475) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
| [CVE-2021-3474](https://nvd.nist.gov/vuln/detail/CVE-2021-3474) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
| [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 | 2.4.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 | 2.4.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 | 2.4.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 | 2.5.2 |
| [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 | 2.5.2 |
| [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 | 2.5.2 |
| [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 | 2.4.1 |
| [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 | 2.4.1 |
| [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 | 2.4.1 |
| [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 | 2.4.1 |
| [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 | 2.4.1 |
| [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 | 2.4.1 |
| [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 | 2.4.1 |
| [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 | 2.4.1 |
| [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 | 2.4.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 | 2.4.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 | 2.2.1 |
| [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 | 2.2.1 |
| [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 | 2.2.1 |
| [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 | 2.2.1 |
| [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 | 2.2.1 |
| [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 | 2.2.1 |
| [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 | 2.2.1 |
| [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.x, 1.1.x, 1.2.x, 1.3.x, 1.4.x, 1.5.x, 1.6.x | 1.7.0 |
| [CVE-2009-1721](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1721) | 1.0.x, 1.1.x, 1.2.x, 1.3.x, 1.4.x, 1.5.x, 1.6.x | 1.7.0 |
| [CVE-2009-1720](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1720) | 1.0.x, 1.1.x, 1.2.x, 1.3.x, 1.4.x, 1.5.x, 1.6.x | 1.7.0 |
See the [release notes](CHANGES.md) for more information.
## Supported Versions
This gives guidance about which releases/branches are supported with bug fixes and patches to
security vulnerabilities.
| Version / branch | Supported |
|-------| ---------------------------------------------------- |
| main | :white_check_mark: :construction: All fixes immediately, although this branch is under development with potential unstable ABI/API
| 3.4.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility
| 3.3.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility
| 3.2.x | :warning: Patch releases considered in response to specific requests
| 3.1.x | :warning: Patch releases considered in response to specific requests
| 3.0.x | :warning: Patch releases considered in response to specific requests
| 2.5.x | :warning: Patch releases considered in response to specific requests
| 2.4.x | :warning: Patch releases considered in response to specific requests
| 2.3.x | :x: No longer receiving patches of any kind
| 2.2.x | :x: No longer receiving patches of any kind
| 2.1.x | :x: No longer receiving patches of any kind
| 2.0.x | :x: No longer receiving patches of any kind
| 1.x | :x: No longer receiving patches of any kind
## Signed Releases
Releases artifacts are signed via
[sigstore](https://www.sigstore.dev). See
[release-sign.yml](.github/workflows/release-sign.yml) for details.
To verify a downloaded release at a given tag:
% pip install sigstore
% sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/openexr/.github/workflows/release-sign.yml@refs/tags/<tag> openexr-<tag>.tar.gz
## Security Expectations
### Software Features
- The OpenEXR project implements the EXR image file format, used
throughout the motion picture industry and beyond, on Linux, macOS,
and Windows.
- The project consists of a software run-time library, implemented in
C/C++ and built via cmake, that reads and writes image data
files. The project also distributes python wrappings for the C/C++
I/O API.
- The library reads and writes binary image data and text-based
metadata, treated as blind data, none of which is executable code.
- Other than the website and online technical documentation, the
project implements no web/online services or network communication
protocols. The library never requests any security or
authentication credentials or login information from users.
The website implements no interactive features and requires no login
credentials.
- The library reads and writes only to file paths specifically requested
via the C/C++ API. The runtime library uses no system configuration
files or sidecar data files. Access to data files uses only standard
file I/O system calls.
- The library compresses/decompresses data via standard compression
algorithms but uses no cryptographic or confidentiality protocols.
### Software Dependencies
OpenEXR depends on
[Imath](https://github.com/AcademySoftwareFoundation/Imath), a library
of basic math operations also maintained and distributed by the
OpenEXR project. Imath follows the same security conventions
documented here for OpenEXR itself. The core Imath library has no
external dependencies. The Imath python bindings depend on python and
boost.
The only
external library dependency of OpenEXR is
[libdeflate](https://github.com/ebiggers/libdeflate), which implements
standard deflate/zlib/gzip compression and decompression.
The project uses
[Snyk](https://github.com/AcademySoftwareFoundation/openexr/blob/main/.github/workflows/snyk-scan-pr.yml)
to scan for dependency vulnerability.
### Potential Vulnerabilities
Potential entry points are images being loaded using the
library. Malformed images could caused issues such as heap buffer
overflows, out-of-memory faults, or segmentation faults that could be
exploitable as denial-of-service attacks.
### Image Size Limits and Out-of-Memory Failures
The OpenEXR file format places no fixed limit on image size, except
that image width and height are represented by signed 32-bit integers
and therefore technically limited to a maximum of 2,147,483,647.
Memory allocation failures caused by large image dimensions declared
in file headers are not considered security vulnerabilities when the
allocation size is proportional to the declared image dimensions. EXR
files can legitimately describe very large images, and the memory
required to decode them is inherently proportional to their pixel
count. Exhausting available memory on a given machine is a system
resource constraint, not a library defect — the same file that
triggers an out-of-memory error on one machine may load successfully
on another with more memory.
The OpenEXR library provides
`Imf::Header::setMaxImageSize(int maxWidth,int maxHeight)` and
`Imf::Header:"setMaxTileSize(int maxWidth,int maxHeight)` (and
`exr_set_default_maximum_image_size()` and
`exr_set_default_maximum_tile_size()` in OpenEXRCore) to allow
applications to reject files with dimensions exceeding a configurable
limit before any large allocation occurs. Applications processing
untrusted EXR files should set these limits to values appropriate for
their deployment environment.
### Hardening
#### Testing
The OpenEXR project implements a comprehensive suite of validation
tests, including fuzz testing to harden against malicious input
data. Note that fuzz testing hardens only against *small* input data
files and is not a comprehensive test against all potential input.
Note that the
[exrcheck](https://github.com/AcademySoftwareFoundation/openexr/tree/main/src/bin/exrcheck)
utility is intended to be used by testers to demonstrate a particular
proof-of-concept input file exposes a vulnerability, and it is very
helpful to let us know if a vulnerability can be reproduced using that
tool.
The project also uses the [OSS
Fuzz](https://bugs.chromium.org/p/oss-fuzz) service for continuous
fuzz testing.
#### Development Cycle and Distribution
OpenEXR is downloadable and buildable by C/C++ source via GitHub. Only
members of the project's Technical Steering Committee, all veteran
software engineers at major motion picture studios or vendors, have
write permissions on the source code repository. All critical software
changes are reviewed by multiple TSC members.
The library is distributed in binary form via many common package
managers across all platforms.
-12
View File
@@ -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()
-76
View File
@@ -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"],
)
-55
View File
@@ -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"],
)
-38
View File
@@ -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",
],
)
+60 -16
View File
@@ -37,7 +37,17 @@ int main()
int edx = 0;
__asm__(
\"xgetbv ;\"
\"vzeroupper \"
//
// This feature probe is specifically used to decide whether we can
// compile the DWA fast path that contains GCC-style inline asm using
// AVX/YMM instructions. Some toolchains (notably older Apple 'as'
// invoked by GCC on legacy macOS) can assemble xgetbv/vzeroupper but
// still reject YMM/VEX instructions with errors like:
// no such instruction: `vmovaps (%rsi), %ymm0'
// So include a representative YMM instruction in the try-compile.
//
\"vmovaps %%ymm0, %%ymm0 ;\"
\"vzeroupper \"
: \"=a\"(eax), \"=d\"(edx) : \"c\"(n) : );
#else
# error No SSE support enabled to query AVX support
@@ -63,6 +73,11 @@ if (OPENEXR_USE_DEFAULT_VISIBILITY)
else()
set(OPENEXR_ENABLE_API_VISIBILITY ON)
endif()
if (OPENEXR_FORCE_EMBEDDED_CORE)
set(OPENEXR_CORE_FUNCTIONS_EMBEDDED ON)
else()
set(OPENEXR_CORE_FUNCTIONS_EMBEDDED OFF)
endif()
if (UNIX AND NOT APPLE AND NOT BEOS)
find_library(OPENEXR_EXTRA_MATH_LIB m)
@@ -74,15 +89,6 @@ configure_file(OpenEXRConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRCon
# 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
@@ -128,6 +134,28 @@ 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)
# See comment in LibraryDefine.cmake regarding applications that build
# OpenEXR via add_subdirectory(): In that configuration, the *Config.h
# headers need to be linked/copied to the OpenEXR/ subdirectory to
# support use of #include <OpenEXR/...> when building in-tree. This is
# only necessary when OpenEXR is a subproject, i.e. added to an
# application via add_subdirectory().
if(OPENEXR_IS_SUBPROJECT)
foreach(_hdr IN ITEMS OpenEXRConfig.h IexConfig.h IlmThreadConfig.h)
set(_cfg_src "${CMAKE_CURRENT_BINARY_DIR}/${_hdr}")
set(_cfg_dst "${OPENEXR_BUILD_INTERFACE_UNIFIED}/${OPENEXR_OUTPUT_SUBDIR}/${_hdr}")
if(EXISTS "${_cfg_src}")
file(REMOVE "${_cfg_dst}")
if(CMAKE_HOST_UNIX)
file(CREATE_LINK "${_cfg_src}" "${_cfg_dst}" SYMBOLIC)
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_cfg_src}" "${_cfg_dst}")
endif()
endif()
endforeach()
endif()
###################################################
####### Install public config headers
@@ -147,7 +175,12 @@ endif()
add_library(OpenEXRConfig INTERFACE)
target_include_directories(OpenEXRConfig INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
if(OPENEXR_IS_SUBPROJECT)
target_include_directories(OpenEXRConfig INTERFACE
$<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
endif()
target_include_directories(OpenEXRConfig INTERFACE
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)
@@ -158,25 +191,35 @@ add_library(${PROJECT_NAME}::Config ALIAS OpenEXRConfig)
add_library(IexConfig INTERFACE)
target_include_directories(IexConfig INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
if(OPENEXR_IS_SUBPROJECT)
target_include_directories(IexConfig INTERFACE
$<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
endif()
target_include_directories(IexConfig INTERFACE
$<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(Iex::Config ALIAS IexConfig)
add_library(IlmThreadConfig INTERFACE)
target_include_directories(IlmThreadConfig INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
if(OPENEXR_IS_SUBPROJECT)
target_include_directories(IlmThreadConfig INTERFACE
$<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
endif()
target_include_directories(IlmThreadConfig INTERFACE
$<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)
add_library(IlmThread::Config ALIAS IlmThreadConfig)
###################################################
####### Install pkg-config files if requested
@@ -219,8 +262,9 @@ if(OPENEXR_INSTALL_PKG_CONFIG)
)
endfunction()
openexr_pkg_config_help(OpenEXR.pc.in)
message(STATUS "OpenEXR pkg-config generation enabled")
else()
message(STATUS "-- pkg-config generation disabled")
message(STATUS "OpenEXR pkg-config generation disabled")
endif()
###################################################
+1
View File
@@ -17,6 +17,7 @@
#cmakedefine01 ILMTHREAD_THREADING_ENABLED
#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES
#cmakedefine01 ILMTHREAD_USE_TBB
//
// Current internal library namespace name
+65 -21
View File
@@ -4,33 +4,34 @@
# 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(options EMBEDDED)
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")
set(_openexr_extra_flags "$<$<COMPILE_LANGUAGE:CXX>:/EHsc>" "$<$<COMPILE_LANGUAGE:CXX>:/MP>")
endif()
set(objlib ${libname})
add_library(${objlib}
if(OPENEXR_CURLIB_EMBEDDED)
set(libopts STATIC)
else()
set(libopts)
endif()
add_library(${objlib} ${libopts}
${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.
# OpenEXR itself. The headers will use string_view and such, so ensure
# the user is at least 17, but could be higher
target_compile_features(${objlib}
PRIVATE cxx_std_${OPENEXR_CXX_STANDARD}
INTERFACE cxx_std_11 )
INTERFACE cxx_std_17 )
# we are embedding libdeflate
target_include_directories(${objlib} PRIVATE ${EXR_DEFLATE_INCLUDE_DIR})
if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
if(OPENEXR_CURLIB_EMBEDDED)
set(libopts)
elseif(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)
@@ -39,11 +40,50 @@ function(OPENEXR_DEFINE_LIBRARY libname)
if(OPENEXR_CURLIB_CURDIR)
target_include_directories(${objlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURDIR}>)
# When an application builds against OpenEXR via
# add_subdirector(OpenEXR), if should still recognize include
# statements with the OpenEXR subdirectory, ie. #include
# <OpenEXR/ImfHeader.h>, altough in that configuration, there is
# no OpenEXR subdirectory, since it is the install step that
# places headers there; for an in-tree build, the headers are in
# each library. To allow such an application to use the #include
# <OpenEXR/...> construct, create a directory in the build root
# with symbolic links to the headers in the library directories.
#
# We detect this condition via the OPENEXR_IS_SUBPROJECT setting,
# which is set in OpenEXRSetup.cmake when CMAKE_PROJECT_NAME is
# not "OpenEXR".
if(OPENEXR_IS_SUBPROJECT AND OPENEXR_CURLIB_HEADERS)
foreach(_hdr IN LISTS OPENEXR_CURLIB_HEADERS)
if(IS_ABSOLUTE "${_hdr}")
set(_hdr_src "${_hdr}")
else()
set(_hdr_src "${OPENEXR_CURLIB_CURDIR}/${_hdr}")
endif()
get_filename_component(_hdr_name "${_hdr}" NAME)
set(_hdr_dst "${OPENEXR_BUILD_INTERFACE_UNIFIED}/${OPENEXR_OUTPUT_SUBDIR}/${_hdr_name}")
if(EXISTS "${_hdr_src}")
file(REMOVE "${_hdr_dst}")
if(CMAKE_HOST_UNIX)
file(CREATE_LINK "${_hdr_src}" "${_hdr_dst}" SYMBOLIC)
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_hdr_src}" "${_hdr_dst}")
endif()
else()
message(WARNING "OpenEXR build-interface include: missing public header ${_hdr_src}")
endif()
endforeach()
endif()
if(OPENEXR_IS_SUBPROJECT)
target_include_directories(${objlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
endif()
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})
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
if(OPENEXR_CURLIB_PRIVATE_DEPS)
target_link_libraries(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIVATE_DEPS})
endif()
@@ -52,7 +92,7 @@ function(OPENEXR_DEFINE_LIBRARY libname)
CXX_EXTENSIONS OFF
POSITION_INDEPENDENT_CODE ON
)
if (NOT OPENEXR_USE_DEFAULT_VISIBILITY)
if (OPENEXR_CURLIB_EMBEDDED OR NOT OPENEXR_USE_DEFAULT_VISIBILITY)
set_target_properties(${objlib} PROPERTIES
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
@@ -62,11 +102,11 @@ function(OPENEXR_DEFINE_LIBRARY libname)
target_compile_definitions(${objlib} PUBLIC OPENEXR_USE_DEFAULT_VISIBILITY)
endif()
if (_openexr_extra_flags)
target_compile_options(${objlib} PUBLIC ${_openexr_extra_flags})
target_compile_options(${objlib} PRIVATE ${_openexr_extra_flags})
endif()
set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS})
if(BUILD_SHARED_LIBS)
if(BUILD_SHARED_LIBS AND NOT OPENEXR_CURLIB_EMBEDDED)
set_target_properties(${libname} PROPERTIES
SOVERSION ${OPENEXR_LIB_SOVERSION}
VERSION ${OPENEXR_LIB_VERSION}
@@ -76,7 +116,6 @@ function(OPENEXR_DEFINE_LIBRARY libname)
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}
@@ -89,13 +128,18 @@ function(OPENEXR_DEFINE_LIBRARY libname)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
)
endif()
if(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "") AND NOT WIN32)
if(OPENEXR_CURLIB_EMBEDDED)
set(libopts)
elseif(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}\")")
file(CREATE_LINK ${verlibname} ${CMAKE_CURRENT_BINARY_DIR}/${baselibname} SYMBOLIC)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${baselibname} DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_LIBDIR}/${baselibname} -> ${verlibname}\")")
set(verlibname)
set(baselibname)
endif()
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})
endfunction()
+1
View File
@@ -17,4 +17,5 @@ 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
Requires.private: @EXR_DEFLATE_PKGCONFIG_REQUIRES@ @EXR_OPENJPH_PKGCONFIG_REQUIRES@
+10 -2
View File
@@ -8,11 +8,19 @@ include(CMakeFindDependencyMacro)
set(openexr_needthreads @OPENEXR_ENABLE_THREADING@)
if (openexr_needthreads)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_dependency(Threads REQUIRED)
find_dependency(Threads)
endif()
unset(openexr_needthreads)
find_dependency(Imath REQUIRED)
find_dependency(Imath)
if (@libdeflate_FOUND@)
find_dependency(libdeflate)
endif()
if (NOT @OPENEXR_USE_INTERNAL_OPENJPH@)
find_dependency(openjph)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components("@PROJECT_NAME@")
+32 -13
View File
@@ -8,14 +8,29 @@
#pragma once
/// @TODO get the version from the header files.
/// due to the structure of the cmake configuration steps,
/// it's not obvious how to structure things for this to work.
/// so for now, just hardcode the version here.
//#include <OpenEXRCore/openexr_version.h>
#define OPENEXR_VERSION_MAJOR 3
#define OPENEXR_VERSION_MINOR 2
#define OPENEXR_VERSION_PATCH 0
//
// 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@
#define OPENEXR_SOVERSION @OPENEXR_LIB_SOVERSION@
#endif
#define OPENEXR_IMATH_SOVERSION @Imath_SOVERSION@
#define OPENEXR_IMATH_VERSION_MAJOR @Imath_VERSION_MAJOR@
#define OPENEXR_IMATH_VERSION_MINOR @Imath_VERSION_MINOR@
#define OPENEXR_IMATH_VERSION_PATCH @Imath_VERSION_PATCH@
#define OPENEXR_OPENJPH_VERSION_MAJOR @openjph_VERSION_MAJOR@
#define OPENEXR_OPENJPH_VERSION_MINOR @openjph_VERSION_MINOR@
#define OPENEXR_OPENJPH_VERSION_PATCH @openjph_VERSION_PATCH@
//
// Options / configuration based on O.S. / compiler
@@ -63,10 +78,10 @@
// 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))
#define OPENEXR_VERSION_HEX \
(((OPENEXR_VERSION_MAJOR) << 24) | \
((OPENEXR_VERSION_MINOR) << 16) | \
((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.
@@ -78,6 +93,8 @@
// tagged
#cmakedefine OPENEXR_ENABLE_API_VISIBILITY
#cmakedefine OPENEXR_CORE_FUNCTIONS_EMBEDDED
/// \defgroup ExportMacros Macros to manage symbol visibility
///
/// See website/SymbolVisibility.rst for more discussion about the
@@ -110,8 +127,10 @@
///
/// @{
// Visibility attributes are ELF-specific; on Windows (MSVC or MinGW) they are
// not supported and trigger -Wattributes warnings, so use empty macros there.
#if defined(OPENEXR_ENABLE_API_VISIBILITY) && \
!(defined(OPENEXR_DLL) || defined(_MSC_VER))
!(defined(OPENEXR_DLL) || defined(_MSC_VER) || defined(_WIN32))
# define OPENEXR_PUBLIC_SYMBOL_ATTRIBUTE \
__attribute__ ((__visibility__ ("default")))
# define OPENEXR_PRIVATE_SYMBOL_ATTRIBUTE \
+9 -4
View File
@@ -8,16 +8,21 @@
#pragma once
// automated formatting does not handle the cmake tags well
// clang-format off
//
// Whether to use the internally provided vendored version of
// deflate or the system provided version
#cmakedefine OPENEXR_USE_INTERNAL_DEFLATE 1
//
// 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
//
+256 -77
View File
@@ -11,14 +11,14 @@ 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)
# What C++ standard to compile for. 17 by default
set(tmp 17)
if(CMAKE_CXX_STANDARD)
set(tmp ${CMAKE_CXX_STANDARD})
endif()
set(OPENEXR_CXX_STANDARD "${tmp}" CACHE STRING "C++ standard to compile against")
set(tmp)
message(STATUS "Building against C++ Standard: ${OPENEXR_CXX_STANDARD}")
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")
@@ -36,15 +36,20 @@ set(IEX_INTERNAL_NAMESPACE "Iex_${OPENEXR_VERSION_API}" CACHE STRING "Real names
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
# are still used, just processed immediately. Note that if this is disabled, the
# OpenEXR library may not be thread-safe and should only be used by a single thread.
option(OPENEXR_ENABLE_THREADING "Enables threaded processing of requests" ON)
# When set to ON, will change the thread pool to use TBB for the
# global thread pool by default.
#
# Regardless of this setting, if you create your own additional thread
# pools, those will NOT use TBB by default, as it can easily cause
# recursive mutex deadlocks as TBB shares a single thread pool with
# multiple arenas
option(OPENEXR_USE_TBB "Switch internals of IlmThreadPool to use TBB by default" OFF)
option(OPENEXR_USE_DEFAULT_VISIBILITY "Makes the compile use default visibility (by default compiles tidy, hidden-by-default)" OFF)
@@ -55,21 +60,60 @@ option(OPENEXR_ENABLE_LARGE_STACK "Enables code to take advantage of large stack
########################
## Build related options
# Whether to build & install the various command line utility programs
option(OPENEXR_BUILD_TOOLS "Enables building of utility programs" ON)
option(OPENEXR_INSTALL "Install OpenEXR libraries/binaries/bindings" ON)
# This is a variable here for use in controlling where include files are
# Whether to build & install the main libraries
option(OPENEXR_BUILD_LIBS "Enables building of main libraries" ON)
# Whether to build the various command line utility programs
option(OPENEXR_BUILD_TOOLS "Enables building of utility programs" ON)
option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON)
option(OPENEXR_INSTALL_DEVELOPER_TOOLS "Install OpenEXR developer tools" OFF)
option(OPENEXR_BUILD_EXAMPLES "Build and install OpenEXR examples" ON)
option(OPENEXR_BUILD_PYTHON "Build python bindings" OFF)
option(OPENEXR_BUILD_OSS_FUZZ "Build the oss-fuzz fuzzers" OFF)
if (OPENEXR_BUILD_OSS_FUZZ)
# If building the oss-fuzz fuzzers, accept the comiler/options from
# the environment.
set(CMAKE_CXX_COMPILER $ENV{CXX})
set(CMAKE_CXX_FLAGS $ENV{CXX_FLAGS})
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_C_FLAGS $ENV{CC_FLAGS})
endif()
option(OPENEXR_TEST_LIBRARIES "Run library tests" ON)
option(OPENEXR_TEST_TOOLS "Run tool tests" ON)
option(OPENEXR_TEST_PYTHON "Run python binding tests" 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")
# When OpenEXR is pulled in via add_subdirectory(), mirror installed layout under
# BUILD_INTERFACE so consumers can use #include <OpenEXR/...>. Not used for a normal
# top-level OpenEXR build (clears legacy cache entry from older CMake revisions).
if(OPENEXR_IS_SUBPROJECT)
set(OPENEXR_BUILD_INTERFACE_UNIFIED "${CMAKE_BINARY_DIR}/OpenEXR_build_interface_include")
file(MAKE_DIRECTORY "${OPENEXR_BUILD_INTERFACE_UNIFIED}/${OPENEXR_OUTPUT_SUBDIR}")
else()
unset(OPENEXR_BUILD_INTERFACE_UNIFIED CACHE)
unset(OPENEXR_BUILD_INTERFACE_UNIFIED)
endif()
# 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")
# Don't override if the user has set it and don't save it in the cache
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "_d")
endif()
if(NOT OPENEXR_IS_SUBPROJECT)
# Usual cmake option to build shared libraries or not, only overridden if OpenEXR is a top level project,
@@ -142,6 +186,10 @@ if(OPENEXR_USE_CLANG_TIDY)
)
endif()
if (NOT OPENEXR_BUILD_LIBS)
return()
endif()
###############################
# Dependent libraries
@@ -155,69 +203,134 @@ if(OPENEXR_ENABLE_THREADING)
message(FATAL_ERROR "Unable to find a threading library, disable with OPENEXR_ENABLE_THREADING=OFF")
endif()
endif()
if(OPENEXR_USE_TBB)
find_package(TBB)
if(NOT TBB_FOUND)
message(FATAL_ERROR "Unable to find the OneTBB cmake library, disable with ILMTHREAD_USE_TBB=OFF or fix TBB install")
endif()
endif()
endif()
set (ILMTHREAD_USE_TBB ${OPENEXR_USE_TBB})
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)")
set (OPENEXR_USE_INTERNAL_DEFLATE OFF)
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)
# First try cmake config
find_package(libdeflate CONFIG QUIET)
if(libdeflate_FOUND)
if(TARGET libdeflate::libdeflate_shared)
set(EXR_DEFLATE_LIB libdeflate::libdeflate_shared)
else()
set(EXR_DEFLATE_LIB libdeflate::libdeflate_static)
endif()
set(EXR_DEFLATE_VERSION ${libdeflate_VERSION})
message(STATUS "Using libdeflate from ${libdeflate_DIR}")
else()
# If not found, try pkgconfig
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
include(FindPkgConfig)
pkg_check_modules(deflate IMPORTED_TARGET GLOBAL QUIET libdeflate)
if(deflate_FOUND)
set(EXR_DEFLATE_LIB PkgConfig::deflate)
set(EXR_DEFLATE_VERSION ${deflate_VERSION})
message(STATUS "Using libdeflate from ${deflate_LINK_LIBRARIES}")
endif()
endif()
endif()
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)
if(EXR_DEFLATE_LIB)
# Using external library
message(STATUS "Using externally provided libdeflate: ${EXR_DEFLATE_VERSION}")
# For OpenEXR.pc.in for static build
set(EXR_DEFLATE_PKGCONFIG_REQUIRES "libdeflate >= ${EXR_DEFLATE_VERSION}")
else()
set(EXR_DEFLATE_INCLUDE_DIR)
set(EXR_DEFLATE_LIB PkgConfig::deflate)
set(EXR_DEFLATE_SOURCES)
# Using internal deflate
if(OPENEXR_FORCE_INTERNAL_DEFLATE)
message(STATUS "libdeflate forced internal, using vendored code")
else()
message(STATUS "libdeflate was not found, using vendored code")
endif()
set (OPENEXR_USE_INTERNAL_DEFLATE ON)
set(EXR_DEFLATE_LIB)
endif()
#######################################
# Find or download OpenJPH
#######################################
option(OPENEXR_FORCE_INTERNAL_OPENJPH "Force downloading OpenJPH from a git repo" OFF)
set(OPENEXR_USE_INTERNAL_OPENJPH 0 CACHE INTERNAL
"Whether OpenEXR bundles vendored OpenJPH into OpenEXRCore (0 or 1)")
if (NOT OPENEXR_FORCE_INTERNAL_OPENJPH)
find_package(openjph CONFIG QUIET)
if(openjph_FOUND)
if(openjph_VERSION VERSION_LESS "0.21.0")
message(FATAL_ERROR "OpenJPH >= 0.21.0 required, but found ${openjph_VERSION}")
endif()
message(STATUS "Using OpenJPH ${openjph_VERSION} from ${openjph_DIR}")
set(EXR_OPENJPH_LIB openjph)
else()
# If not found, try pkgconfig
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
include(FindPkgConfig)
pkg_check_modules(openjph IMPORTED_TARGET GLOBAL QUIET openjph=0.21)
if(openjph_FOUND)
set(EXR_OPENJPH_LIB PkgConfig::openjph)
message(STATUS "Using OpenJPH ${openjph_VERSION} from ${openjph_LINK_LIBRARIES}")
endif()
endif()
endif()
endif()
if(EXR_OPENJPH_LIB)
# Using external library
# For OpenEXR.pc.in for static build
set(EXR_OPENJPH_PKGCONFIG_REQUIRES "openjph >= 0.21.0")
else()
# Using internal openjph
set(OPENEXR_USE_INTERNAL_OPENJPH 1 CACHE INTERNAL
"Whether OpenEXR bundles vendored OpenJPH into OpenEXRCore (0 or 1)" FORCE)
# extract the openjph version variables from ojph_version.h
set(openjph_SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/OpenJPH")
set(openjph_version "${openjph_SOURCE_DIR}/src/core/openjph/ojph_version.h")
if(EXISTS "${openjph_version}")
file(STRINGS "${openjph_version}" _openjph_major REGEX "#define OPENJPH_VERSION_MAJOR")
file(STRINGS "${openjph_version}" _openjph_minor REGEX "#define OPENJPH_VERSION_MINOR")
file(STRINGS "${openjph_version}" _openjph_patch REGEX "#define OPENJPH_VERSION_PATCH")
file(STRINGS "${openjph_version}" _openjph_sha REGEX "#define OPENJPH_VERSION_SHA")
string(REGEX REPLACE ".*OPENJPH_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" openjph_VERSION_MAJOR "${_openjph_major}")
string(REGEX REPLACE ".*OPENJPH_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" openjph_VERSION_MINOR "${_openjph_minor}")
string(REGEX REPLACE ".*OPENJPH_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" openjph_VERSION_PATCH "${_openjph_patch}")
string(REGEX REPLACE ".*OPENJPH_VERSION_SHA[ \t]+([0-9a-f]+).*" "\\1" openjph_VERSION_SHA "${_openjph_sha}")
else()
message(STATUS "can't find openjph_version.h: ${openjph_version}")
endif()
if(openjph_VERSION_SHA)
set(openjph_VERSION "${openjph_VERSION_SHA}")
else()
set(openjph_VERSION "${openjph_VERSION_MAJOR}.${openjph_VERSION_MINOR}.${openjph_VERSION_PATCH}")
endif()
if(OPENEXR_FORCE_INTERNAL_OPENJPH)
message(STATUS "openjph forced internal, using vendored code, version ${openjph_VERSION}")
else()
message(STATUS "openjph was not found, using vendored code, version ${openjph_VERSION}")
endif()
endif()
#######################################
@@ -226,22 +339,20 @@ endif()
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 "main" CACHE STRING
"Tag for auto-build of Imath (branch, tag, or SHA)")
set(OPENEXR_IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING "Repo for auto-build of Imath")
set(OPENEXR_IMATH_TAG "main" 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)
find_package(Imath 3.1 CONFIG QUIET)
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})")
message(STATUS "Imath forced internal, fetching from ${OPENEXR_IMATH_REPO} @ ${OPENEXR_IMATH_TAG}")
else()
message(STATUS "Imath was not found, installing from ${OPENEXR_IMATH_REPO} (${OPENEXR_IMATH_TAG})")
message(STATUS "Imath was not found, fetching from ${OPENEXR_IMATH_REPO} @ ${OPENEXR_IMATH_TAG}")
endif()
include(FetchContent)
FetchContent_Declare(Imath
@@ -249,13 +360,30 @@ if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
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})
FetchContent_MakeAvailable(Imath)
# Propagate OpenEXR's install setting to Imath
set(IMATH_INSTALL ${OPENEXR_INSTALL})
# Propagate OpenEXR's setting for pkg-config generation to Imath:
# If OpenEXR is generating it, the internal Imath should, too.
set(IMATH_INSTALL_PKG_CONFIG ${OPENEXR_INSTALL_PKG_CONFIG})
endif()
# extract the imath version variables from ImathConfig.h
set(_imath_cfg "${Imath_BINARY_DIR}/config/ImathConfig.h")
if(EXISTS "${_imath_cfg}")
file(STRINGS "${_imath_cfg}" _ver_line REGEX "IMATH_LIB_VERSION_STRING")
string(REGEX REPLACE ".*IMATH_LIB_VERSION_STRING[ \t]+\"([0-9.]+)\".*" "\\1" IMATH_LIB_VERSION_STRING "${_ver_line}")
string(REPLACE "." ";" _ver_list "${IMATH_LIB_VERSION_STRING}")
list(GET _ver_list 0 Imath_SOVERSION)
list(GET _ver_list 1 Imath_VERSION_MAJOR)
list(GET _ver_list 2 Imath_VERSION_MINOR)
list(GET _ver_list 3 Imath_VERSION_PATCH)
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
@@ -264,10 +392,9 @@ if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
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}")
message(STATUS "Using Imath ${Imath_VERSION} from ${Imath_DIR}")
# local build
# add_subdirectory(${IMATH_ROOT} Imath)
# add_subdirectory(${OPENEXR_ROOT} OpenEXR)
@@ -280,6 +407,45 @@ else()
endif()
endif()
# OpenEXR includes Imath headers from an "Imath/" subdirectory,
# i.e. #include <Imath/ImathVec.h. The Imath library installs its
# headers in that folder, although when Imath is built inside the
# OpenEXR build tree (brought in via FetchContent or
# add_subdirectory), there is no "Imath/" subdirectory. Imath’s CMake
# exposes an include dir pointing at …/src/Imath (matches #include
# <ImathVec.h> but doesn't match <Imath/ImathVec.h>), and ImathConfig,
# an include dir pointing at …/config, where ImathConfig.h lives
# (matches #include <ImathConfig.h>, not <Imath/ImathConfig.h>).
#
# To support #include <Imath/...> in this configuration, we must
# create an "Imath/" directory in the build tree and symlink/copy the
# ImathConfig.h header into it, and also provide Imath's "src/"
# directory as a build interface include dir (because "Imath/" lives
# underneath it).
if(TARGET Imath AND TARGET ImathConfig)
get_target_property(_openexr_imath_imported Imath IMPORTED)
get_target_property(_openexr_imathcfg_imported ImathConfig IMPORTED)
if(NOT _openexr_imath_imported
AND NOT _openexr_imathcfg_imported
AND EXISTS "${Imath_SOURCE_DIR}/src/Imath/ImathVec.h")
set(_openexr_imath_gen_cfg "${Imath_BINARY_DIR}/config/ImathConfig.h")
set(_openexr_imath_cfg_compat "${PROJECT_BINARY_DIR}/OpenEXR_ImathIncludeCompat")
if(EXISTS "${_openexr_imath_gen_cfg}")
file(MAKE_DIRECTORY "${_openexr_imath_cfg_compat}/Imath")
configure_file("${_openexr_imath_gen_cfg}"
"${_openexr_imath_cfg_compat}/Imath/ImathConfig.h" COPYONLY)
endif()
target_include_directories(Imath INTERFACE
"$<BUILD_INTERFACE:${Imath_SOURCE_DIR}/src>")
if(EXISTS "${_openexr_imath_gen_cfg}")
target_include_directories(ImathConfig INTERFACE
"$<BUILD_INTERFACE:${_openexr_imath_cfg_compat}>")
endif()
endif()
endif()
###########################################
# Check if we need to emulate vld1q_f32_x2
###########################################
@@ -297,3 +463,16 @@ int main() {
set(OPENEXR_MISSING_ARM_VLD1 TRUE)
endif()
endif()
###########################################
# Enable SSE2 on 32-bit x86
###########################################
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3-6]86|x86)$" AND NOT MSVC)
include(CheckCCompilerFlag)
check_c_compiler_flag("-msse2" HAS_SSE2_FLAG)
if(HAS_SSE2_FLAG)
add_compile_options(-msse2 -mfpmath=sse)
message(STATUS "Enabling SSE2 for 32-bit x86 build")
endif()
endif()
+22 -6
View File
@@ -15,18 +15,34 @@
#
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR i686)
set(TOOLCHAIN_PREFIX i686-w64-mingw32)
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_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set(CMAKE_MC_COMPILER ${TOOLCHAIN_PREFIX}-windmc)
set(CMAKE_AR:FILEPATH ${TOOLCHAIN_PREFIX}-ar)
set(CMAKE_RANLIB:FILEPATH ${TOOLCHAIN_PREFIX}-ranlib)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
set(CMAKE_EXE_LINKER_FLAGS "-m32 -static-libgcc -static-libstdc++ -static" CACHE STRING "link flags")
set(CMAKE_SHARED_LINKER_FLAGS "-m32 -static-libgcc -static-libstdc++ -static" CACHE STRING "slink flags")
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_C_FLAGS_INIT "-m32 -mfpmath=sse -msse2 -Wl,--large-address-aware $ENV{CFLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS_INIT "-m32 -mfpmath=sse -msse2 -Wl,--large-address-aware $ENV{CFLAGS} ${CMAKE_CXX_FLAGS}")
unset (CMAKE_C_FLAGS CACHE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
unset (CMAKE_CXX_FLAGS CACHE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
+26
View File
@@ -0,0 +1,26 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Kitware, Inc and Contributors to the OpenEXR Project.
# Portions of this file were adapted from the CMake community FAQ:
# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS
"-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()
+5 -7
View File
@@ -41,20 +41,18 @@ 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(exrmanifest "print id manifest")
define_manpage(exrmetrics "report read/write time")
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_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()
include(GNUInstallDirs)
install(DIRECTORY ${MANPAGE_OUTPUT_DIR}/man1 DESTINATION ${CMAKE_INSTALL_MANDIR})
# build the example code to verify that it compiles
+242
View File
@@ -0,0 +1,242 @@
cmake_minimum_required(VERSION 3.12.0)
## Library name/version
include(ojph_version.cmake)
## project
project (openjph VERSION ${OPENJPH_VERSION} DESCRIPTION "Open source implementation of JPH" LANGUAGES C CXX)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################################
# Building OpenJPH
################################################################################################
## Target architecture
# We use the target architecture to help with arranging files in "source_group" commands.
# The code does not use the results provided by target_arch.cmake, and relies, instead,
# on its own logic, which matches that in target_arch.cmake, to identify the architecture
include(target_arch.cmake)
target_architecture(OJPH_TARGET_ARCH)
message(STATUS "CPU Architecture is ${OJPH_TARGET_ARCH}")
## Building for multi-generation
# This is useful for when we are building a multi-architecture build, such as when using
# the -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" build configuration
if (CMAKE_OSX_ARCHITECTURES)
list(FIND CMAKE_OSX_ARCHITECTURES "x86_64" x86_64_index)
if (${x86_64_index} GREATER -1)
set(MULTI_GEN_X86_64 TRUE)
endif()
unset(x86_64_index)
list(FIND CMAKE_OSX_ARCHITECTURES "arm64" arm64_index)
if (${arm64_index} GREATER -1)
set(MULTI_GEN_ARM64 TRUE)
endif()
unset(arm64_index)
endif()
## options
option(OJPH_ENABLE_TIFF_SUPPORT "Enables input and output support for TIFF files" ON)
option(OJPH_BUILD_TESTS "Enables building test code" OFF)
option(OJPH_BUILD_EXECUTABLES "Enables building command line executables" ON)
option(OJPH_BUILD_STREAM_EXPAND "Enables building ojph_stream_expand executable" OFF)
option(OJPH_INSTALL "Install OpenJPH libraries, headers, and CMake config" ON)
option(OJPH_DISABLE_SIMD "Disables the use of SIMD instructions -- agnostic to architectures" OFF)
option(OJPH_DISABLE_SSE "Disables the use of SSE SIMD instructions and associated files" OFF)
option(OJPH_DISABLE_SSE2 "Disables the use of SSE2 SIMD instructions and associated files" OFF)
option(OJPH_DISABLE_SSSE3 "Disables the use of SSSE3 SIMD instructions and associated files" OFF)
option(OJPH_DISABLE_SSE4 "Disables the use of SSE4 SIMD instructions and associated files" OFF)
option(OJPH_DISABLE_AVX "Disables the use of AVX SIMD instructions and associated files" OFF)
option(OJPH_DISABLE_AVX2 "Disables the use of AVX2 SIMD instructions and associated files" OFF)
option(OJPH_DISABLE_AVX512 "Disables the use of AVX512 SIMD instructions and associated files" OFF)
option(OJPH_DISABLE_NEON "Disables the use of NEON SIMD instructions and associated files" OFF)
## options that are being deprecated
if (DEFINED OJPH_DISABLE_INTEL_SIMD)
message(STATUS "OJPH_DISABLE_INTEL_SIMD is being deprecated. Instead, use \"OJPH_DISABLE_SIMD\", "
"which is architecture agnostic. If you do not specify any, the default is "
"OJPH_DISABLE_SIMD=OFF.")
set(OJPH_DISABLE_SIMD ${OJPH_DISABLE_INTEL_SIMD})
message(STATUS "OJPH_DISABLE_SIMD is set to ${OJPH_DISABLE_SIMD}")
unset(OJPH_DISABLE_INTEL_SIMD)
endif()
if (DEFINED OJPH_ENABLE_INTEL_AVX512)
message(STATUS "OJPH_ENABLE_INTEL_AVX512 is being deprecated, use \"OJPH_DISABLE_AVX512\" instead."
"If you do not specify any, the default is OJPH_DISABLE_AVX512=OFF.")
if (OJPH_ENABLE_INTEL_AVX512)
set(OJPH_DISABLE_AVX512 OFF)
else()
set(OJPH_DISABLE_AVX512 ON)
endif()
message(STATUS "OJPH_DISABLE_AVX512 is set to ${OJPH_DISABLE_AVX512}")
unset(OJPH_ENABLE_INTEL_AVX512)
endif()
## Setting some of the options if EMSCRIPTEN is the compiler
# In previous releases, the cmake script used to produce both non-SIMD and
# SIMD builds in one go. At the time of this writing, all interpreters and
# compilers of WASM code, such as web-browser and node, support SIMD, therefore
# it is time to make the SIMD build the default. In other words, this cmake
# script builds only WASM SIMD code by default, if desired, a non-SIMD build
# can be generated using the OJPH_DISABLE_SIMD option (in this case, the
# WASM SIMD code is not generated).
# It is worth remembering that the SIMD/non-SIMD issue arose because it is
# NOT possible to have multiple execution paths in the code, one for non-SIMD
# and one for SIMD, as we do for CPUs, letting the program select, at run-time,
# the best path to follow.
if(EMSCRIPTEN)
set(BUILD_SHARED_LIBS OFF)
set(OJPH_ENABLE_TIFF_SUPPORT OFF)
set(OJPH_BUILD_STREAM_EXPAND OFF)
if (OJPH_DISABLE_SIMD)
set(OJPH_ENABLE_WASM_SIMD OFF)
else()
set(OJPH_ENABLE_WASM_SIMD ON)
endif()
endif()
# This is related to how the timestamp is set for URL downloaded files.
# Set DOWNLOAD_EXTRACT_TIMESTAMP
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
if(POLICY CMP0065)
cmake_policy(SET CMP0135 NEW)
endif()
endif()
## Added by Michael Smith
set(CMAKE_CXX_FLAGS_ASAN
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds."
FORCE)
## Build type
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "To use AddressSanitizer, use \"cmake .. -DCMAKE_BUILD_TYPE=asan\"" )
endif()
message(STATUS "Building ${CMAKE_BUILD_TYPE}")
## C++ version and flags
# C11 is needed for aligned_alloc
if (NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()
message(STATUS "C Standard is set to ${CMAKE_C_STANDARD}")
# C++14 is needed for gtest, otherwise, C++11 is sufficient for the library
if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
message(STATUS "C++ Standard is set to ${CMAKE_CXX_STANDARD}")
if (MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" AND NOT MSVC)
add_compile_options(
-fexceptions
-Wall
-Wextra
-Wconversion
-Wunused-parameter
)
endif()
if (EMSCRIPTEN)
add_compile_options(-fexceptions)
if(OJPH_ENABLE_WASM_SIMD)
add_compile_options(-DOJPH_ENABLE_WASM_SIMD -msimd128)
endif()
endif()
## Enhanced instruction options
if (OJPH_DISABLE_SIMD)
add_compile_definitions(OJPH_DISABLE_SIMD)
else()
if(OJPH_DISABLE_SSE)
add_compile_definitions(OJPH_DISABLE_SSE)
endif()
if(OJPH_DISABLE_SSE2)
add_compile_definitions(OJPH_DISABLE_SSE2)
endif()
if(OJPH_DISABLE_SSSE3)
add_compile_definitions(OJPH_DISABLE_SSSE3)
endif()
if(OJPH_DISABLE_SSE4)
add_compile_definitions(OJPH_DISABLE_SSE4)
endif()
if(OJPH_DISABLE_AVX)
add_compile_definitions(OJPH_DISABLE_AVX)
endif()
if(OJPH_DISABLE_AVX2)
add_compile_definitions(OJPH_DISABLE_AVX2)
endif()
if(OJPH_DISABLE_AVX512)
add_compile_definitions(OJPH_DISABLE_AVX512)
endif()
if(OJPH_DISABLE_NEON)
add_compile_definitions(OJPH_DISABLE_NEON)
endif()
endif()
## Build library and applications
include(GNUInstallDirs)
add_subdirectory(src/core)
if (OJPH_BUILD_EXECUTABLES)
add_subdirectory(src/apps)
endif()
################################################################################################
# Install
################################################################################################
if (OJPH_INSTALL)
install(EXPORT openjph-targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
)
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/src/openjph-config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/openjph-config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
COMPATIBILITY SameMinorVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openjph-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
)
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
set(PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
else()
set(PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/openjph.pc.in"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
@ONLY
)
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
endif()
################################################################################################
# Testing (OJPH_BUILD_TESTS)
################################################################################################
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND OJPH_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
+27
View File
@@ -0,0 +1,27 @@
BSD 2-Clause License
Copyright (c) 2019, Aous Naman
Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
Copyright (c) 2019, The University of New South Wales, Sydney, Australia
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.
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.
+24
View File
@@ -0,0 +1,24 @@
[![Join the chat at https://gitter.im/OpenJPH](https://badges.gitter.im/OpenJPH.svg)](https://gitter.im/OpenJPH?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Readme #
Open source implementation of High-throughput JPEG2000 (HTJ2K), also known as JPH, JPEG2000 Part 15, ISO/IEC 15444-15, and ITU-T T.814. Here, we are interested in implementing the HTJ2K only, supporting features that are defined in JPEG2000 Part 1 (for example, for wavelet transform, only reversible 5/3 and irreversible 9/7 are supported).
The interested reader is referred to the [short HTJ2K white paper](http://ds.jpeg.org/whitepapers/jpeg-htj2k-whitepaper.pdf), or the [extended HTJ2K white paper](https://htj2k.com/wp-content/uploads/white-paper.pdf) for more details on HTJ2K. [This](https://kakadusoftware.com/wp-content/uploads/icip2019.pdf) paper explores the attainable performance on CPU, while [this](https://kakadusoftware.com/wp-content/uploads/ICIP2019_GPU.pdf) and [this](http://hdl.handle.net/1959.4/unsworks_75139) explores performance on the GPU.
# The standard #
The standard is available free of charge from [ITU website](https://www.itu.int/rec/T-REC-T.814/en). It can also be purchased from the [ISO website](https://www.iso.org/standard/76621.html).
# Table of Contents #
* [Status](/docs/status.md)
* [Compiling](./docs/compiling.md)
* [Compiling and Running in Docker](./docs/docker.md)
* [Usage Example](./docs/usage_examples.md)
* [Web-based Demos](./docs/web_demos.md)
* [Doxygen Documentation Style](./docs/doxygen_style.md)
# Repositories #
[![Packaging status](https://repology.org/badge/vertical-allrepos/openjph.svg)](https://repology.org/project/openjph/versions)
+29
View File
@@ -0,0 +1,29 @@
################################################################################################
# Generating ojph library version number
################################################################################################
############################################################
# Parse version file
# credit: https://stackoverflow.com/a/47084079
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/core/openjph/ojph_version.h" VERFILE)
if (NOT VERFILE)
message(FATAL_ERROR "Failed to parse ojph_version.h!")
endif()
string(REGEX MATCH "OPENJPH_VERSION_MAJOR ([0-9]*)" _ ${VERFILE})
set(OPENJPH_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "OPENJPH_VERSION_MINOR ([0-9]*)" _ ${VERFILE})
set(OPENJPH_VERSION_MINOR ${CMAKE_MATCH_1})
string(REGEX MATCH "OPENJPH_VERSION_PATCH ([0-9]*)" _ ${VERFILE})
set(OPENJPH_VERSION_PATCH ${CMAKE_MATCH_1})
set(OPENJPH_VERSION "${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}.${OPENJPH_VERSION_PATCH}")
############################################################
message(STATUS "OpenJPH library version: ${OPENJPH_VERSION}")
if (OPENJPH_VERSION)
else()
message(FATAL_ERROR "OPENJPH_VERSION is not set")
endif()
+185
View File
@@ -0,0 +1,185 @@
file(GLOB CODESTREAM "codestream/*.cpp" "codestream/*.h")
file(GLOB CODESTREAM_SSE "codestream/*_sse.cpp")
file(GLOB CODESTREAM_SSE2 "codestream/*_sse2.cpp")
file(GLOB CODESTREAM_AVX "codestream/*_avx.cpp")
file(GLOB CODESTREAM_AVX2 "codestream/*_avx2.cpp")
file(GLOB CODESTREAM_WASM "codestream/*_wasm.cpp")
file(GLOB CODING "coding/*.cpp" "coding/*.h")
file(GLOB CODING_SSSE3 "coding/*_ssse3.cpp")
file(GLOB CODING_WASM "coding/*_wasm.cpp")
file(GLOB CODING_AVX2 "coding/*_avx2.cpp")
file(GLOB CODING_AVX512 "coding/*_avx512.cpp")
file(GLOB COMMON "openjph/*.h")
file(GLOB OTHERS "others/*.cpp" "others/*.c")
file(GLOB TRANSFORM "transform/*.cpp" "transform/*.h")
file(GLOB TRANSFORM_SSE "transform/*_sse.cpp")
file(GLOB TRANSFORM_SSE2 "transform/*_sse2.cpp")
file(GLOB TRANSFORM_AVX "transform/*_avx.cpp")
file(GLOB TRANSFORM_AVX2 "transform/*_avx2.cpp")
file(GLOB TRANSFORM_AVX512 "transform/*_avx512.cpp")
file(GLOB TRANSFORM_WASM "transform/*_wasm.cpp")
list(REMOVE_ITEM CODESTREAM ${CODESTREAM_SSE} ${CODESTREAM_SSE2} ${CODESTREAM_AVX} ${CODESTREAM_AVX2} ${CODESTREAM_WASM})
list(REMOVE_ITEM CODING ${CODING_SSSE3} ${CODING_WASM} ${CODING_AVX2} ${CODING_AVX512})
list(REMOVE_ITEM TRANSFORM ${TRANSFORM_SSE} ${TRANSFORM_SSE2} ${TRANSFORM_AVX} ${TRANSFORM_AVX2} ${TRANSFORM_AVX512} ${TRANSFORM_WASM})
list(APPEND SOURCES ${CODESTREAM} ${CODING} ${COMMON} ${OTHERS} ${TRANSFORM})
source_group("codestream" FILES ${CODESTREAM})
source_group("coding" FILES ${CODING})
source_group("common" FILES ${COMMON})
source_group("others" FILES ${OTHERS})
source_group("transform" FILES ${TRANSFORM})
if(EMSCRIPTEN)
if (OJPH_ENABLE_WASM_SIMD)
list(APPEND SOURCES ${CODESTREAM_WASM} ${CODING_WASM} ${TRANSFORM_WASM})
source_group("codestream" FILES ${CODESTREAM_WASM})
source_group("coding" FILES ${CODING_WASM})
source_group("transform" FILES ${TRANSFORM_WASM})
endif()
else()
if (NOT OJPH_DISABLE_SIMD)
if (("${OJPH_TARGET_ARCH}" MATCHES "OJPH_ARCH_X86_64")
OR ("${OJPH_TARGET_ARCH}" MATCHES "OJPH_ARCH_I386")
OR MULTI_GEN_X86_64)
if (NOT OJPH_DISABLE_SSE)
list(APPEND SOURCES ${CODESTREAM_SSE} ${TRANSFORM_SSE})
source_group("codestream" FILES ${CODESTREAM_SSE})
source_group("transform" FILES ${TRANSFORM_SSE})
endif()
if (NOT OJPH_DISABLE_SSE2)
list(APPEND SOURCES ${CODESTREAM_SSE2} ${TRANSFORM_SSE2})
source_group("codestream" FILES ${CODESTREAM_SSE2})
source_group("transform" FILES ${TRANSFORM_SSE2})
endif()
if (NOT OJPH_DISABLE_SSSE3)
list(APPEND SOURCES ${CODING_SSSE3})
source_group("coding" FILES ${CODING_SSSE3})
endif()
if (NOT OJPH_DISABLE_AVX)
list(APPEND SOURCES ${CODESTREAM_AVX} ${TRANSFORM_AVX})
source_group("codestream" FILES ${CODESTREAM_AVX})
source_group("transform" FILES ${TRANSFORM_AVX})
endif()
if (NOT OJPH_DISABLE_AVX2)
list(APPEND SOURCES ${CODESTREAM_AVX2} ${TRANSFORM_AVX2} ${CODING_AVX2})
source_group("codestream" FILES ${CODESTREAM_AVX2})
source_group("transform" FILES ${TRANSFORM_AVX2})
source_group("coding" FILES ${CODING_AVX2})
endif()
if (NOT OJPH_DISABLE_AVX512)
list(APPEND SOURCES ${CODING_AVX512} ${TRANSFORM_AVX512})
source_group("coding" FILES ${CODING_AVX512})
source_group("transform" FILES ${TRANSFORM_AVX512})
endif()
# Set compilation flags
if (MSVC)
set_source_files_properties(codestream/ojph_codestream_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
set_source_files_properties(codestream/ojph_codestream_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(coding/ojph_block_decoder_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(coding/ojph_block_encoder_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(coding/ojph_block_encoder_avx512.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX512")
set_source_files_properties(transform/ojph_colour_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
set_source_files_properties(transform/ojph_colour_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(transform/ojph_transform_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
set_source_files_properties(transform/ojph_transform_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(transform/ojph_transform_avx512.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX512")
else()
set_source_files_properties(codestream/ojph_codestream_sse.cpp PROPERTIES COMPILE_FLAGS -msse)
set_source_files_properties(codestream/ojph_codestream_sse2.cpp PROPERTIES COMPILE_FLAGS -msse2)
set_source_files_properties(codestream/ojph_codestream_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
set_source_files_properties(codestream/ojph_codestream_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(coding/ojph_block_decoder_ssse3.cpp PROPERTIES COMPILE_FLAGS -mssse3)
set_source_files_properties(coding/ojph_block_decoder_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(coding/ojph_block_encoder_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(coding/ojph_block_encoder_avx512.cpp PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512cd")
set_source_files_properties(transform/ojph_colour_sse.cpp PROPERTIES COMPILE_FLAGS -msse)
set_source_files_properties(transform/ojph_colour_sse2.cpp PROPERTIES COMPILE_FLAGS -msse2)
set_source_files_properties(transform/ojph_colour_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
set_source_files_properties(transform/ojph_colour_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(transform/ojph_transform_sse.cpp PROPERTIES COMPILE_FLAGS -msse)
set_source_files_properties(transform/ojph_transform_sse2.cpp PROPERTIES COMPILE_FLAGS -msse2)
set_source_files_properties(transform/ojph_transform_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
set_source_files_properties(transform/ojph_transform_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(transform/ojph_transform_avx512.cpp PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512cd")
endif()
endif()
if (("${OJPH_TARGET_ARCH}" MATCHES "OJPH_ARCH_ARM") OR MULTI_GEN_ARM64)
endif()
endif()
endif()
## Set debug postfix for different platforms
if (MSVC)
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "_d")
endif()
endif()
if (NOT DEFINED OJPH_LIB_TYPE)
set(OJPH_LIB_TYPE STATIC)
endif()
add_library(openjph ${OJPH_LIB_TYPE} ${SOURCES})
## The option BUILD_SHARED_LIBS
if (BUILD_SHARED_LIBS AND WIN32)
target_compile_definitions(openjph PRIVATE OJPH_BUILD_SHARED_LIBRARY)
endif()
## include library version/name
set_target_properties(openjph PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(openjph PUBLIC _FILE_OFFSET_BITS=64)
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/openjph> $<INSTALL_INTERFACE:include>)
## This is to check if aligned_alloc or posix_memalign is available
# We want the code to compile for C11 and C++11.
# std::aligned_alloc is only availabe in C++17.
# So here we try to see which API is available and adapt the code to use it
if (NOT MSVC)
include(CheckSymbolExists)
check_symbol_exists(aligned_alloc "stdlib.h" OJPH_ALIGNED_ALLOC_EXISTS)
if (OJPH_ALIGNED_ALLOC_EXISTS)
target_compile_definitions(openjph PRIVATE OJPH_ALIGNED_ALLOC_EXISTS)
else()
check_symbol_exists(posix_memalign "stdlib.h" OJPH_POSIX_MEMALIGN_EXISTS)
if (OJPH_POSIX_MEMALIGN_EXISTS)
target_compile_definitions(openjph PRIVATE OJPH_POSIX_MEMALIGN_EXISTS)
endif()
endif()
endif()
if (MSVC)
set(OJPH_LIB_NAME_STRING "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
set_target_properties(openjph
PROPERTIES
OUTPUT_NAME "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
else()
set(OJPH_LIB_NAME_STRING "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
set_target_properties(openjph
PROPERTIES
SOVERSION "${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}"
VERSION "${OPENJPH_VERSION}")
endif()
if (OJPH_INSTALL)
install(TARGETS openjph
EXPORT openjph-targets
)
install(DIRECTORY openjph/
DESTINATION include/openjph
FILES_MATCHING
PATTERN "*.h"
)
endif()
@@ -0,0 +1,226 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_bitbuffer_read.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_BITBUFFER_READ_H
#define OJPH_BITBUFFER_READ_H
#include "ojph_defs.h"
#include "ojph_file.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class mem_elastic_allocator;
struct coded_lists;
namespace local {
//////////////////////////////////////////////////////////////////////////
struct bit_read_buf
{
infile_base *file;
ui32 tmp;
int avail_bits;
bool unstuff;
ui32 bytes_left;
};
//////////////////////////////////////////////////////////////////////////
static inline
void bb_init(bit_read_buf *bbp, ui32 bytes_left, infile_base* file)
{
bbp->avail_bits = 0;
bbp->file = file;
bbp->bytes_left = bytes_left;
bbp->tmp = 0;
bbp->unstuff = false;
}
/////////////////////////////////////////////////////////////////////////////
static inline
bool bb_read(bit_read_buf *bbp)
{
if (bbp->bytes_left > 0)
{
ui32 t = 0;
if (bbp->file->read(&t, 1) != 1)
throw "error reading from file";
bbp->tmp = t;
bbp->avail_bits = 8 - bbp->unstuff;
bbp->unstuff = (t == 0xFF);
--bbp->bytes_left;
return true;
}
else
{
bbp->tmp = 0;
bbp->avail_bits = 8 - bbp->unstuff;
bbp->unstuff = false;
return false;
}
}
//////////////////////////////////////////////////////////////////////////
static inline
bool bb_read_bit(bit_read_buf *bbp, ui32& bit)
{
bool result = true;
if (bbp->avail_bits == 0)
result = bb_read(bbp);
bit = (bbp->tmp >> --bbp->avail_bits) & 1;
return result;
}
//////////////////////////////////////////////////////////////////////////
static inline
bool bb_read_bits(bit_read_buf *bbp, int num_bits, ui32& bits)
{
assert(num_bits <= 32);
bits = 0;
bool result = true;
while (num_bits) {
if (bbp->avail_bits == 0)
result = bb_read(bbp);
int tx_bits = ojph_min(bbp->avail_bits, num_bits);
bits <<= tx_bits;
bbp->avail_bits -= tx_bits;
num_bits -= tx_bits;
bits |= (bbp->tmp >> bbp->avail_bits) & ((1 << tx_bits) - 1);
}
return result;
}
//////////////////////////////////////////////////////////////////////////
static inline
bool bb_read_chunk(bit_read_buf *bbp, ui32 num_bytes,
coded_lists*& cur_coded_list,
mem_elastic_allocator *elastic)
{
assert(bbp->avail_bits == 0 && bbp->unstuff == false);
elastic->get_buffer(num_bytes + coded_cb_header::prefix_buf_size
+ coded_cb_header::suffix_buf_size, cur_coded_list);
ui32 bytes = ojph_min(num_bytes, bbp->bytes_left);
ui32 bytes_read = (ui32)bbp->file->read(
cur_coded_list->buf + coded_cb_header::prefix_buf_size, bytes);
if (num_bytes > bytes_read)
memset(
cur_coded_list->buf + coded_cb_header::prefix_buf_size + bytes_read,
0, num_bytes - bytes_read);
bbp->bytes_left -= bytes_read;
return bytes_read == bytes;
}
//////////////////////////////////////////////////////////////////////////
static inline
void bb_skip_eph(bit_read_buf *bbp)
{
if (bbp->bytes_left >= 2)
{
ui8 marker[2];
if (bbp->file->read(marker, 2) != 2)
throw "error reading from file";
bbp->bytes_left -= 2;
if ((int)marker[0] != (EPH >> 8) || (int)marker[1] != (EPH & 0xFF))
throw "should find EPH, but found something else";
}
}
//////////////////////////////////////////////////////////////////////////
static inline
bool bb_terminate(bit_read_buf *bbp, bool uses_eph)
{
bool result = true;
if (bbp->unstuff)
result = bb_read(bbp);
assert(bbp->unstuff == false);
if (uses_eph)
bb_skip_eph(bbp);
bbp->tmp = 0;
bbp->avail_bits = 0;
return result;
}
//////////////////////////////////////////////////////////////////////////
static inline
bool bb_skip_sop(bit_read_buf *bbp)
{
if (bbp->bytes_left >= 2)
{
ui8 marker[2];
if (bbp->file->read(marker, 2) != 2)
throw "error reading from file";
if ((int)marker[0] == (SOP >> 8) && (int)marker[1] == (SOP & 0xFF))
{
bbp->bytes_left -= 2;
if (bbp->bytes_left >= 4)
{
ui16 com_len;
if (bbp->file->read(&com_len, 2) != 2)
throw "error reading from file";
com_len = swap_byte(com_len);
if (com_len != 4)
throw "something is wrong with SOP length";
int result =
bbp->file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
if (result != 0)
throw "error seeking file";
bbp->bytes_left -= com_len;
}
else
throw "precinct truncated early";
return true;
}
else
{
//put the bytes back
if (bbp->file->seek(-2, infile_base::OJPH_SEEK_CUR) != 0)
throw "error seeking file";
return false;
}
}
return false;
}
}
}
#endif // !OJPH_BITBUFFER_READ_H
@@ -0,0 +1,147 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_bitbuffer_write.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_BITBUFFER_WRITE_H
#define OJPH_BITBUFFER_WRITE_H
#include "ojph_defs.h"
#include "ojph_file.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class mem_elastic_allocator;
struct coded_lists;
namespace local {
//////////////////////////////////////////////////////////////////////////
struct bit_write_buf
{
static const int needed;
bit_write_buf() { ccl = NULL; avail_bits = 0; tmp = 0; }
coded_lists* ccl;
int avail_bits;
ui64 tmp;
};
//////////////////////////////////////////////////////////////////////////
const int bit_write_buf::needed = 512;
//////////////////////////////////////////////////////////////////////////
static inline
void bb_expand_buf(bit_write_buf *bbp, mem_elastic_allocator *elastic,
coded_lists*& cur_coded_list)
{
assert(cur_coded_list == NULL);
elastic->get_buffer(bit_write_buf::needed, cur_coded_list);
bbp->ccl = cur_coded_list;
bbp->tmp = 0;
}
//////////////////////////////////////////////////////////////////////////
static inline
void bb_init(bit_write_buf *bbp, mem_elastic_allocator *elastic,
coded_lists*& cur_coded_list)
{
bb_expand_buf(bbp, elastic, cur_coded_list);
bbp->avail_bits = 8;
}
//////////////////////////////////////////////////////////////////////////
static inline
void bb_put_bit(bit_write_buf *bbp, ui32 bit,
mem_elastic_allocator *elastic,
coded_lists*& cur_coded_list, ui32& ph_bytes)
{
--bbp->avail_bits;
bbp->tmp |= (bit & 1) << bbp->avail_bits;
if (bbp->avail_bits <= 0)
{
bbp->avail_bits = 8 - (bbp->tmp != 0xFF ? 0 : 1);
bbp->ccl->buf[bbp->ccl->buf_size - bbp->ccl->avail_size] =
(ui8)(bbp->tmp & 0xFF);
bbp->tmp = 0;
--bbp->ccl->avail_size;
if (bbp->ccl->avail_size == 0)
{
bb_expand_buf(bbp, elastic, cur_coded_list->next_list);
cur_coded_list = cur_coded_list->next_list;
ph_bytes += bit_write_buf::needed;
}
}
}
//////////////////////////////////////////////////////////////////////////
static inline
void bb_put_zeros(bit_write_buf *bbp, int num_zeros,
mem_elastic_allocator *elastic,
coded_lists*& cur_coded_list, ui32& ph_bytes)
{
for (int i = num_zeros; i > 0; --i)
bb_put_bit(bbp, 0, elastic, cur_coded_list, ph_bytes);
}
//////////////////////////////////////////////////////////////////////////
static inline
void bb_put_bits(bit_write_buf *bbp, ui32 data, int num_bits,
mem_elastic_allocator *elastic,
coded_lists*& cur_coded_list, ui32& ph_bytes)
{
assert(num_bits <= 32);
for (int i = num_bits - 1; i >= 0; --i)
bb_put_bit(bbp, data >> i, elastic, cur_coded_list, ph_bytes);
}
//////////////////////////////////////////////////////////////////////////
static inline
void bb_terminate(bit_write_buf *bbp)
{
if (bbp->avail_bits < 8) //bits have been written
{
ui8 val = (ui8)(bbp->tmp & 0xFF);
bbp->ccl->buf[bbp->ccl->buf_size - bbp->ccl->avail_size] = val;
--bbp->ccl->avail_size;
}
}
}
}
#endif // !OJPH_BITBUFFER_WRITE_H
+264
View File
@@ -0,0 +1,264 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codeblock.cpp
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#include <climits>
#include <cmath>
#include "ojph_mem.h"
#include "ojph_params.h"
#include "ojph_codestream_local.h"
#include "ojph_codeblock.h"
#include "ojph_subband.h"
#include "ojph_resolution.h"
namespace ojph {
namespace local
{
//////////////////////////////////////////////////////////////////////////
void codeblock::pre_alloc(codestream *codestream, const size& nominal,
ui32 precision)
{
mem_fixed_allocator* allocator = codestream->get_allocator();
assert(byte_alignment / sizeof(ui32) > 1);
const ui32 f = byte_alignment / sizeof(ui32) - 1;
ui32 stride = (nominal.w + f) & ~f; // a multiple of 8
if (precision <= 32)
allocator->pre_alloc_data<ui32>(nominal.h * (size_t)stride, 0);
else
allocator->pre_alloc_data<ui64>(nominal.h * (size_t)stride, 0);
}
//////////////////////////////////////////////////////////////////////////
void codeblock::finalize_alloc(codestream *codestream,
subband *parent, const size& nominal,
const size& cb_size,
coded_cb_header* coded_cb,
ui32 K_max, int line_offset,
ui32 precision, ui32 comp_idx)
{
mem_fixed_allocator* allocator = codestream->get_allocator();
const ui32 f = byte_alignment / sizeof(ui32) - 1;
this->stride = (nominal.w + f) & ~f; // a multiple of 8
this->buf_size = this->stride * nominal.h;
if (precision <= 32) {
this->precision = BUF32;
this->buf32 = allocator->post_alloc_data<ui32>(this->buf_size, 0);
}
else {
this->precision = BUF64;
this->buf64 = allocator->post_alloc_data<ui64>(this->buf_size, 0);
}
this->nominal_size = nominal;
this->cb_size = cb_size;
this->parent = parent;
this->line_offset = line_offset;
this->cur_line = 0;
this->delta = parent->get_delta();
this->delta_inv = 1.0f / this->delta;
this->K_max = K_max;
for (int i = 0; i < 4; ++i)
this->max_val64[i] = 0;
const param_cod* coc = codestream->get_coc(comp_idx);
this->reversible = coc->is_reversible();
this->resilient = codestream->is_resilient();
this->stripe_causal = coc->get_block_vertical_causality();
this->zero_block = false;
this->coded_cb = coded_cb;
this->codeblock_functions.init(reversible);
}
//////////////////////////////////////////////////////////////////////////
void codeblock::push(line_buf *line)
{
// convert to sign and magnitude and keep max_val
if (precision == BUF32)
{
assert(line->flags & line_buf::LFT_32BIT);
const si32 *sp = line->i32 + line_offset;
ui32 *dp = buf32 + cur_line * stride;
this->codeblock_functions.tx_to_cb32(sp, dp, K_max, delta_inv,
cb_size.w, max_val32);
++cur_line;
}
else
{
assert(precision == BUF64);
assert(line->flags & line_buf::LFT_64BIT);
const si64 *sp = line->i64 + line_offset;
ui64 *dp = buf64 + cur_line * stride;
this->codeblock_functions.tx_to_cb64(sp, dp, K_max, delta_inv,
cb_size.w, max_val64);
++cur_line;
}
}
//////////////////////////////////////////////////////////////////////////
void codeblock::encode(mem_elastic_allocator *elastic)
{
if (precision == BUF32)
{
ui32 mv = this->codeblock_functions.find_max_val32(max_val32);
if (mv >= 1u << (31 - K_max))
{
coded_cb->missing_msbs = K_max - 1;
assert(coded_cb->missing_msbs > 0);
assert(coded_cb->missing_msbs < K_max);
coded_cb->num_passes = 1;
this->codeblock_functions.encode_cb32(buf32, K_max-1, 1,
cb_size.w, cb_size.h, stride, coded_cb->pass_length,
elastic, coded_cb->next_coded);
}
}
else
{
assert(precision == BUF64);
ui64 mv = this->codeblock_functions.find_max_val64(max_val64);
if (mv >= 1ULL << (63 - K_max))
{
coded_cb->missing_msbs = K_max - 1;
assert(coded_cb->missing_msbs > 0);
assert(coded_cb->missing_msbs < K_max);
coded_cb->num_passes = 1;
this->codeblock_functions.encode_cb64(buf64, K_max-1, 1,
cb_size.w, cb_size.h, stride, coded_cb->pass_length,
elastic, coded_cb->next_coded);
}
}
}
//////////////////////////////////////////////////////////////////////////
void codeblock::recreate(const size &cb_size, coded_cb_header* coded_cb)
{
assert(cb_size.h * stride <= buf_size && cb_size.w <= stride);
this->cb_size = cb_size;
this->coded_cb = coded_cb;
this->cur_line = 0;
for (int i = 0; i < 4; ++i)
this->max_val64[i] = 0;
this->zero_block = false;
}
//////////////////////////////////////////////////////////////////////////
void codeblock::decode()
{
if (coded_cb->pass_length[0] > 0 && coded_cb->num_passes > 0 &&
coded_cb->next_coded != NULL)
{
bool result;
if (precision == BUF32)
{
result = this->codeblock_functions.decode_cb32(
coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
buf32, coded_cb->missing_msbs, coded_cb->num_passes,
coded_cb->pass_length[0], coded_cb->pass_length[1],
cb_size.w, cb_size.h, stride, stripe_causal);
}
else
{
assert(precision == BUF64);
result = this->codeblock_functions.decode_cb64(
coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
buf64, coded_cb->missing_msbs, coded_cb->num_passes,
coded_cb->pass_length[0], coded_cb->pass_length[1],
cb_size.w, cb_size.h, stride, stripe_causal);
}
if (result == false)
{
if (resilient == true) {
OJPH_INFO(0x000300A1, "Error decoding a codeblock.");
zero_block = true;
}
else
OJPH_ERROR(0x000300A1, "Error decoding a codeblock.");
}
}
else
zero_block = true;
}
//////////////////////////////////////////////////////////////////////////
void codeblock::pull_line(line_buf *line)
{
//convert to sign and magnitude
if (precision == BUF32)
{
assert(line->flags & line_buf::LFT_32BIT);
si32 *dp = line->i32 + line_offset;
if (!zero_block)
{
const ui32 *sp = buf32 + cur_line * stride;
this->codeblock_functions.tx_from_cb32(sp, dp, K_max, delta,
cb_size.w);
}
else
this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(ui32));
}
else
{
assert(precision == BUF64);
assert(line->flags & line_buf::LFT_64BIT);
si64 *dp = line->i64 + line_offset;
if (!zero_block)
{
const ui64 *sp = buf64 + cur_line * stride;
this->codeblock_functions.tx_from_cb64(sp, dp, K_max, delta,
cb_size.w);
}
else
this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(*dp));
}
++cur_line;
assert(cur_line <= cb_size.h);
}
}
}
+130
View File
@@ -0,0 +1,130 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codeblock.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_CODEBLOCK_H
#define OJPH_CODEBLOCK_H
#include "ojph_defs.h"
#include "ojph_file.h"
#include "ojph_codeblock_fun.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class line_buf;
class mem_elastic_allocator;
class codestream;
struct coded_lists;
namespace local {
//////////////////////////////////////////////////////////////////////////
//defined here
struct precinct;
class subband;
struct coded_cb_header;
//////////////////////////////////////////////////////////////////////////
class codeblock
{
friend struct precinct;
enum : ui32 {
BUF32 = 4,
BUF64 = 8,
};
public:
static void pre_alloc(codestream *codestream, const size& nominal,
ui32 precision);
void finalize_alloc(codestream *codestream, subband* parent,
const size& nominal, const size& cb_size,
coded_cb_header* coded_cb, ui32 K_max,
int tbx0, ui32 precision, ui32 comp_idx);
void push(line_buf *line);
void encode(mem_elastic_allocator *elastic);
void recreate(const size& cb_size, coded_cb_header* coded_cb);
void decode();
void pull_line(line_buf *line);
private:
ui32 precision;
union {
ui32* buf32;
ui64* buf64;
};
size nominal_size;
size cb_size;
ui32 stride;
ui32 buf_size;
subband* parent;
int line_offset;
ui32 cur_line;
float delta, delta_inv;
ui32 K_max;
bool reversible;
bool resilient;
bool stripe_causal;
bool zero_block; // true when the decoded block is all zero
union {
ui32 max_val32[8]; // supports up to 256 bits
ui64 max_val64[4]; // supports up to 256 bits
};
coded_cb_header* coded_cb;
codeblock_fun codeblock_functions;
};
//////////////////////////////////////////////////////////////////////////
struct coded_cb_header
{
ui32 pass_length[2];
ui32 num_passes; // number of passes to be decoded
ui32 Kmax;
ui32 missing_msbs;
coded_lists *next_coded;
static const int prefix_buf_size = 8;
static const int suffix_buf_size = 16;
};
}
}
#endif // !OJPH_CODEBLOCK_H
@@ -0,0 +1,286 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codeblock_fun.cpp
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#include <climits>
#include <cmath>
#include "ojph_file.h"
#include "ojph_mem.h"
#include "ojph_params.h"
#include "ojph_codestream.h"
#include "ojph_codestream_local.h"
#include "ojph_codeblock_fun.h"
#include "../transform/ojph_colour.h"
#include "../transform/ojph_transform.h"
#include "../coding/ojph_block_decoder.h"
#include "../coding/ojph_block_encoder.h"
namespace ojph {
namespace local
{
//////////////////////////////////////////////////////////////////////////
void gen_mem_clear(void* addr, size_t count);
void sse_mem_clear(void* addr, size_t count);
void avx_mem_clear(void* addr, size_t count);
void wasm_mem_clear(void* addr, size_t count);
//////////////////////////////////////////////////////////////////////////
ui32 gen_find_max_val32(ui32* address);
ui32 sse2_find_max_val32(ui32* address);
ui32 avx2_find_max_val32(ui32* address);
ui32 wasm_find_max_val32(ui32* address);
ui64 gen_find_max_val64(ui64* address);
ui64 sse2_find_max_val64(ui64* address);
ui64 avx2_find_max_val64(ui64* address);
ui64 wasm_find_max_val64(ui64* address);
//////////////////////////////////////////////////////////////////////////
void gen_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void sse2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void avx2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void gen_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void sse2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void avx2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void wasm_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void wasm_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
void gen_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val);
void sse2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val);
void avx2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val);
void wasm_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val);
//////////////////////////////////////////////////////////////////////////
void gen_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void sse2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void avx2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void gen_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void sse2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void avx2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void wasm_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void wasm_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void gen_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void sse2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void avx2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void wasm_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
void codeblock_fun::init(bool reversible) {
#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
// Default path, no acceleration. We may change this later
decode_cb32 = ojph_decode_codeblock32;
find_max_val32 = gen_find_max_val32;
mem_clear = gen_mem_clear;
if (reversible) {
tx_to_cb32 = gen_rev_tx_to_cb32;
tx_from_cb32 = gen_rev_tx_from_cb32;
}
else
{
tx_to_cb32 = gen_irv_tx_to_cb32;
tx_from_cb32 = gen_irv_tx_from_cb32;
}
encode_cb32 = ojph_encode_codeblock32;
decode_cb64 = ojph_decode_codeblock64;
find_max_val64 = gen_find_max_val64;
if (reversible) {
tx_to_cb64 = gen_rev_tx_to_cb64;
tx_from_cb64 = gen_rev_tx_from_cb64;
}
else
{
tx_to_cb64 = NULL;
tx_from_cb64 = NULL;
}
encode_cb64 = ojph_encode_codeblock64;
bool result = initialize_block_encoder_tables();
assert(result); ojph_unused(result);
#ifndef OJPH_DISABLE_SIMD
#if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
// Accelerated functions for INTEL/AMD CPUs
#ifndef OJPH_DISABLE_SSE
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
mem_clear = sse_mem_clear;
#endif // !OJPH_DISABLE_SSE
#ifndef OJPH_DISABLE_SSE2
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2) {
find_max_val32 = sse2_find_max_val32;
if (reversible) {
tx_to_cb32 = sse2_rev_tx_to_cb32;
tx_from_cb32 = sse2_rev_tx_from_cb32;
}
else {
tx_to_cb32 = sse2_irv_tx_to_cb32;
tx_from_cb32 = sse2_irv_tx_from_cb32;
}
find_max_val64 = sse2_find_max_val64;
if (reversible) {
tx_to_cb64 = sse2_rev_tx_to_cb64;
tx_from_cb64 = sse2_rev_tx_from_cb64;
}
else
{
tx_to_cb64 = NULL;
tx_from_cb64 = NULL;
}
}
#endif // !OJPH_DISABLE_SSE2
#ifndef OJPH_DISABLE_SSSE3
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSSE3)
decode_cb32 = ojph_decode_codeblock_ssse3;
#endif // !OJPH_DISABLE_SSSE3
#ifndef OJPH_DISABLE_AVX
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
mem_clear = avx_mem_clear;
#endif // !OJPH_DISABLE_AVX
#ifndef OJPH_DISABLE_AVX2
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2) {
decode_cb32 = ojph_decode_codeblock_avx2;
find_max_val32 = avx2_find_max_val32;
if (reversible) {
tx_to_cb32 = avx2_rev_tx_to_cb32;
tx_from_cb32 = avx2_rev_tx_from_cb32;
}
else {
tx_to_cb32 = avx2_irv_tx_to_cb32;
tx_from_cb32 = avx2_irv_tx_from_cb32;
}
encode_cb32 = ojph_encode_codeblock_avx2;
bool result = initialize_block_encoder_tables_avx2();
assert(result); ojph_unused(result);
find_max_val64 = avx2_find_max_val64;
if (reversible) {
tx_to_cb64 = avx2_rev_tx_to_cb64;
tx_from_cb64 = avx2_rev_tx_from_cb64;
}
else
{
tx_to_cb64 = NULL;
tx_from_cb64 = NULL;
}
}
#endif // !OJPH_DISABLE_AVX2
#if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512) {
encode_cb32 = ojph_encode_codeblock_avx512;
bool result = initialize_block_encoder_tables_avx512();
assert(result); ojph_unused(result);
}
#endif // !OJPH_DISABLE_AVX512
#elif defined(OJPH_ARCH_ARM)
#endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
#endif // !OJPH_DISABLE_SIMD
#else // OJPH_ENABLE_WASM_SIMD
// Accelerated functions for WASM SIMD.
decode_cb32 = ojph_decode_codeblock_wasm;
find_max_val32 = wasm_find_max_val32;
mem_clear = wasm_mem_clear;
if (reversible) {
tx_to_cb32 = wasm_rev_tx_to_cb32;
tx_from_cb32 = wasm_rev_tx_from_cb32;
}
else {
tx_to_cb32 = wasm_irv_tx_to_cb32;
tx_from_cb32 = wasm_irv_tx_from_cb32;
}
encode_cb32 = ojph_encode_codeblock32;
decode_cb64 = ojph_decode_codeblock64;
find_max_val64 = wasm_find_max_val64;
if (reversible) {
tx_to_cb64 = wasm_rev_tx_to_cb64;
tx_from_cb64 = wasm_rev_tx_from_cb64;
}
else
{
tx_to_cb64 = NULL;
tx_from_cb64 = NULL;
}
encode_cb64 = ojph_encode_codeblock64;
bool result = initialize_block_encoder_tables();
assert(result); ojph_unused(result);
#endif // !OJPH_ENABLE_WASM_SIMD
}
} // local
} // ojph
@@ -0,0 +1,123 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codeblock_fun.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_CODEBLOCK_FUN_H
#define OJPH_CODEBLOCK_FUN_H
#include "ojph_defs.h"
#include "ojph_file.h"
#include "ojph_params_local.h"
namespace ojph {
namespace local {
// define function signature simple memory clearing
typedef void (*mem_clear_fun)(void* addr, size_t count);
// define function signature for max value finding
typedef ui32 (*find_max_val_fun32)(ui32* addr);
typedef ui64 (*find_max_val_fun64)(ui64* addr);
// define line transfer function signature from subbands to codeblocks
typedef void (*tx_to_cb_fun32)(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val);
typedef void (*tx_to_cb_fun64)(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val);
// define line transfer function signature from codeblock to subband
typedef void (*tx_from_cb_fun32)(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
typedef void (*tx_from_cb_fun64)(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count);
// define the block decoder function signature
typedef bool (*cb_decoder_fun32)(ui8* coded_data, ui32* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
typedef bool (*cb_decoder_fun64)(ui8* coded_data, ui64* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
// define the block encoder function signature
typedef void (*cb_encoder_fun32)(ui32* buf, ui32 missing_msbs,
ui32 num_passes, ui32 width, ui32 height, ui32 stride,
ui32* lengths, ojph::mem_elastic_allocator* elastic,
ojph::coded_lists*& coded);
typedef void (*cb_encoder_fun64)(ui64* buf, ui32 missing_msbs,
ui32 num_passes, ui32 width, ui32 height, ui32 stride,
ui32* lengths, ojph::mem_elastic_allocator* elastic,
ojph::coded_lists*& coded);
//////////////////////////////////////////////////////////////////////////
struct codeblock_fun {
void init(bool reversible);
// a pointer to the max value finding function
mem_clear_fun mem_clear;
// a pointer to the max value finding function
find_max_val_fun32 find_max_val32;
find_max_val_fun64 find_max_val64;
// a pointer to function transferring samples from subbands to codeblocks
tx_to_cb_fun32 tx_to_cb32;
tx_to_cb_fun64 tx_to_cb64;
// a pointer to function transferring samples from codeblocks to subbands
tx_from_cb_fun32 tx_from_cb32;
tx_from_cb_fun64 tx_from_cb64;
// a pointer to the decoder function
cb_decoder_fun32 decode_cb32;
cb_decoder_fun64 decode_cb64;
// a pointer to the encoder function
cb_encoder_fun32 encode_cb32;
cb_encoder_fun64 encode_cb64;
};
}
}
#endif // !OJPH_CODEBLOCK_FUN_H
+217
View File
@@ -0,0 +1,217 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream.cpp
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#include <climits>
#include <cmath>
#include "ojph_mem.h"
#include "ojph_params.h"
#include "ojph_codestream.h"
#include "ojph_codestream_local.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//
//
//
//
//
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
codestream::~codestream()
{
if (state)
delete state;
state = NULL;
}
////////////////////////////////////////////////////////////////////////////
codestream::codestream()
{
state = new local::codestream;
}
////////////////////////////////////////////////////////////////////////////
void codestream::restart()
{
assert(state != NULL);
state->restart();
}
////////////////////////////////////////////////////////////////////////////
param_siz codestream::access_siz()
{
return param_siz(&state->siz);
}
////////////////////////////////////////////////////////////////////////////
param_cod codestream::access_cod()
{
return param_cod(&state->cod);
}
////////////////////////////////////////////////////////////////////////////
param_qcd codestream::access_qcd()
{
return param_qcd(&state->qcd);
}
////////////////////////////////////////////////////////////////////////////
param_nlt codestream::access_nlt()
{
return param_nlt(&state->nlt);
}
////////////////////////////////////////////////////////////////////////////
void codestream::set_planar(bool planar)
{
state->set_planar(planar ? 1 : 0);
}
////////////////////////////////////////////////////////////////////////////
void codestream::set_profile(const char *s)
{
state->set_profile(s);
}
////////////////////////////////////////////////////////////////////////////
void codestream::set_tilepart_divisions(bool at_resolutions,
bool at_components)
{
ui32 value = 0;
if (at_resolutions)
value |= OJPH_TILEPART_RESOLUTIONS;
if (at_components)
value |= OJPH_TILEPART_COMPONENTS;
state->set_tilepart_divisions(value);
}
////////////////////////////////////////////////////////////////////////////
bool codestream::is_tilepart_division_at_resolutions()
{
ui32 res = state->get_tilepart_div() & OJPH_TILEPART_RESOLUTIONS;
return res ? true : false;
}
////////////////////////////////////////////////////////////////////////////
bool codestream::is_tilepart_division_at_components()
{
ui32 comp = state->get_tilepart_div() & OJPH_TILEPART_COMPONENTS;
return comp ? true : false;
}
////////////////////////////////////////////////////////////////////////////
void codestream::request_tlm_marker(bool needed)
{
state->request_tlm_marker(needed);
}
////////////////////////////////////////////////////////////////////////////
bool codestream::is_tlm_requested()
{
return state->is_tlm_needed();
}
////////////////////////////////////////////////////////////////////////////
bool codestream::is_planar() const
{
return state->is_planar();
}
////////////////////////////////////////////////////////////////////////////
void codestream::write_headers(outfile_base *file,
const comment_exchange* comments,
ui32 num_comments)
{
state->write_headers(file, comments, num_comments);
}
////////////////////////////////////////////////////////////////////////////
void codestream::enable_resilience()
{
state->enable_resilience();
}
////////////////////////////////////////////////////////////////////////////
void codestream::read_headers(infile_base *file)
{
state->read_headers(file);
}
////////////////////////////////////////////////////////////////////////////
void codestream::restrict_input_resolution(ui32 skipped_res_for_read,
ui32 skipped_res_for_recon)
{
state->restrict_input_resolution(skipped_res_for_read,
skipped_res_for_recon);
}
////////////////////////////////////////////////////////////////////////////
void codestream::create()
{
state->read();
}
////////////////////////////////////////////////////////////////////////////
line_buf* codestream::pull(ui32 &comp_num)
{
return state->pull(comp_num);
}
////////////////////////////////////////////////////////////////////////////
void codestream::flush()
{
state->flush();
}
////////////////////////////////////////////////////////////////////////////
void codestream::close()
{
state->close();
}
////////////////////////////////////////////////////////////////////////////
line_buf* codestream::exchange(line_buf* line, ui32& next_component)
{
return state->exchange(line, next_component);
}
}
@@ -0,0 +1,58 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream_avx.cpp
// Author: Aous Naman
// Date: 15 May 2022
//***************************************************************************/
#include "ojph_arch.h"
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
#include <immintrin.h>
#include "ojph_defs.h"
namespace ojph {
namespace local {
//////////////////////////////////////////////////////////////////////////
void avx_mem_clear(void* addr, size_t count)
{
float* p = (float*)addr;
__m256 zero = _mm256_setzero_ps();
for (size_t i = 0; i < count; i += 32, p += 8)
_mm256_storeu_ps(p, zero);
}
}
}
#endif
@@ -0,0 +1,278 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream_avx2.cpp
// Author: Aous Naman
// Date: 15 May 2022
//***************************************************************************/
#include "ojph_arch.h"
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
#include <climits>
#include <immintrin.h>
#include "ojph_defs.h"
#include "ojph_arch.h"
namespace ojph {
namespace local {
//////////////////////////////////////////////////////////////////////////
ui32 avx2_find_max_val32(ui32* address)
{
__m128i x0 = _mm_loadu_si128((__m128i*)address);
__m128i x1 = _mm_loadu_si128((__m128i*)address + 1);
x0 = _mm_or_si128(x0, x1);
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
x0 = _mm_or_si128(x0, x1);
x1 = _mm_shuffle_epi32(x0, 0x55); // x1 = x0[1,1,1,1]
x0 = _mm_or_si128(x0, x1);
ui32 t = (ui32)_mm_extract_epi32(x0, 0);
return t;
}
//////////////////////////////////////////////////////////////////////////
ui64 avx2_find_max_val64(ui64* address)
{
__m128i x0 = _mm_loadu_si128((__m128i*)address);
__m128i x1 = _mm_loadu_si128((__m128i*)address + 1);
x0 = _mm_or_si128(x0, x1);
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
x0 = _mm_or_si128(x0, x1);
ui64 t;
#ifdef OJPH_ARCH_X86_64
t = (ui64)_mm_extract_epi64(x0, 0);
#elif (defined OJPH_ARCH_I386)
t = (ui64)(ui32)_mm_extract_epi32(x0, 0);
t |= (ui64)(ui32)_mm_extract_epi32(x0, 1) << 32;
#else
#error Error unsupport compiler
#endif
return t;
}
//////////////////////////////////////////////////////////////////////////
void avx2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val)
{
ojph_unused(delta_inv);
// convert to sign and magnitude and keep max_val
ui32 shift = 31 - K_max;
__m256i m0 = _mm256_set1_epi32(INT_MIN);
__m256i tmax = _mm256_loadu_si256((__m256i*)max_val);
__m256i *p = (__m256i*)sp;
for ( ; count >= 8; count -= 8, p += 1, dp += 8)
{
__m256i v = _mm256_loadu_si256(p);
__m256i sign = _mm256_and_si256(v, m0);
__m256i val = _mm256_abs_epi32(v);
val = _mm256_slli_epi32(val, (int)shift);
tmax = _mm256_or_si256(tmax, val);
val = _mm256_or_si256(val, sign);
_mm256_storeu_si256((__m256i*)dp, val);
}
if (count)
{
__m256i v = _mm256_loadu_si256(p);
__m256i sign = _mm256_and_si256(v, m0);
__m256i val = _mm256_abs_epi32(v);
val = _mm256_slli_epi32(val, (int)shift);
__m256i c = _mm256_set1_epi32((si32)count);
__m256i idx = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
__m256i mask = _mm256_cmpgt_epi32(c, idx);
c = _mm256_and_si256(val, mask);
tmax = _mm256_or_si256(tmax, c);
val = _mm256_or_si256(val, sign);
_mm256_storeu_si256((__m256i*)dp, val);
}
_mm256_storeu_si256((__m256i*)max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void avx2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val)
{
ojph_unused(K_max);
//quantize and convert to sign and magnitude and keep max_val
__m256 d = _mm256_set1_ps(delta_inv);
__m256i m0 = _mm256_set1_epi32(INT_MIN);
__m256i tmax = _mm256_loadu_si256((__m256i*)max_val);
float *p = (float*)sp;
for ( ; count >= 8; count -= 8, p += 8, dp += 8)
{
__m256 vf = _mm256_loadu_ps(p);
vf = _mm256_mul_ps(vf, d); // multiply
__m256i val = _mm256_cvtps_epi32(vf); // convert to int
__m256i sign = _mm256_and_si256(val, m0); // get sign
val = _mm256_abs_epi32(val);
tmax = _mm256_or_si256(tmax, val);
val = _mm256_or_si256(val, sign);
_mm256_storeu_si256((__m256i*)dp, val);
}
if (count)
{
__m256 vf = _mm256_loadu_ps(p);
vf = _mm256_mul_ps(vf, d); // multiply
__m256i val = _mm256_cvtps_epi32(vf); // convert to int
__m256i sign = _mm256_and_si256(val, m0); // get sign
val = _mm256_abs_epi32(val);
__m256i c = _mm256_set1_epi32((si32)count);
__m256i idx = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
__m256i mask = _mm256_cmpgt_epi32(c, idx);
c = _mm256_and_si256(val, mask);
tmax = _mm256_or_si256(tmax, c);
val = _mm256_or_si256(val, sign);
_mm256_storeu_si256((__m256i*)dp, val);
}
_mm256_storeu_si256((__m256i*)max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void avx2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 31 - K_max;
__m256i m1 = _mm256_set1_epi32(INT_MAX);
si32 *p = (si32*)dp;
for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8)
{
__m256i v = _mm256_load_si256((__m256i*)sp);
__m256i val = _mm256_and_si256(v, m1);
val = _mm256_srli_epi32(val, (int)shift);
val = _mm256_sign_epi32(val, v);
_mm256_storeu_si256((__m256i*)p, val);
}
}
//////////////////////////////////////////////////////////////////////////
void avx2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(K_max);
__m256i m1 = _mm256_set1_epi32(INT_MAX);
__m256 d = _mm256_set1_ps(delta);
float *p = (float*)dp;
for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8)
{
__m256i v = _mm256_load_si256((__m256i*)sp);
__m256i vali = _mm256_and_si256(v, m1);
__m256 valf = _mm256_cvtepi32_ps(vali);
valf = _mm256_mul_ps(valf, d);
__m256i sign = _mm256_andnot_si256(m1, v);
valf = _mm256_or_ps(valf, _mm256_castsi256_ps(sign));
_mm256_storeu_ps(p, valf);
}
}
//////////////////////////////////////////////////////////////////////////
void avx2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val)
{
ojph_unused(delta_inv);
// convert to sign and magnitude and keep max_val
ui32 shift = 63 - K_max;
__m256i m0 = _mm256_set1_epi64x(LLONG_MIN);
__m256i zero = _mm256_setzero_si256();
__m256i one = _mm256_set1_epi64x(1);
__m256i tmax = _mm256_loadu_si256((__m256i*)max_val);
__m256i *p = (__m256i*)sp;
for ( ; count >= 4; count -= 4, p += 1, dp += 4)
{
__m256i v = _mm256_loadu_si256(p);
__m256i sign = _mm256_cmpgt_epi64(zero, v);
__m256i val = _mm256_xor_si256(v, sign); // negate 1's complement
__m256i ones = _mm256_and_si256(sign, one);
val = _mm256_add_epi64(val, ones); // 2's complement
sign = _mm256_and_si256(sign, m0);
val = _mm256_slli_epi64(val, (int)shift);
tmax = _mm256_or_si256(tmax, val);
val = _mm256_or_si256(val, sign);
_mm256_storeu_si256((__m256i*)dp, val);
}
if (count)
{
__m256i v = _mm256_loadu_si256(p);
__m256i sign = _mm256_cmpgt_epi64(zero, v);
__m256i val = _mm256_xor_si256(v, sign); // negate 1's complement
__m256i ones = _mm256_and_si256(sign, one);
val = _mm256_add_epi64(val, ones); // 2's complement
sign = _mm256_and_si256(sign, m0);
val = _mm256_slli_epi64(val, (int)shift);
__m256i c = _mm256_set1_epi64x(count);
__m256i idx = _mm256_set_epi64x(3, 2, 1, 0);
__m256i mask = _mm256_cmpgt_epi64(c, idx);
c = _mm256_and_si256(val, mask);
tmax = _mm256_or_si256(tmax, c);
val = _mm256_or_si256(val, sign);
_mm256_storeu_si256((__m256i*)dp, val);
}
_mm256_storeu_si256((__m256i*)max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void avx2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 63 - K_max;
__m256i m1 = _mm256_set1_epi64x(LLONG_MAX);
__m256i zero = _mm256_setzero_si256();
__m256i one = _mm256_set1_epi64x(1);
si64 *p = (si64*)dp;
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
{
__m256i v = _mm256_load_si256((__m256i*)sp);
__m256i val = _mm256_and_si256(v, m1);
val = _mm256_srli_epi64(val, (int)shift);
__m256i sign = _mm256_cmpgt_epi64(zero, v);
val = _mm256_xor_si256(val, sign); // negate 1's complement
__m256i ones = _mm256_and_si256(sign, one);
val = _mm256_add_epi64(val, ones); // 2's complement
_mm256_storeu_si256((__m256i*)p, val);
}
}
}
}
#endif
@@ -0,0 +1,171 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream_gen.cpp
// Author: Aous Naman
// Date: 15 May 2022
//***************************************************************************/
#include "ojph_defs.h"
#include "ojph_arch.h"
namespace ojph {
namespace local {
//////////////////////////////////////////////////////////////////////////
void gen_mem_clear(void* addr, size_t count)
{
si64* p = (si64*)addr;
for (size_t i = 0; i < count; i += 8)
*p++ = 0;
}
//////////////////////////////////////////////////////////////////////////
ui32 gen_find_max_val32(ui32* addr) { return addr[0]; }
//////////////////////////////////////////////////////////////////////////
ui64 gen_find_max_val64(ui64* addr) { return addr[0]; }
//////////////////////////////////////////////////////////////////////////
void gen_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count,
ui32* max_val)
{
ojph_unused(delta_inv);
ui32 shift = 31 - K_max;
// convert to sign and magnitude and keep max_val
ui32 tmax = *max_val;
si32 *p = (si32*)sp;
for (ui32 i = count; i > 0; --i)
{
si32 v = *p++;
ui32 sign = v >= 0 ? 0U : 0x80000000U;
ui32 val = (ui32)(v >= 0 ? v : -v);
val <<= shift;
*dp++ = sign | val;
tmax |= val; // it is more efficient to use or than max
}
*max_val = tmax;
}
//////////////////////////////////////////////////////////////////////////
void gen_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count,
ui64* max_val)
{
ojph_unused(delta_inv);
ui32 shift = 63 - K_max;
// convert to sign and magnitude and keep max_val
ui64 tmax = *max_val;
si64 *p = (si64*)sp;
for (ui32 i = count; i > 0; --i)
{
si64 v = *p++;
ui64 sign = v >= 0 ? 0ULL : 0x8000000000000000ULL;
ui64 val = (ui64)(v >= 0 ? v : -v);
val <<= shift;
*dp++ = sign | val;
tmax |= val; // it is more efficient to use or than max
}
*max_val = tmax;
}
//////////////////////////////////////////////////////////////////////////
void gen_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count,
ui32* max_val)
{
ojph_unused(K_max);
//quantize and convert to sign and magnitude and keep max_val
ui32 tmax = *max_val;
float *p = (float*)sp;
for (ui32 i = count; i > 0; --i)
{
float v = *p++;
si32 t = ojph_trunc(v * delta_inv);
ui32 sign = t >= 0 ? 0U : 0x80000000U;
ui32 val = (ui32)(t >= 0 ? t : -t);
*dp++ = sign | val;
tmax |= val; // it is more efficient to use or than max
}
*max_val = tmax;
}
//////////////////////////////////////////////////////////////////////////
void gen_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 31 - K_max;
//convert to sign and magnitude
si32 *p = (si32*)dp;
for (ui32 i = count; i > 0; --i)
{
ui32 v = *sp++;
si32 val = (v & 0x7FFFFFFFU) >> shift;
*p++ = (v & 0x80000000U) ? -val : val;
}
}
//////////////////////////////////////////////////////////////////////////
void gen_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 63 - K_max;
//convert to sign and magnitude
si64 *p = (si64*)dp;
for (ui32 i = count; i > 0; --i)
{
ui64 v = *sp++;
si64 val = (v & 0x7FFFFFFFFFFFFFFFULL) >> shift;
*p++ = (v & 0x8000000000000000ULL) ? -val : val;
}
}
//////////////////////////////////////////////////////////////////////////
void gen_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(K_max);
//convert to sign and magnitude
float *p = (float*)dp;
for (ui32 i = count; i > 0; --i)
{
ui32 v = *sp++;
float val = (float)(v & 0x7FFFFFFFU) * delta;
*p++ = (v & 0x80000000U) ? -val : val;
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,178 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream_local.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_CODESTREAM_LOCAL_H
#define OJPH_CODESTREAM_LOCAL_H
#include "ojph_defs.h"
#include "ojph_params_local.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class line_buf;
class mem_fixed_allocator;
class mem_elastic_allocator;
class codestream;
namespace local {
/////////////////////////////////////////////////////////////////////////
static inline
ui16 swap_byte(ui16 t)
{
return (ui16)((t << 8) | (t >> 8));
}
//////////////////////////////////////////////////////////////////////////
//defined elsewhere
class tile;
//////////////////////////////////////////////////////////////////////////
class codestream
{
friend ::ojph::codestream;
public:
codestream();
~codestream();
void restart();
void pre_alloc();
void finalize_alloc();
ojph::param_siz access_siz() // returns externally wrapped siz
{ return ojph::param_siz(&siz); }
const param_siz* get_siz() // returns internal siz
{ return &siz; }
ojph::param_cod access_cod() // returns externally wrapped cod
{ return ojph::param_cod(&cod); }
const param_cod* get_cod() // returns internal cod
{ return &cod; }
const param_cod* get_coc(ui32 comp_num) // returns internal cod
{ return cod.get_coc(comp_num); }
const param_qcd* access_qcd()
{ return &qcd; }
const param_dfs* access_dfs()
{ if (dfs.exists()) return &dfs; else return NULL; }
const param_nlt* get_nlt()
{ return &nlt; }
mem_fixed_allocator* get_allocator() { return allocator; }
mem_elastic_allocator* get_elastic_alloc() { return elastic_alloc; }
outfile_base* get_file() { return outfile; }
line_buf* exchange(line_buf* line, ui32& next_component);
void write_headers(outfile_base *file, const comment_exchange* comments,
ui32 num_comments);
void enable_resilience();
bool is_resilient() { return resilient; }
void read_headers(infile_base *file);
void restrict_input_resolution(ui32 skipped_res_for_data,
ui32 skipped_res_for_recon);
void read();
void set_planar(int planar);
void set_profile(const char *s);
void set_tilepart_divisions(ui32 value);
void request_tlm_marker(bool needed);
line_buf* pull(ui32 &comp_num);
void flush();
void close();
bool is_planar() const { return planar != 0; }
si32 get_profile() const { return profile; };
ui32 get_tilepart_div() const { return tilepart_div; };
bool is_tlm_needed() const { return need_tlm; };
void check_imf_validity();
void check_broadcast_validity();
ui8* get_precinct_scratch() { return precinct_scratch; }
ui32 get_skipped_res_for_recon()
{ return skipped_res_for_recon; }
ui32 get_skipped_res_for_read()
{ return skipped_res_for_read; }
private:
ui32 precinct_scratch_needed_bytes;
ui8* precinct_scratch;
private:
ui32 cur_line;
ui32 cur_comp;
ui32 cur_tile_row;
bool resilient;
ui32 skipped_res_for_read, skipped_res_for_recon;
private:
size num_tiles;
tile *tiles;
line_buf* lines;
ui32 num_comps;
size *comp_size; //stores full resolution no. of lines and width
size *recon_comp_size; //stores number of lines and width of each comp
bool employ_color_transform;
int planar;
int profile;
ui32 tilepart_div; // tilepart division value
bool need_tlm; // true if tlm markers are needed
private:
param_siz siz; // image and tile size
param_cod cod; // coding style default
param_cap cap; // extended capabilities
param_qcd qcd; // quantization default
param_tlm tlm; // tile-part lengths
param_nlt nlt; // non-linearity point transformation
private: // these are from Part 2 of the standard
param_dfs dfs; // downsmapling factor styles
param_atk atk; // wavelet structure and coefficients
private:
mem_fixed_allocator *allocator;
mem_elastic_allocator *elastic_alloc;
outfile_base *outfile;
infile_base *infile;
};
}
}
#endif // !OJPH_CODESTREAM_LOCAL_H
@@ -0,0 +1,58 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream_sse.cpp
// Author: Aous Naman
// Date: 15 May 2022
//***************************************************************************/
#include "ojph_arch.h"
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
#include <immintrin.h>
#include "ojph_defs.h"
namespace ojph {
namespace local {
//////////////////////////////////////////////////////////////////////////
void sse_mem_clear(void* addr, size_t count)
{
float* p = (float*)addr;
__m128 zero = _mm_setzero_ps();
for (size_t i = 0; i < count; i += 16, p += 4)
_mm_storeu_ps(p, zero);
}
}
}
#endif
@@ -0,0 +1,295 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream_sse2.cpp
// Author: Aous Naman
// Date: 15 May 2022
//***************************************************************************/
#include "ojph_arch.h"
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
#include <climits>
#include <immintrin.h>
#include "ojph_defs.h"
namespace ojph {
namespace local {
//////////////////////////////////////////////////////////////////////////
ui32 sse2_find_max_val32(ui32* address)
{
__m128i x1, x0 = _mm_loadu_si128((__m128i*)address);
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
x0 = _mm_or_si128(x0, x1);
x1 = _mm_shuffle_epi32(x0, 0x55); // x1 = x0[1,1,1,1]
x0 = _mm_or_si128(x0, x1);
_mm_storeu_si128((__m128i*)address, x0);
return *address;
// A single movd t, xmm0 can do the trick, but it is not available
// in SSE2 intrinsics. extract_epi32 is available in sse4.1
// ui32 t = (ui32)_mm_extract_epi16(x0, 0);
// t |= (ui32)_mm_extract_epi16(x0, 1) << 16;
// return t;
}
//////////////////////////////////////////////////////////////////////////
ui64 sse2_find_max_val64(ui64* address)
{
__m128i x1, x0 = _mm_loadu_si128((__m128i*)address);
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
x0 = _mm_or_si128(x0, x1);
_mm_storeu_si128((__m128i*)address, x0);
return *address;
// A single movd t, xmm0 can do the trick, but it is not available
// in SSE2 intrinsics. extract_epi32 is available in sse4.1
// ui32 t = (ui32)_mm_extract_epi16(x0, 0);
// t |= (ui32)_mm_extract_epi16(x0, 1) << 16;
// return t;
}
//////////////////////////////////////////////////////////////////////////
void sse2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val)
{
ojph_unused(delta_inv);
// convert to sign and magnitude and keep max_val
ui32 shift = 31 - K_max;
__m128i m0 = _mm_set1_epi32(INT_MIN);
__m128i zero = _mm_setzero_si128();
__m128i one = _mm_set1_epi32(1);
__m128i tmax = _mm_loadu_si128((__m128i*)max_val);
__m128i *p = (__m128i*)sp;
for ( ; count >= 4; count -= 4, p += 1, dp += 4)
{
__m128i v = _mm_loadu_si128(p);
__m128i sign = _mm_cmplt_epi32(v, zero);
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi32(val, ones); // 2's complement
sign = _mm_and_si128(sign, m0);
val = _mm_slli_epi32(val, (int)shift);
tmax = _mm_or_si128(tmax, val);
val = _mm_or_si128(val, sign);
_mm_storeu_si128((__m128i*)dp, val);
}
if (count)
{
__m128i v = _mm_loadu_si128(p);
__m128i sign = _mm_cmplt_epi32(v, zero);
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi32(val, ones); // 2's complement
sign = _mm_and_si128(sign, m0);
val = _mm_slli_epi32(val, (int)shift);
__m128i c = _mm_set1_epi32((si32)count);
__m128i idx = _mm_set_epi32(3, 2, 1, 0);
__m128i mask = _mm_cmpgt_epi32(c, idx);
c = _mm_and_si128(val, mask);
tmax = _mm_or_si128(tmax, c);
val = _mm_or_si128(val, sign);
_mm_storeu_si128((__m128i*)dp, val);
}
_mm_storeu_si128((__m128i*)max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void sse2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val)
{
ojph_unused(K_max);
//quantize and convert to sign and magnitude and keep max_val
__m128 d = _mm_set1_ps(delta_inv);
__m128i zero = _mm_setzero_si128();
__m128i one = _mm_set1_epi32(1);
__m128i tmax = _mm_loadu_si128((__m128i*)max_val);
float *p = (float*)sp;
for ( ; count >= 4; count -= 4, p += 4, dp += 4)
{
__m128 vf = _mm_loadu_ps(p);
vf = _mm_mul_ps(vf, d); // multiply
__m128i val = _mm_cvtps_epi32(vf); // convert to int
__m128i sign = _mm_cmplt_epi32(val, zero); // get sign
val = _mm_xor_si128(val, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi32(val, ones); // 2's complement
tmax = _mm_or_si128(tmax, val);
sign = _mm_slli_epi32(sign, 31);
val = _mm_or_si128(val, sign);
_mm_storeu_si128((__m128i*)dp, val);
}
if (count)
{
__m128 vf = _mm_loadu_ps(p);
vf = _mm_mul_ps(vf, d); // multiply
__m128i val = _mm_cvtps_epi32(vf); // convert to int
__m128i sign = _mm_cmplt_epi32(val, zero); // get sign
val = _mm_xor_si128(val, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi32(val, ones); // 2's complement
__m128i c = _mm_set1_epi32((si32)count);
__m128i idx = _mm_set_epi32(3, 2, 1, 0);
__m128i mask = _mm_cmpgt_epi32(c, idx);
c = _mm_and_si128(val, mask);
tmax = _mm_or_si128(tmax, c);
sign = _mm_slli_epi32(sign, 31);
val = _mm_or_si128(val, sign);
_mm_storeu_si128((__m128i*)dp, val);
}
_mm_storeu_si128((__m128i*)max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void sse2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 31 - K_max;
__m128i m1 = _mm_set1_epi32(INT_MAX);
__m128i zero = _mm_setzero_si128();
__m128i one = _mm_set1_epi32(1);
si32 *p = (si32*)dp;
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
{
__m128i v = _mm_load_si128((__m128i*)sp);
__m128i val = _mm_and_si128(v, m1);
val = _mm_srli_epi32(val, (int)shift);
__m128i sign = _mm_cmplt_epi32(v, zero);
val = _mm_xor_si128(val, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi32(val, ones); // 2's complement
_mm_storeu_si128((__m128i*)p, val);
}
}
//////////////////////////////////////////////////////////////////////////
void sse2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(K_max);
__m128i m1 = _mm_set1_epi32(INT_MAX);
__m128 d = _mm_set1_ps(delta);
float *p = (float*)dp;
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
{
__m128i v = _mm_load_si128((__m128i*)sp);
__m128i vali = _mm_and_si128(v, m1);
__m128 valf = _mm_cvtepi32_ps(vali);
valf = _mm_mul_ps(valf, d);
__m128i sign = _mm_andnot_si128(m1, v);
valf = _mm_or_ps(valf, _mm_castsi128_ps(sign));
_mm_storeu_ps(p, valf);
}
}
//////////////////////////////////////////////////////////////////////////
void sse2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val)
{
ojph_unused(delta_inv);
// convert to sign and magnitude and keep max_val
ui32 shift = 63 - K_max;
__m128i m0 = _mm_set1_epi64x(LLONG_MIN);
__m128i zero = _mm_setzero_si128();
__m128i one = _mm_set1_epi64x(1);
__m128i tmax = _mm_loadu_si128((__m128i*)max_val);
__m128i *p = (__m128i*)sp;
for ( ; count >= 2; count -= 2, p += 1, dp += 2)
{
__m128i v = _mm_loadu_si128(p);
__m128i sign = _mm_cmplt_epi32(v, zero);
sign = _mm_shuffle_epi32(sign, 0xF5); // sign = sign[1,1,3,3];
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi64(val, ones); // 2's complement
sign = _mm_and_si128(sign, m0);
val = _mm_slli_epi64(val, (int)shift);
tmax = _mm_or_si128(tmax, val);
val = _mm_or_si128(val, sign);
_mm_storeu_si128((__m128i*)dp, val);
}
if (count)
{
__m128i v = _mm_loadu_si128(p);
__m128i sign = _mm_cmplt_epi32(v, zero);
sign = _mm_shuffle_epi32(sign, 0xF5); // sign = sign[1,1,3,3];
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi64(val, ones); // 2's complement
sign = _mm_and_si128(sign, m0);
val = _mm_slli_epi64(val, (int)shift);
__m128i c = _mm_set_epi32(0, 0, (si32)0xFFFFFFFF, (si32)0xFFFFFFFF);
c = _mm_and_si128(val, c);
tmax = _mm_or_si128(tmax, c);
val = _mm_or_si128(val, sign);
_mm_storeu_si128((__m128i*)dp, val);
}
_mm_storeu_si128((__m128i*)max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void sse2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 63 - K_max;
__m128i m1 = _mm_set1_epi64x(LLONG_MAX);
__m128i zero = _mm_setzero_si128();
__m128i one = _mm_set1_epi64x(1);
si64 *p = (si64*)dp;
for (ui32 i = 0; i < count; i += 2, sp += 2, p += 2)
{
__m128i v = _mm_load_si128((__m128i*)sp);
__m128i val = _mm_and_si128(v, m1);
val = _mm_srli_epi64(val, (int)shift);
__m128i sign = _mm_cmplt_epi32(v, zero);
sign = _mm_shuffle_epi32(sign, 0xF5); // sign = sign[1,1,3,3];
val = _mm_xor_si128(val, sign); // negate 1's complement
__m128i ones = _mm_and_si128(sign, one);
val = _mm_add_epi64(val, ones); // 2's complement
_mm_storeu_si128((__m128i*)p, val);
}
}
}
}
#endif
@@ -0,0 +1,289 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_codestream_wasm.cpp
// Author: Aous Naman
// Date: 15 May 2022
//***************************************************************************/
#include <climits>
#include <cstddef>
#include <wasm_simd128.h>
#include "ojph_defs.h"
namespace ojph {
namespace local {
//////////////////////////////////////////////////////////////////////////
void wasm_mem_clear(void* addr, size_t count)
{
float* p = (float*)addr;
v128_t zero = wasm_i32x4_splat(0);
for (size_t i = 0; i < count; i += 16, p += 4)
wasm_v128_store(p, zero);
}
//////////////////////////////////////////////////////////////////////////
ui32 wasm_find_max_val32(ui32* address)
{
v128_t x1, x0 = wasm_v128_load(address);
x1 = wasm_i32x4_shuffle(x0, x0, 2, 3, 2, 3); // x1 = x0[2,3,2,3]
x0 = wasm_v128_or(x0, x1);
x1 = wasm_i32x4_shuffle(x0, x0, 1, 1, 1, 1); // x1 = x0[1,1,1,1]
x0 = wasm_v128_or(x0, x1);
ui32 t = (ui32)wasm_i32x4_extract_lane(x0, 0);
return t;
}
//////////////////////////////////////////////////////////////////////////
ui64 wasm_find_max_val64(ui64* address)
{
v128_t x1, x0 = wasm_v128_load(address);
x1 = wasm_i64x2_shuffle(x0, x0, 1, 1); // x1 = x0[2,3,2,3]
x0 = wasm_v128_or(x0, x1);
ui64 t = (ui64)wasm_i64x2_extract_lane(x0, 0);
return t;
}
//////////////////////////////////////////////////////////////////////////
void wasm_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val)
{
ojph_unused(delta_inv);
// convert to sign and magnitude and keep max_val
ui32 shift = 31 - K_max;
v128_t m0 = wasm_i32x4_splat(INT_MIN);
v128_t zero = wasm_i32x4_splat(0);
v128_t one = wasm_i32x4_splat(1);
v128_t tmax = wasm_v128_load(max_val);
si32 *p = (si32*)sp;
for ( ; count >= 4; count -= 4, p += 4, dp += 4)
{
v128_t v = wasm_v128_load(p);
v128_t sign = wasm_i32x4_lt(v, zero);
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i32x4_add(val, ones); // 2's complement
sign = wasm_v128_and(sign, m0);
val = wasm_i32x4_shl(val, shift);
tmax = wasm_v128_or(tmax, val);
val = wasm_v128_or(val, sign);
wasm_v128_store(dp, val);
}
if (count)
{
v128_t v = wasm_v128_load(p);
v128_t sign = wasm_i32x4_lt(v, zero);
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i32x4_add(val, ones); // 2's complement
sign = wasm_v128_and(sign, m0);
val = wasm_i32x4_shl(val, shift);
v128_t c = wasm_i32x4_splat((si32)count);
v128_t idx = wasm_i32x4_make(0, 1, 2, 3);
v128_t mask = wasm_i32x4_gt(c, idx);
c = wasm_v128_and(val, mask);
tmax = wasm_v128_or(tmax, c);
val = wasm_v128_or(val, sign);
wasm_v128_store(dp, val);
}
wasm_v128_store(max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void wasm_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
float delta_inv, ui32 count, ui32* max_val)
{
ojph_unused(K_max);
//quantize and convert to sign and magnitude and keep max_val
v128_t d = wasm_f32x4_splat(delta_inv);
v128_t zero = wasm_i32x4_splat(0);
v128_t one = wasm_i32x4_splat(1);
v128_t tmax = wasm_v128_load(max_val);
float *p = (float*)sp;
for ( ; count >= 4; count -= 4, p += 4, dp += 4)
{
v128_t vf = wasm_v128_load(p);
vf = wasm_f32x4_mul(vf, d); // multiply
v128_t val = wasm_i32x4_trunc_sat_f32x4(vf); // convert to signed int
v128_t sign = wasm_i32x4_lt(val, zero); // get sign
val = wasm_v128_xor(val, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i32x4_add(val, ones); // 2's complement
tmax = wasm_v128_or(tmax, val);
sign = wasm_i32x4_shl(sign, 31);
val = wasm_v128_or(val, sign);
wasm_v128_store(dp, val);
}
if (count)
{
v128_t vf = wasm_v128_load(p);
vf = wasm_f32x4_mul(vf, d); // multiply
v128_t val = wasm_i32x4_trunc_sat_f32x4(vf); // convert to signed int
v128_t sign = wasm_i32x4_lt(val, zero); // get sign
val = wasm_v128_xor(val, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i32x4_add(val, ones); // 2's complement
v128_t c = wasm_i32x4_splat((si32)count);
v128_t idx = wasm_i32x4_make(0, 1, 2, 3);
v128_t mask = wasm_i32x4_gt(c, idx);
c = wasm_v128_and(val, mask);
tmax = wasm_v128_or(tmax, c);
sign = wasm_i32x4_shl(sign, 31);
val = wasm_v128_or(val, sign);
wasm_v128_store(dp, val);
}
wasm_v128_store(max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void wasm_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 31 - K_max;
v128_t m1 = wasm_i32x4_splat(INT_MAX);
v128_t zero = wasm_i32x4_splat(0);
v128_t one = wasm_i32x4_splat(1);
si32 *p = (si32*)dp;
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
{
v128_t v = wasm_v128_load((v128_t*)sp);
v128_t val = wasm_v128_and(v, m1);
val = wasm_i32x4_shr(val, shift);
v128_t sign = wasm_i32x4_lt(v, zero);
val = wasm_v128_xor(val, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i32x4_add(val, ones); // 2's complement
wasm_v128_store(p, val);
}
}
//////////////////////////////////////////////////////////////////////////
void wasm_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(K_max);
v128_t m1 = wasm_i32x4_splat(INT_MAX);
v128_t d = wasm_f32x4_splat(delta);
float *p = (float*)dp;
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
{
v128_t v = wasm_v128_load((v128_t*)sp);
v128_t vali = wasm_v128_and(v, m1);
v128_t valf = wasm_f32x4_convert_i32x4(vali);
valf = wasm_f32x4_mul(valf, d);
v128_t sign = wasm_v128_andnot(v, m1);
valf = wasm_v128_or(valf, sign);
wasm_v128_store(p, valf);
}
}
//////////////////////////////////////////////////////////////////////////
void wasm_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
float delta_inv, ui32 count, ui64* max_val)
{
ojph_unused(delta_inv);
// convert to sign and magnitude and keep max_val
ui32 shift = 63 - K_max;
v128_t m0 = wasm_i64x2_splat(LLONG_MIN);
v128_t zero = wasm_i64x2_splat(0);
v128_t one = wasm_i64x2_splat(1);
v128_t tmax = wasm_v128_load(max_val);
si64 *p = (si64*)sp;
for ( ; count >= 2; count -= 2, p += 2, dp += 2)
{
v128_t v = wasm_v128_load(p);
v128_t sign = wasm_i64x2_lt(v, zero);
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i64x2_add(val, ones); // 2's complement
sign = wasm_v128_and(sign, m0);
val = wasm_i64x2_shl(val, shift);
tmax = wasm_v128_or(tmax, val);
val = wasm_v128_or(val, sign);
wasm_v128_store(dp, val);
}
if (count)
{
v128_t v = wasm_v128_load(p);
v128_t sign = wasm_i64x2_lt(v, zero);
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i64x2_add(val, ones); // 2's complement
sign = wasm_v128_and(sign, m0);
val = wasm_i64x2_shl(val, shift);
v128_t c = wasm_i32x4_make((si32)0xFFFFFFFF, (si32)0xFFFFFFFF, 0, 0);
c = wasm_v128_and(val, c);
tmax = wasm_v128_or(tmax, c);
val = wasm_v128_or(val, sign);
wasm_v128_store(dp, val);
}
wasm_v128_store(max_val, tmax);
}
//////////////////////////////////////////////////////////////////////////
void wasm_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
float delta, ui32 count)
{
ojph_unused(delta);
ui32 shift = 63 - K_max;
v128_t m1 = wasm_i64x2_splat(LLONG_MAX);
v128_t zero = wasm_i64x2_splat(0);
v128_t one = wasm_i64x2_splat(1);
si64 *p = (si64*)dp;
for (ui32 i = 0; i < count; i += 2, sp += 2, p += 2)
{
v128_t v = wasm_v128_load((v128_t*)sp);
v128_t val = wasm_v128_and(v, m1);
val = wasm_i64x2_shr(val, shift);
v128_t sign = wasm_i64x2_lt(v, zero);
val = wasm_v128_xor(val, sign); // negate 1's complement
v128_t ones = wasm_v128_and(sign, one);
val = wasm_i64x2_add(val, ones); // 2's complement
wasm_v128_store(p, val);
}
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+576
View File
@@ -0,0 +1,576 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_precinct.cpp
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#include <climits>
#include <cmath>
#include "ojph_mem.h"
#include "ojph_params.h"
#include "ojph_codestream_local.h"
#include "ojph_precinct.h"
#include "ojph_subband.h"
#include "ojph_codeblock.h" // for coded_cb_header
#include "ojph_bitbuffer_write.h"
#include "ojph_bitbuffer_read.h"
namespace ojph {
namespace local
{
//////////////////////////////////////////////////////////////////////////
struct tag_tree
{
void init(ui8* buf, ui32 *lev_idx, ui32 num_levels, size s, int init_val)
{
for (ui32 i = 0; i <= num_levels; ++i) //on extra level
levs[i] = buf + lev_idx[i];
for (ui32 i = num_levels + 1; i < 16; ++i)
levs[i] = (ui8*)INT_MAX; //make it crash on error
width = s.w;
height = s.h;
for (ui32 i = 0; i < num_levels; ++i)
{
ui32 size = 1u << ((num_levels - 1 - i) << 1);
memset(levs[i], init_val, size);
}
*levs[num_levels] = 0;
this->num_levels = num_levels;
}
ui8* get(ui32 x, ui32 y, ui32 lev)
{
return levs[lev] + (x + y * ((width + (1 << lev) - 1) >> lev));
}
ui32 width, height, num_levels;
ui8* levs[16]; // you cannot have this high number of levels
};
//////////////////////////////////////////////////////////////////////////
static inline ui32 log2ceil(ui32 x)
{
ui32 t = 31 - count_leading_zeros(x);
return t + (x & (x - 1) ? 1 : 0);
}
//////////////////////////////////////////////////////////////////////////
ui32 precinct::prepare_precinct(int tag_tree_size, ui32* lev_idx,
mem_elastic_allocator* elastic)
{
bit_write_buf bb;
coded_lists *cur_coded_list = NULL;
ui32 cb_bytes = 0; //cb_bytes;
ui32 ph_bytes = 0; //precinct header size
int num_skipped_subbands = 0;
for (int s = 0; s < 4; ++s)
{
if (bands[s].empty)
continue;
if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
continue;
ui32 num_levels = 1 +
ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
//create quad trees for inclusion and missing msbs
tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 255);
inc_tag_flags.init(scratch + tag_tree_size,
lev_idx, num_levels, cb_idxs[s].siz, 0);
mmsb_tag.init(scratch + (tag_tree_size<<1),
lev_idx, num_levels, cb_idxs[s].siz, 255);
mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
lev_idx, num_levels, cb_idxs[s].siz, 0);
ui32 band_width = bands[s].num_blocks.w;
coded_cb_header *cp = bands[s].coded_cbs;
cp += cb_idxs[s].org.x + cb_idxs[s].org.y * band_width;
for (ui32 y = 0; y < cb_idxs[s].siz.h; ++y)
{
for (ui32 x = 0; x < cb_idxs[s].siz.w; ++x)
{
coded_cb_header *p = cp + x;
*inc_tag.get(x, y, 0) = (p->next_coded == NULL); //1 if true
*mmsb_tag.get(x, y, 0) = (ui8)p->missing_msbs;
}
cp += band_width;
}
for (ui32 lev = 1; lev < num_levels; ++lev)
{
ui32 height = (cb_idxs[s].siz.h + (1<<lev) - 1) >> lev;
ui32 width = (cb_idxs[s].siz.w + (1<<lev) - 1) >> lev;
for (ui32 y = 0; y < height; ++y)
{
for (ui32 x = 0; x < width; ++x)
{
ui8 t1, t2;
t1 = ojph_min(*inc_tag.get(x<<1, y<<1, lev-1),
*inc_tag.get((x<<1) + 1, y<<1, lev-1));
t2 = ojph_min(*inc_tag.get(x<<1, (y<<1) + 1, lev-1),
*inc_tag.get((x<<1) + 1, (y<<1) + 1, lev-1));
*inc_tag.get(x, y, lev) = ojph_min(t1, t2);
*inc_tag_flags.get(x, y, lev) = 0;
t1 = ojph_min(*mmsb_tag.get(x<<1, y<<1, lev-1),
*mmsb_tag.get((x<<1) + 1, y<<1, lev-1));
t2 = ojph_min(*mmsb_tag.get(x<<1, (y<<1) + 1, lev-1),
*mmsb_tag.get((x<<1) + 1, (y<<1) + 1, lev-1));
*mmsb_tag.get(x, y, lev) = ojph_min(t1, t2);
*mmsb_tag_flags.get(x, y, lev) = 0;
}
}
}
*inc_tag.get(0,0,num_levels) = 0;
*inc_tag_flags.get(0,0,num_levels) = 0;
*mmsb_tag.get(0,0,num_levels) = 0;
*mmsb_tag_flags.get(0,0,num_levels) = 0;
if (*inc_tag.get(0, 0, num_levels-1) != 0) //empty subband
{
if (coded) //non empty precinct, tag tree top is 0
bb_put_bits(&bb, 0, 1, elastic, cur_coded_list, ph_bytes);
else
++num_skipped_subbands;
continue;
}
//now we are in a position to code
if (coded == NULL)
{
bb_init(&bb, elastic, cur_coded_list);
coded = cur_coded_list;
//store non empty packet
bb_put_bit(&bb, 1, elastic, cur_coded_list, ph_bytes);
// if the first one or two subbands are empty (has codeblocks but
// no data in them), we need to code them here.
bb_put_bits(&bb, 0, num_skipped_subbands, elastic, cur_coded_list,
ph_bytes);
num_skipped_subbands = 0; //this line is not needed
}
ui32 width = cb_idxs[s].siz.w;
ui32 height = cb_idxs[s].siz.h;
for (ui32 y = 0; y < height; ++y)
{
cp = bands[s].coded_cbs;
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
for (ui32 x = 0; x < width; ++x, ++cp)
{
//inclusion bits
for (ui32 cur_lev = num_levels; cur_lev > 0; --cur_lev)
{
ui32 levm1 = cur_lev - 1;
//check sent
if (*inc_tag_flags.get(x>>levm1, y>>levm1, levm1) == 0)
{
ui32 skipped = *inc_tag.get(x>>levm1, y>>levm1, levm1);
skipped -= *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev);
assert(skipped <= 1); // for HTJ2K, this should 0 or 1
bb_put_bits(&bb, 1 - skipped, 1,
elastic, cur_coded_list, ph_bytes);
*inc_tag_flags.get(x>>levm1, y>>levm1, levm1) = 1;
}
if (*inc_tag.get(x>>levm1, y>>levm1, levm1) > 0)
break;
}
if (cp->num_passes == 0) //empty codeblock
continue;
//missing msbs
for (ui32 cur_lev = num_levels; cur_lev > 0; --cur_lev)
{
ui32 levm1 = cur_lev - 1;
//check sent
if (*mmsb_tag_flags.get(x>>levm1, y>>levm1, levm1) == 0)
{
int num_zeros = *mmsb_tag.get(x>>levm1, y>>levm1, levm1);
num_zeros -= *mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev);
bb_put_zeros(&bb, num_zeros,
elastic, cur_coded_list, ph_bytes);
bb_put_bits(&bb, 1, 1,
elastic, cur_coded_list, ph_bytes);
*mmsb_tag_flags.get(x>>levm1, y>>levm1, levm1) = 1;
}
}
//number of coding passes
switch (cp->num_passes)
{
case 3:
bb_put_bits(&bb, 12, 4, elastic, cur_coded_list, ph_bytes);
break;
case 2:
bb_put_bits(&bb, 2, 2, elastic, cur_coded_list, ph_bytes);
break;
case 1:
bb_put_bits(&bb, 0, 1, elastic, cur_coded_list, ph_bytes);
break;
default:
assert(0);
}
//pass lengths
//either one, two, or three passes, but only one or two lengths
int bits1 = 32 - (int)count_leading_zeros(cp->pass_length[0]);
int extra_bit = cp->num_passes > 2 ? 1 : 0; //for 2nd length
int bits2 = 0;
if (cp->num_passes > 1)
bits2 = 32 - (int)count_leading_zeros(cp->pass_length[1]);
int bits = ojph_max(bits1, bits2 - extra_bit) - 3;
bits = ojph_max(bits, 0);
bb_put_bits(&bb, 0xFFFFFFFEu, bits+1,
elastic, cur_coded_list, ph_bytes);
bb_put_bits(&bb, cp->pass_length[0], bits+3,
elastic, cur_coded_list, ph_bytes);
if (cp->num_passes > 1)
bb_put_bits(&bb, cp->pass_length[1], bits+3+extra_bit,
elastic, cur_coded_list, ph_bytes);
cb_bytes += cp->pass_length[0] + cp->pass_length[1];
}
}
}
if (coded)
{
bb_terminate(&bb);
ph_bytes += cur_coded_list->buf_size - cur_coded_list->avail_size;
}
return coded ? cb_bytes + ph_bytes : 1; // 1 for empty packet
}
//////////////////////////////////////////////////////////////////////////
void precinct::write(outfile_base *file)
{
if (coded)
{
//write packet header
coded_lists *ccl = coded;
while (ccl)
{
file->write(ccl->buf, ccl->buf_size - ccl->avail_size);
ccl = ccl->next_list;
}
//write codeblocks
for (int s = 0; s < 4; ++s)
{
if (bands[s].empty)
continue;
ui32 band_width = bands[s].num_blocks.w;
ui32 width = cb_idxs[s].siz.w;
ui32 height = cb_idxs[s].siz.h;
for (ui32 y = 0; y < height; ++y)
{
coded_cb_header *cp = bands[s].coded_cbs;
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
for (ui32 x = 0; x < width; ++x, ++cp)
{
coded_lists *ccl = cp->next_coded;
while (ccl)
{
file->write(ccl->buf, ccl->buf_size - ccl->avail_size);
ccl = ccl->next_list;
}
}
}
}
}
else
{
//empty packet
char buf = 0x00;
file->write(&buf, 1);
}
}
//////////////////////////////////////////////////////////////////////////
void precinct::parse(int tag_tree_size, ui32* lev_idx,
mem_elastic_allocator *elastic,
ui32 &data_left, infile_base *file,
bool skipped)
{
assert(data_left > 0);
bit_read_buf bb;
bb_init(&bb, data_left, file);
if (may_use_sop)
bb_skip_sop(&bb);
bool empty_packet = true;
for (int s = 0; s < 4; ++s)
{
if (bands[s].empty)
continue;
if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
continue;
if (empty_packet) //one bit to check if the packet is empty
{
ui32 bit;
bb_read_bit(&bb, bit);
if (bit == 0) //empty packet
{ bb_terminate(&bb, uses_eph); data_left = bb.bytes_left; return; }
empty_packet = false;
}
ui32 num_levels = 1 +
ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
//create quad trees for inclusion and missing msbs
tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 0);
*inc_tag.get(0, 0, num_levels) = 0;
inc_tag_flags.init(scratch + tag_tree_size, lev_idx, num_levels,
cb_idxs[s].siz, 0);
*inc_tag_flags.get(0, 0, num_levels) = 0;
mmsb_tag.init(scratch + (tag_tree_size<<1), lev_idx, num_levels,
cb_idxs[s].siz, 0);
*mmsb_tag.get(0, 0, num_levels) = 0;
mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
lev_idx, num_levels, cb_idxs[s].siz, 0);
*mmsb_tag_flags.get(0, 0, num_levels) = 0;
//
ui32 band_width = bands[s].num_blocks.w;
ui32 width = cb_idxs[s].siz.w;
ui32 height = cb_idxs[s].siz.h;
for (ui32 y = 0; y < height; ++y)
{
coded_cb_header *cp = bands[s].coded_cbs;
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
for (ui32 x = 0; x < width; ++x, ++cp)
{
//process inclusion
bool empty_cb = false;
for (ui32 cl = num_levels; cl > 0; --cl)
{
ui32 cur_lev = cl - 1;
empty_cb = *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) == 1;
if (empty_cb)
break;
//check received
if (*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
{
ui32 bit;
if (bb_read_bit(&bb, bit) == false)
{ data_left = 0; throw "error reading from file p1"; }
empty_cb = (bit == 0);
*inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)(1 - bit);
*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
}
if (empty_cb)
break;
}
if (empty_cb)
continue;
//process missing msbs
ui32 mmsbs = 0;
for (ui32 levp1 = num_levels; levp1 > 0; --levp1)
{
ui32 cur_lev = levp1 - 1;
mmsbs = *mmsb_tag.get(x>>levp1, y>>levp1, levp1);
//check received
if (*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
{
ui32 bit = 0;
while (bit == 0)
{
if (bb_read_bit(&bb, bit) == false)
{ data_left = 0; throw "error reading from file p2"; }
mmsbs += 1 - bit;
}
*mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)mmsbs;
*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
}
}
if (mmsbs > cp->Kmax)
throw "error in parsing a tile header; "
"missing msbs are larger or equal to Kmax. The most likely "
"cause is a corruption in the bitstream.";
cp->missing_msbs = mmsbs;
//get number of passes
ui32 bit, num_passes = 1;
if (bb_read_bit(&bb, bit) == false)
{ data_left = 0; throw "error reading from file p3"; }
if (bit)
{
num_passes = 2;
if (bb_read_bit(&bb, bit) == false)
{ data_left = 0; throw "error reading from file p4"; }
if (bit)
{
if (bb_read_bits(&bb, 2, bit) == false)
{ data_left = 0; throw "error reading from file p5"; }
num_passes = 3 + bit;
if (bit == 3)
{
if (bb_read_bits(&bb, 5, bit) == false)
{ data_left = 0; throw "error reading from file p6"; }
num_passes = 6 + bit;
if (bit == 31)
{
if (bb_read_bits(&bb, 7, bit) == false)
{ data_left = 0; throw "error reading from file p7"; }
num_passes = 37 + bit;
}
}
}
}
cp->num_passes = num_passes;
// Parse pass lengths
// When number of passes is one, one length.
// When number of passes is two or three, two lengths.
// When number of passes > 3, we have place holder passes;
// In this case, subtract multiples of 3 from the number of
// passes; for example, if we have 10 passes, we subtract 9,
// producing 1 pass.
// 1 => 1, 2 => 2, 3 => 3, 4 => 1, 5 => 2, 6 => 3
ui32 num_phld_passes = (num_passes - 1) / 3;
cp->missing_msbs += num_phld_passes;
num_phld_passes *= 3;
cp->num_passes = num_passes - num_phld_passes;
cp->pass_length[0] = cp->pass_length[1] = 0;
int Lblock = 3;
bit = 1;
while (bit)
{
// add any extra bits here
if (bb_read_bit(&bb, bit) == false)
{ data_left = 0; throw "error reading from file p8"; }
Lblock += bit;
}
int bits = Lblock + 31 -
(int)count_leading_zeros(num_phld_passes + 1);
if (bb_read_bits(&bb, bits, bit) == false)
{ data_left = 0; throw "error reading from file p9"; }
if (bit < 2)
throw "The cleanup segment of an HT codeblock cannot contain "
"less than 2 bytes";
if (bit >= 65535)
throw "The cleanup segment of an HT codeblock must contain "
"less than 65535 bytes";
cp->pass_length[0] = bit;
if (cp->num_passes > 1)
{
//bits = Lblock + 31 - count_leading_zeros(cp->num_passes - 1);
// The following is simpler than the above, I think?
bits = Lblock + (cp->num_passes > 2 ? 1 : 0);
if (bb_read_bits(&bb, bits, bit) == false)
{ data_left = 0; throw "error reading from file p10"; }
if (bit >= 2047)
throw "The refinement segment (SigProp and MagRep passes) of "
"an HT codeblock must contain less than 2047 bytes";
cp->pass_length[1] = bit;
}
}
}
}
if (empty_packet)
{ // all subbands are empty
ui32 bit = 0;
bb_read_bit(&bb, bit);
//assert(bit == 0);
}
bb_terminate(&bb, uses_eph);
//read codeblock data
for (int s = 0; s < 4; ++s)
{
if (bands[s].empty)
continue;
ui32 band_width = bands[s].num_blocks.w;
ui32 width = cb_idxs[s].siz.w;
ui32 height = cb_idxs[s].siz.h;
for (ui32 y = 0; y < height; ++y)
{
coded_cb_header *cp = bands[s].coded_cbs;
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
for (ui32 x = 0; x < width; ++x, ++cp)
{
ui32 num_bytes = cp->pass_length[0] + cp->pass_length[1];
if (data_left)
{
if (num_bytes)
{
if (skipped)
{ //no need to read
si64 cur_loc = file->tell();
ui32 t = ojph_min(num_bytes, bb.bytes_left);
file->seek(t, infile_base::OJPH_SEEK_CUR);
ui32 bytes_read = (ui32)(file->tell() - cur_loc);
cp->pass_length[0] = cp->pass_length[1] = 0;
bb.bytes_left -= bytes_read;
assert(bytes_read == t || bb.bytes_left == 0);
}
else
{
if (!bb_read_chunk(&bb, num_bytes, cp->next_coded, elastic))
{
//no need to decode a broken codeblock
cp->pass_length[0] = cp->pass_length[1] = 0;
data_left = 0;
}
}
}
}
else
cp->pass_length[0] = cp->pass_length[1] = 0;
}
}
}
data_left = bb.bytes_left;
}
}
}
+82
View File
@@ -0,0 +1,82 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_precinct.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_PRECINCT_H
#define OJPH_PRECINCT_H
#include "ojph_defs.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class mem_elastic_allocator;
struct coded_lists;
namespace local {
//////////////////////////////////////////////////////////////////////////
//defined here
class subband;
//////////////////////////////////////////////////////////////////////////
struct precinct
{
precinct() {
scratch = NULL; bands = NULL; coded = NULL;
may_use_sop = uses_eph = false;
}
ui32 prepare_precinct(int tag_tree_size, ui32* lev_idx,
mem_elastic_allocator *elastic);
void write(outfile_base *file);
void parse(int tag_tree_size, ui32* lev_idx,
mem_elastic_allocator *elastic,
ui32& data_left, infile_base *file, bool skipped);
ui8 *scratch;
point img_point; //the precinct projected to full resolution
rect cb_idxs[4]; //indices of codeblocks
subband *bands; //the subbands
coded_lists* coded;
bool may_use_sop, uses_eph;
};
}
}
#endif // !OJPH_PRECINCT_H
File diff suppressed because it is too large Load Diff
+133
View File
@@ -0,0 +1,133 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_resolution.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_RESOLUTION_H
#define OJPH_RESOLUTION_H
#include "ojph_defs.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class line_buf;
class mem_elastic_allocator;
class codestream;
namespace local {
//////////////////////////////////////////////////////////////////////////
//defined here
class tile_comp;
struct precinct;
class subband;
//////////////////////////////////////////////////////////////////////////
class resolution
{
public:
enum : ui32 {
HORZ_TRX = 0x01, // horizontal transform
VERT_TRX = 0x02, // vertical transform
};
public:
static void pre_alloc(codestream *codestream, const rect& res_rect,
const rect& recon_res_rect,
ui32 comp_num, ui32 res_num);
void finalize_alloc(codestream *codestream, const rect& res_rect,
const rect& recon_res_rect, ui32 comp_num,
ui32 res_num, point comp_downsamp,
point res_downsamp, tile_comp *parent_tile_comp,
resolution *parent_res);
line_buf* get_line();
void push_line();
line_buf* pull_line();
rect get_rect() { return res_rect; }
ui32 get_comp_num() { return comp_num; }
bool has_horz_transform() { return (transform_flags & HORZ_TRX) != 0; }
bool has_vert_transform() { return (transform_flags & VERT_TRX) != 0; }
ui32 prepare_precinct();
void write_precincts(outfile_base *file);
bool get_top_left_precinct(point &top_left);
void write_one_precinct(outfile_base *file);
resolution *next_resolution() { return child_res; }
void parse_all_precincts(ui32& data_left, infile_base *file);
void parse_one_precinct(ui32& data_left, infile_base *file);
ui32 get_num_bytes() const { return num_bytes; }
ui32 get_num_bytes(ui32 resolution_num) const;
private:
bool reversible, skipped_res_for_read, skipped_res_for_recon;
ui32 num_steps;
ui32 res_num;
ui32 comp_num;
ui32 num_bytes; // number of bytes in this resolution
// used for tilepart length
point comp_downsamp;
rect res_rect; // resolution rectangle
line_buf* lines; // used to store lines
lifting_buf *ssp; // step state pointer
lifting_buf *aug, *sig;
subband *bands;
tile_comp *parent_comp;
resolution *parent_res, *child_res;
//precincts stuff
precinct *precincts;
size num_precincts;
size log_PP;
ui32 max_num_levels;
int tag_tree_size;
ui32 level_index[20]; //more than enough
point cur_precinct_loc; //used for progressing spatial modes (2, 3, 4)
const param_atk* atk;
ui32 transform_flags;
//wavelet machinery
ui32 cur_line;
ui32 rows_to_produce;
bool vert_even, horz_even;
mem_elastic_allocator *elastic;
};
}
}
#endif // !OJPH_RESOLUTION_H
+382
View File
@@ -0,0 +1,382 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_subband.cpp
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#include <climits>
#include <cmath>
#include "ojph_mem.h"
#include "ojph_params.h"
#include "ojph_codestream_local.h"
#include "ojph_subband.h"
#include "ojph_resolution.h"
#include "ojph_codeblock.h"
#include "ojph_precinct.h"
namespace ojph {
namespace local
{
//////////////////////////////////////////////////////////////////////////
void subband::pre_alloc(codestream *codestream, const rect &band_rect,
ui32 comp_num, ui32 res_num, ui32 transform_flags)
{
mem_fixed_allocator* allocator = codestream->get_allocator();
bool empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
if (empty)
return;
const param_cod* cdp = codestream->get_coc(comp_num);
size log_cb = cdp->get_log_block_dims();
size log_PP = cdp->get_log_precinct_size(res_num);
ui32 x_off = ((transform_flags & resolution::HORZ_TRX) ? 1 : 0);
ui32 y_off = ((transform_flags & resolution::VERT_TRX) ? 1 : 0);
ui32 xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
ui32 ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
size nominal(1 << xcb_prime, 1 << ycb_prime);
ui32 tbx0 = band_rect.org.x;
ui32 tby0 = band_rect.org.y;
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
size num_blocks;
num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
num_blocks.w -= tbx0 >> xcb_prime;
num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
num_blocks.h -= tby0 >> ycb_prime;
allocator->pre_alloc_obj<codeblock>(num_blocks.w);
//allocate codeblock headers
allocator->pre_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
ui32 precision = qp->propose_precision(cdp);
const param_atk* atk = cdp->access_atk();
bool reversible = atk->is_reversible();
for (ui32 i = 0; i < num_blocks.w; ++i)
codeblock::pre_alloc(codestream, nominal, precision);
//allocate lines
allocator->pre_alloc_obj<line_buf>(1);
//allocate line_buf
ui32 width = band_rect.siz.w + 1;
if (reversible)
{
if (precision <= 32)
allocator->pre_alloc_data<si32>(width, 1);
else
allocator->pre_alloc_data<si64>(width, 1);
}
else
allocator->pre_alloc_data<float>(width, 1);
}
//////////////////////////////////////////////////////////////////////////
void subband::finalize_alloc(codestream *codestream,
const rect &band_rect,
resolution* res, ui32 res_num,
ui32 subband_num)
{
mem_fixed_allocator* allocator = codestream->get_allocator();
elastic = codestream->get_elastic_alloc();
this->res_num = res_num;
this->band_num = subband_num;
this->band_rect = band_rect;
this->parent = res;
const param_cod* cdp = codestream->get_coc(parent->get_comp_num());
this->reversible = cdp->access_atk()->is_reversible();
size log_cb = cdp->get_log_block_dims();
log_PP = cdp->get_log_precinct_size(res_num);
ui32 x_off = ((parent->has_horz_transform()) ? 1 : 0);
ui32 y_off = ((parent->has_vert_transform()) ? 1 : 0);
xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
size nominal(1 << xcb_prime, 1 << ycb_prime);
cur_cb_row = 0;
cur_line = 0;
cur_cb_height = 0;
const param_dfs* dfs = NULL;
if (cdp->is_dfs_defined()) {
dfs = codestream->access_dfs();
if (dfs != NULL)
dfs = dfs->get_dfs(cdp->get_dfs_index());
}
ui32 comp_num = parent->get_comp_num();
const param_qcd* qcd = codestream->access_qcd()->get_qcc(comp_num);
ui32 num_decomps = cdp->get_num_decompositions();
this->K_max = qcd->get_Kmax(dfs, num_decomps, this->res_num, band_num);
if (!reversible)
{
float d =
qcd->get_irrev_delta(dfs, num_decomps, res_num, subband_num);
d /= (float)(1u << (31 - this->K_max));
delta = d;
delta_inv = (1.0f/d);
}
ui32 precision = qcd->propose_precision(cdp);
this->empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
if (this->empty)
return;
ui32 tbx0 = band_rect.org.x;
ui32 tby0 = band_rect.org.y;
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
num_blocks = size();
num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
num_blocks.w -= tbx0 >> xcb_prime;
num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
num_blocks.h -= tby0 >> ycb_prime;
blocks = allocator->post_alloc_obj<codeblock>(num_blocks.w);
//allocate codeblock headers
coded_cb_header *cp = coded_cbs =
allocator->post_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
memset(coded_cbs, 0, sizeof(coded_cb_header) * (size_t)num_blocks.area());
for (int i = (int)num_blocks.area(); i > 0; --i, ++cp)
cp->Kmax = K_max;
ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
size cb_size;
cb_size.h = ojph_min(tby1, y_lower_bound + nominal.h) - tby0;
cur_cb_height = (si32)cb_size.h;
int line_offset = 0;
for (ui32 i = 0; i < num_blocks.w; ++i)
{
ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
cb_size.w = cbx1 - cbx0;
blocks[i].finalize_alloc(codestream, this, nominal, cb_size,
coded_cbs + i, K_max, line_offset,
precision, comp_num);
line_offset += cb_size.w;
}
//allocate lines
lines = allocator->post_alloc_obj<line_buf>(1);
//allocate line_buf
ui32 width = band_rect.siz.w + 1;
if (reversible)
{
if (precision <= 32)
lines->wrap(allocator->post_alloc_data<si32>(width, 1), width, 1);
else
lines->wrap(allocator->post_alloc_data<si64>(width, 1), width, 1);
}
else
lines->wrap(allocator->post_alloc_data<float>(width, 1), width, 1);
}
//////////////////////////////////////////////////////////////////////////
void subband::get_cb_indices(const size& num_precincts,
precinct *precincts)
{
if (empty)
return;
rect res_rect = parent->get_rect();
ui32 trx0 = res_rect.org.x;
ui32 try0 = res_rect.org.y;
ui32 trx1 = res_rect.org.x + res_rect.siz.w;
ui32 try1 = res_rect.org.y + res_rect.siz.h;
ui32 pc_lft = (res_rect.org.x >> log_PP.w) << log_PP.w;
ui32 pc_top = (res_rect.org.y >> log_PP.h) << log_PP.h;
ui32 pcx0, pcx1, pcy0, pcy1;
ui32 x_shift = parent->has_horz_transform() ? 1 : 0;
ui32 y_shift = parent->has_vert_transform() ? 1 : 0;
ui32 yb, xb, coly = 0, colx = 0;
for (ui32 y = 0; y < num_precincts.h; ++y)
{
pcy0 = ojph_max(try0, pc_top + (y << log_PP.h));
pcy1 = ojph_min(try1, pc_top + ((y + 1) << log_PP.h));
pcy0 = (pcy0 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
pcy1 = (pcy1 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
precinct *p = precincts + y * num_precincts.w;
yb = ((pcy1 + (1<<ycb_prime) - 1) >> ycb_prime);
yb -= (pcy0 >> ycb_prime);
colx = 0;
for (ui32 x = 0; x < num_precincts.w; ++x, ++p)
{
pcx0 = ojph_max(trx0, pc_lft + (x << log_PP.w));
pcx1 = ojph_min(trx1, pc_lft + ((x + 1) << log_PP.w));
pcx0 = (pcx0 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
pcx1 = (pcx1 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
rect *bp = p->cb_idxs + band_num;
xb = ((pcx1 + (1<<xcb_prime) - 1) >> xcb_prime);
xb -= (pcx0 >> xcb_prime);
bp->org.x = colx;
bp->org.y = coly;
bp->siz.w = xb;
bp->siz.h = yb;
colx += xb;
}
coly += yb;
}
assert(colx == num_blocks.w && coly == num_blocks.h);
}
//////////////////////////////////////////////////////////////////////////
void subband::exchange_buf(line_buf *l)
{
if (empty)
return;
assert(l->pre_size == lines[0].pre_size && l->size == lines[0].size &&
l->flags == lines[0].flags);
void* p = lines[0].p;
lines[0].p = l->p;
l->p = p;
}
//////////////////////////////////////////////////////////////////////////
void subband::push_line()
{
if (empty)
return;
//push to codeblocks
for (ui32 i = 0; i < num_blocks.w; ++i)
blocks[i].push(lines + 0);
if (++cur_line >= cur_cb_height)
{
for (ui32 i = 0; i < num_blocks.w; ++i)
blocks[i].encode(elastic);
if (++cur_cb_row < num_blocks.h)
{
cur_line = 0;
ui32 tbx0 = band_rect.org.x;
ui32 tby0 = band_rect.org.y;
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
size nominal(1 << xcb_prime, 1 << ycb_prime);
ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
ui32 cby0 = y_lower_bound + cur_cb_row * nominal.h;
ui32 cby1 = ojph_min(tby1, cby0 + nominal.h);
size cb_size;
cb_size.h = cby1 - ojph_max(tby0, cby0);
cur_cb_height = (int)cb_size.h;
for (ui32 i = 0; i < num_blocks.w; ++i)
{
ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
cb_size.w = cbx1 - cbx0;
blocks[i].recreate(cb_size,
coded_cbs + i + cur_cb_row * num_blocks.w);
}
}
}
}
//////////////////////////////////////////////////////////////////////////
line_buf *subband::pull_line()
{
if (empty)
return lines;
//pull from codeblocks
if (--cur_line <= 0)
{
if (cur_cb_row < num_blocks.h)
{
ui32 tbx0 = band_rect.org.x;
ui32 tby0 = band_rect.org.y;
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
size nominal(1 << xcb_prime, 1 << ycb_prime);
ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
ui32 cby0 = ojph_max(tby0, y_lower_bound + cur_cb_row * nominal.h);
ui32 cby1 = ojph_min(tby1, y_lower_bound+(cur_cb_row+1)*nominal.h);
size cb_size;
cb_size.h = cby1 - cby0;
cur_line = cur_cb_height = (int)cb_size.h;
for (ui32 i = 0; i < num_blocks.w; ++i)
{
ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
cb_size.w = cbx1 - cbx0;
blocks[i].recreate(cb_size,
coded_cbs + i + cur_cb_row * num_blocks.w);
blocks[i].decode();
}
++cur_cb_row;
}
}
assert(cur_line >= 0);
//pull from codeblocks
for (ui32 i = 0; i < num_blocks.w; ++i)
blocks[i].pull_line(lines + 0);
return lines;
}
}
}
+124
View File
@@ -0,0 +1,124 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_subband.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_SUBBAND_H
#define OJPH_SUBBAND_H
#include "ojph_defs.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class line_buf;
class mem_elastic_allocator;
class codestream;
namespace local {
//////////////////////////////////////////////////////////////////////////
//defined here
class resolution;
struct precinct;
class codeblock;
struct coded_cb_header;
//////////////////////////////////////////////////////////////////////////
class subband
{
friend struct precinct;
public:
subband() {
res_num = band_num = 0;
reversible = false;
empty = true; // <---- true
lines = NULL;
parent = NULL;
blocks = NULL;
xcb_prime = ycb_prime = 0;
cur_cb_row = 0;
cur_line = 0;
cur_cb_height = 0;
delta = delta_inv = 0.0f;
K_max = 0;
coded_cbs = NULL;
elastic = NULL;
}
static void pre_alloc(codestream *codestream, const rect& band_rect,
ui32 comp_num, ui32 res_num, ui32 transform_flags);
void finalize_alloc(codestream *codestream, const rect& band_rect,
resolution* res, ui32 res_num, ui32 subband_num);
void exchange_buf(line_buf* l);
line_buf* get_line() { return lines; }
void push_line();
void get_cb_indices(const size& num_precincts, precinct *precincts);
float get_delta() { return delta; }
bool exists() { return !empty; }
line_buf* pull_line();
resolution* get_parent() { return parent; }
const resolution* get_parent() const { return parent; }
private:
bool empty; // true if the subband has no pixels or
// the subband is NOT USED
ui32 res_num, band_num;
bool reversible;
rect band_rect;
line_buf *lines;
resolution* parent;
codeblock* blocks;
size num_blocks;
size log_PP;
ui32 xcb_prime, ycb_prime;
ui32 cur_cb_row;
int cur_line;
int cur_cb_height;
float delta, delta_inv;
ui32 K_max;
coded_cb_header *coded_cbs;
mem_elastic_allocator *elastic;
};
}
}
#endif // !OJPH_SUBBAND_H
+899
View File
@@ -0,0 +1,899 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_tile.cpp
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#include <climits>
#include <cmath>
#include "ojph_mem.h"
#include "ojph_params.h"
#include "ojph_codestream_local.h"
#include "ojph_tile.h"
#include "ojph_tile_comp.h"
#include "../transform/ojph_colour.h"
namespace ojph {
namespace local
{
//////////////////////////////////////////////////////////////////////////
void tile::pre_alloc(codestream *codestream, const rect& tile_rect,
const rect& recon_tile_rect, ui32& num_tileparts)
{
mem_fixed_allocator* allocator = codestream->get_allocator();
//allocate tiles_comp
const param_siz *szp = codestream->get_siz();
ui32 num_comps = szp->get_num_components();
allocator->pre_alloc_obj<tile_comp>(num_comps);
allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
allocator->pre_alloc_obj<bool>(num_comps); //for reversible
allocator->pre_alloc_obj<ui8>(num_comps); //for nlt_type3
allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
{
ui32 tilepart_div = codestream->get_tilepart_div();
ui32 t = tilepart_div & OJPH_TILEPART_MASK;
if (t == OJPH_TILEPART_NO_DIVISIONS)
num_tileparts = 1; //for num_rc_bytes
else if (t == OJPH_TILEPART_COMPONENTS)
num_tileparts = num_comps;
else if (t == OJPH_TILEPART_RESOLUTIONS)
{
ui32 max_decs = 0;
for (ui32 c = 0; c < num_comps; ++c) {
ui32 s = codestream->get_coc(c)->get_num_decompositions();
max_decs = ojph_max(max_decs, s);
}
num_tileparts = 1 + max_decs;
}
else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
{
num_tileparts = 0;
for (ui32 c = 0; c < num_comps; ++c) {
ui32 s = codestream->get_coc(c)->get_num_decompositions();
num_tileparts += s + 1;
}
}
if (num_tileparts > 255)
OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
"cannot have more than 255 tile parts.", num_tileparts);
}
ui32 tx0 = tile_rect.org.x;
ui32 ty0 = tile_rect.org.y;
ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
ui32 recon_tx0 = recon_tile_rect.org.x;
ui32 recon_ty0 = recon_tile_rect.org.y;
ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
ui32 width = 0;
for (ui32 i = 0; i < num_comps; ++i)
{
point downsamp = szp->get_downsampling(i);
ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
rect comp_rect;
comp_rect.org.x = tcx0;
comp_rect.org.y = tcy0;
comp_rect.siz.w = tcx1 - tcx0;
comp_rect.siz.h = tcy1 - tcy0;
rect recon_comp_rect;
recon_comp_rect.org.x = recon_tcx0;
recon_comp_rect.org.y = recon_tcy0;
recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
width = ojph_max(width, recon_comp_rect.siz.w);
}
//allocate lines
const param_cod* cdp = codestream->get_cod();
if (cdp->is_employing_color_transform())
{
bool reversible[3];
for (ui32 i = 0; i < 3; ++i)
reversible[i] = codestream->get_coc(i)->is_reversible();
if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
OJPH_ERROR(0x000300A2, "When the colour transform is employed. "
"all colour components must undergo either reversible or "
"irreversible wavelet transform; if not, then it is not clear "
"what colour transform should be used (reversible or "
"irreversible). Here we found that the first three colour "
"components uses %s, %s, and %s transforms, respectively.",
reversible[0] ? "reversible" : "irreversible",
reversible[1] ? "reversible" : "irreversible",
reversible[2] ? "reversible" : "irreversible");
allocator->pre_alloc_obj<line_buf>(3);
if (reversible[0])
for (int i = 0; i < 3; ++i)
allocator->pre_alloc_data<si32>(width, 0);
else
for (int i = 0; i < 3; ++i)
allocator->pre_alloc_data<float>(width, 0);
}
}
//////////////////////////////////////////////////////////////////////////
void tile::finalize_alloc(codestream *codestream, const rect& tile_rect,
ui32 tile_idx, ui32& offset,
ui32 &num_tileparts)
{
//this->parent = codestream;
mem_fixed_allocator* allocator = codestream->get_allocator();
sot.init(0, (ui16)tile_idx, 0, 1);
prog_order = codestream->access_cod().get_progression_order();
//allocate tiles_comp
const param_siz *szp = codestream->get_siz();
const param_nlt *nlp = codestream->get_nlt();
this->num_bytes = 0;
num_comps = szp->get_num_components();
skipped_res_for_read = codestream->get_skipped_res_for_read();
comps = allocator->post_alloc_obj<tile_comp>(num_comps);
comp_rects = allocator->post_alloc_obj<rect>(num_comps);
recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
num_bits = allocator->post_alloc_obj<ui32>(num_comps);
is_signed = allocator->post_alloc_obj<bool>(num_comps);
reversible = allocator->post_alloc_obj<bool>(num_comps);
nlt_type3 = allocator->post_alloc_obj<ui8>(num_comps);
cur_line = allocator->post_alloc_obj<ui32>(num_comps);
profile = codestream->get_profile();
tilepart_div = codestream->get_tilepart_div();
need_tlm = codestream->is_tlm_needed();
{
ui32 tilepart_div = codestream->get_tilepart_div();
ui32 t = tilepart_div & OJPH_TILEPART_MASK;
if (t == OJPH_TILEPART_NO_DIVISIONS)
num_tileparts = 1; //for num_rc_bytes
else if (t == OJPH_TILEPART_COMPONENTS)
num_tileparts = num_comps;
else if (t == OJPH_TILEPART_RESOLUTIONS)
{
ui32 max_decs = 0;
for (ui32 c = 0; c < num_comps; ++c) {
ui32 s = codestream->get_coc(c)->get_num_decompositions();
max_decs = ojph_max(max_decs, s);
}
num_tileparts = 1 + max_decs;
}
else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
{
num_tileparts = 0;
for (ui32 c = 0; c < num_comps; ++c) {
ui32 s = codestream->get_coc(c)->get_num_decompositions();
num_tileparts += s + 1;
}
}
if (num_tileparts > 255)
OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
"cannot have more than 255 tile parts.", num_tileparts);
}
this->resilient = codestream->is_resilient();
this->tile_rect = tile_rect;
ui32 tx0 = tile_rect.org.x;
ui32 ty0 = tile_rect.org.y;
ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
ui32 width = 0;
for (ui32 i = 0; i < num_comps; ++i)
{
ui8 bd; bool is; // used for nlt_type3
point downsamp = szp->get_downsampling(i);
point recon_downsamp = szp->get_recon_downsampling(i);
ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
line_offsets[i] =
recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
comp_rects[i].org.x = tcx0;
comp_rects[i].org.y = tcy0;
comp_rects[i].siz.w = tcx1 - tcx0;
comp_rects[i].siz.h = tcy1 - tcy0;
recon_comp_rects[i].org.x = recon_tcx0;
recon_comp_rects[i].org.y = recon_tcy0;
recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
recon_comp_rects[i]);
width = ojph_max(width, recon_comp_rects[i].siz.w);
num_bits[i] = szp->get_bit_depth(i);
is_signed[i] = szp->is_signed(i);
bool result = nlp->get_nonlinear_transform(i, bd, is, nlt_type3[i]);
if (result == true && (bd != num_bits[i] || is != is_signed[i]))
OJPH_ERROR(0x000300A1, "Mismatch between Ssiz (bit_depth = %d, "
"is_signed = %s) from SIZ marker segment, and BDnlt "
"(bit_depth = %d, is_signed = %s) from NLT marker segment, "
"for component %d", i, num_bits[i],
is_signed[i] ? "True" : "False", bd, is ? "True" : "False");
if (result == false)
nlt_type3[i] = param_nlt::nonlinearity::OJPH_NLT_NO_NLT;
cur_line[i] = 0;
reversible[i] = codestream->get_coc(i)->is_reversible();
}
offset += tile_rect.siz.w;
//allocate lines
const param_cod* cdp = codestream->get_cod();
this->employ_color_transform = cdp->is_employing_color_transform();
if (this->employ_color_transform)
{
num_lines = 3;
lines = allocator->post_alloc_obj<line_buf>(num_lines);
if (reversible[0])
for (int i = 0; i < 3; ++i)
lines[i].wrap(
allocator->post_alloc_data<si32>(width, 0), width, 0);
else
for (int i = 0; i < 3; ++i)
lines[i].wrap(
allocator->post_alloc_data<float>(width, 0), width, 0);
}
else
{
lines = NULL;
num_lines = 0;
}
next_tile_part = 0;
}
//////////////////////////////////////////////////////////////////////////
bool tile::push(line_buf *line, ui32 comp_num)
{
constexpr ui8 type3 =
param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
assert(comp_num < num_comps);
if (cur_line[comp_num] >= comp_rects[comp_num].siz.h)
return false;
cur_line[comp_num]++;
//converts to signed representation
//employs color transform if there is a need
if (!employ_color_transform || comp_num >= 3)
{
assert(comp_num < num_comps);
ui32 comp_width = comp_rects[comp_num].siz.w;
line_buf *tc = comps[comp_num].get_line();
if (reversible[comp_num])
{
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
rev_convert_nlt_type3(line, line_offsets[comp_num],
tc, 0, shift + 1, comp_width);
else {
shift = is_signed[comp_num] ? 0 : -shift;
rev_convert(line, line_offsets[comp_num], tc, 0,
shift, comp_width);
}
}
else
{
if (nlt_type3[comp_num] == type3)
irv_convert_to_float_nlt_type3(line, line_offsets[comp_num],
tc, num_bits[comp_num], is_signed[comp_num], comp_width);
else
irv_convert_to_float(line, line_offsets[comp_num],
tc, num_bits[comp_num], is_signed[comp_num], comp_width);
}
comps[comp_num].push_line();
}
else
{
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
ui32 comp_width = comp_rects[comp_num].siz.w;
if (reversible[comp_num])
{
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
rev_convert_nlt_type3(line, line_offsets[comp_num],
lines + comp_num, 0, shift + 1, comp_width);
else {
shift = is_signed[comp_num] ? 0 : -shift;
rev_convert(line, line_offsets[comp_num], lines + comp_num, 0,
shift, comp_width);
}
if (comp_num == 2)
{ // reversible color transform
rct_forward(lines + 0, lines + 1, lines + 2,
comps[0].get_line(),
comps[1].get_line(),
comps[2].get_line(), comp_width);
comps[0].push_line();
comps[1].push_line();
comps[2].push_line();
}
}
else
{
if (nlt_type3[comp_num] == type3)
irv_convert_to_float_nlt_type3(line, line_offsets[comp_num],
lines + comp_num, num_bits[comp_num], is_signed[comp_num],
comp_width);
else
irv_convert_to_float(line, line_offsets[comp_num],
lines + comp_num, num_bits[comp_num], is_signed[comp_num],
comp_width);
if (comp_num == 2)
{ // irreversible color transform
ict_forward(lines[0].f32, lines[1].f32, lines[2].f32,
comps[0].get_line()->f32,
comps[1].get_line()->f32,
comps[2].get_line()->f32, comp_width);
comps[0].push_line();
comps[1].push_line();
comps[2].push_line();
}
}
}
return true;
}
//////////////////////////////////////////////////////////////////////////
bool tile::pull(line_buf* tgt_line, ui32 comp_num)
{
constexpr ui8 type3 =
param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
assert(comp_num < num_comps);
if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
return false;
cur_line[comp_num]++;
if (!employ_color_transform || num_comps == 1)
{
line_buf *src_line = comps[comp_num].pull_line();
ui32 comp_width = recon_comp_rects[comp_num].siz.w;
if (reversible[comp_num])
{
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
rev_convert_nlt_type3(src_line, 0, tgt_line,
line_offsets[comp_num], shift + 1, comp_width);
else {
shift = is_signed[comp_num] ? 0 : shift;
rev_convert(src_line, 0, tgt_line,
line_offsets[comp_num], shift, comp_width);
}
}
else
{
if (nlt_type3[comp_num] == type3)
irv_convert_to_integer_nlt_type3(src_line, tgt_line,
line_offsets[comp_num], num_bits[comp_num],
is_signed[comp_num], comp_width);
else
irv_convert_to_integer(src_line, tgt_line,
line_offsets[comp_num], num_bits[comp_num],
is_signed[comp_num], comp_width);
}
}
else
{
assert(num_comps >= 3);
ui32 comp_width = recon_comp_rects[comp_num].siz.w;
if (comp_num == 0)
{
if (reversible[comp_num])
rct_backward(comps[0].pull_line(), comps[1].pull_line(),
comps[2].pull_line(), lines + 0, lines + 1,
lines + 2, comp_width);
else
ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
lines[2].f32, comp_width);
}
if (reversible[comp_num])
{
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
line_buf* src_line;
if (comp_num < 3)
src_line = lines + comp_num;
else
src_line = comps[comp_num].pull_line();
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
rev_convert_nlt_type3(src_line, 0, tgt_line,
line_offsets[comp_num], shift + 1, comp_width);
else {
shift = is_signed[comp_num] ? 0 : shift;
rev_convert(src_line, 0, tgt_line,
line_offsets[comp_num], shift, comp_width);
}
}
else
{
line_buf* lbp;
if (comp_num < 3)
lbp = lines + comp_num;
else
lbp = comps[comp_num].pull_line();
if (nlt_type3[comp_num] == type3)
irv_convert_to_integer_nlt_type3(lbp, tgt_line,
line_offsets[comp_num], num_bits[comp_num],
is_signed[comp_num], comp_width);
else
irv_convert_to_integer(lbp, tgt_line,
line_offsets[comp_num], num_bits[comp_num],
is_signed[comp_num], comp_width);
}
}
return true;
}
//////////////////////////////////////////////////////////////////////////
void tile::prepare_for_flush()
{
this->num_bytes = 0;
//prepare precinct headers
for (ui32 c = 0; c < num_comps; ++c)
num_bytes += comps[c].prepare_precincts();
}
//////////////////////////////////////////////////////////////////////////
void tile::fill_tlm(param_tlm *tlm)
{
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS) {
tlm->set_next_pair(sot.get_tile_index(), this->num_bytes);
}
else if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
{
assert(prog_order != OJPH_PO_PCRL && prog_order != OJPH_PO_CPRL);
ui32 max_decs = 0;
for (ui32 c = 0; c < num_comps; ++c)
max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
for (ui32 r = 0; r <= max_decs; ++r)
{
ui32 bytes = 0;
for (ui32 c = 0; c < num_comps; ++c)
bytes += comps[c].get_num_bytes(r);
tlm->set_next_pair(sot.get_tile_index(), bytes);
}
}
else if (tilepart_div == OJPH_TILEPART_COMPONENTS)
{
if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
{
ui32 max_decs = 0;
for (ui32 c = 0; c < num_comps; ++c)
max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
for (ui32 r = 0; r <= max_decs; ++r)
for (ui32 c = 0; c < num_comps; ++c)
if (r <= comps[c].get_num_decompositions())
tlm->set_next_pair(sot.get_tile_index(),
comps[c].get_num_bytes(r));
}
else if (prog_order == OJPH_PO_CPRL)
for (ui32 c = 0; c < num_comps; ++c)
tlm->set_next_pair(sot.get_tile_index(), comps[c].get_num_bytes());
else
assert(0); // should not be here
}
else
{
assert(prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP);
ui32 max_decs = 0;
for (ui32 c = 0; c < num_comps; ++c)
max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
for (ui32 r = 0; r <= max_decs; ++r)
for (ui32 c = 0; c < num_comps; ++c)
if (r <= comps[c].get_num_decompositions())
tlm->set_next_pair(sot.get_tile_index(),
comps[c].get_num_bytes(r));
}
}
//////////////////////////////////////////////////////////////////////////
void tile::flush(outfile_base *file)
{
ui32 max_decompositions = 0;
for (ui32 c = 0; c < num_comps; ++c)
max_decompositions = ojph_max(max_decompositions,
comps[c].get_num_decompositions());
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
{
//write tile header
if (!sot.write(file, this->num_bytes))
OJPH_ERROR(0x00030081, "Error writing to file");
//write start of data
ui16 t = swap_byte(JP2K_MARKER::SOD);
if (!file->write(&t, 2))
OJPH_ERROR(0x00030082, "Error writing to file");
}
//sequence the writing of precincts according to progression order
if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
{
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
{
for (ui32 r = 0; r <= max_decompositions; ++r)
for (ui32 c = 0; c < num_comps; ++c)
comps[c].write_precincts(r, file);
}
else if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
{
for (ui32 r = 0; r <= max_decompositions; ++r)
{
ui32 bytes = 0;
for (ui32 c = 0; c < num_comps; ++c)
bytes += comps[c].get_num_bytes(r);
//write tile header
if (!sot.write(file, bytes, (ui8)r, (ui8)(max_decompositions + 1)))
OJPH_ERROR(0x00030083, "Error writing to file");
//write start of data
ui16 t = swap_byte(JP2K_MARKER::SOD);
if (!file->write(&t, 2))
OJPH_ERROR(0x00030084, "Error writing to file");
//write precincts
for (ui32 c = 0; c < num_comps; ++c)
comps[c].write_precincts(r, file);
}
}
else
{
ui32 num_tileparts = num_comps * (max_decompositions + 1);
for (ui32 r = 0; r <= max_decompositions; ++r)
for (ui32 c = 0; c < num_comps; ++c)
if (r <= comps[c].get_num_decompositions()) {
//write tile header
if (!sot.write(file, comps[c].get_num_bytes(r),
(ui8)(c + r * num_comps), (ui8)num_tileparts))
OJPH_ERROR(0x00030085, "Error writing to file");
//write start of data
ui16 t = swap_byte(JP2K_MARKER::SOD);
if (!file->write(&t, 2))
OJPH_ERROR(0x00030086, "Error writing to file");
comps[c].write_precincts(r, file);
}
}
}
else if (prog_order == OJPH_PO_RPCL)
{
for (ui32 r = 0; r <= max_decompositions; ++r)
{
if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
{
ui32 bytes = 0;
for (ui32 c = 0; c < num_comps; ++c)
bytes += comps[c].get_num_bytes(r);
//write tile header
if (!sot.write(file, bytes, (ui8)r, (ui8)(max_decompositions + 1)))
OJPH_ERROR(0x00030087, "Error writing to file");
//write start of data
ui16 t = swap_byte(JP2K_MARKER::SOD);
if (!file->write(&t, 2))
OJPH_ERROR(0x00030088, "Error writing to file");
}
while (true)
{
bool found = false;
ui32 comp_num = 0;
point smallest(INT_MAX, INT_MAX), cur;
for (ui32 c = 0; c < num_comps; ++c)
{
if (!comps[c].get_top_left_precinct(r, cur))
continue;
else
found = true;
if (cur.y < smallest.y)
{ smallest = cur; comp_num = c; }
else if (cur.y == smallest.y && cur.x < smallest.x)
{ smallest = cur; comp_num = c; }
}
if (found == true)
comps[comp_num].write_one_precinct(r, file);
else
break;
}
}
}
else if (prog_order == OJPH_PO_PCRL)
{
while (true)
{
bool found = false;
ui32 comp_num = 0;
ui32 res_num = 0;
point smallest(INT_MAX, INT_MAX), cur;
for (ui32 c = 0; c < num_comps; ++c)
{
for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
{
if (!comps[c].get_top_left_precinct(r, cur))
continue;
else
found = true;
if (cur.y < smallest.y)
{ smallest = cur; comp_num = c; res_num = r; }
else if (cur.y == smallest.y && cur.x < smallest.x)
{ smallest = cur; comp_num = c; res_num = r; }
else if (cur.y == smallest.y && cur.x == smallest.x &&
c < comp_num)
{ smallest = cur; comp_num = c; res_num = r; }
else if (cur.y == smallest.y && cur.x == smallest.x &&
c == comp_num && r < res_num)
{ smallest = cur; comp_num = c; res_num = r; }
}
}
if (found == true)
comps[comp_num].write_one_precinct(res_num, file);
else
break;
}
}
else if (prog_order == OJPH_PO_CPRL)
{
for (ui32 c = 0; c < num_comps; ++c)
{
if (tilepart_div == OJPH_TILEPART_COMPONENTS)
{
ui32 bytes = comps[c].get_num_bytes();
//write tile header
if (!sot.write(file, bytes, (ui8)c, (ui8)num_comps))
OJPH_ERROR(0x0003008A, "Error writing to file");
//write start of data
ui16 t = swap_byte(JP2K_MARKER::SOD);
if (!file->write(&t, 2))
OJPH_ERROR(0x0003008B, "Error writing to file");
}
while (true)
{
bool found = false;
ui32 res_num = 0;
point smallest(INT_MAX, INT_MAX), cur;
for (ui32 r = 0; r <= max_decompositions; ++r)
{
if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
continue;
else
found = true;
if (cur.y < smallest.y)
{ smallest = cur; res_num = r; }
else if (cur.y == smallest.y && cur.x < smallest.x)
{ smallest = cur; res_num = r; }
}
if (found == true)
comps[c].write_one_precinct(res_num, file);
else
break;
}
}
}
else
assert(0);
}
//////////////////////////////////////////////////////////////////////////
void tile::parse_tile_header(const param_sot &sot, infile_base *file,
const ui64& tile_start_location)
{
if (sot.get_tile_part_index() != next_tile_part)
{
if (resilient)
OJPH_INFO(0x00030091, "wrong tile part index")
else
OJPH_ERROR(0x00030091, "wrong tile part index")
}
++next_tile_part;
//tile_end_location used on failure
ui64 tile_end_location = tile_start_location + sot.get_payload_length();
ui32 data_left = sot.get_payload_length(); //bytes left to parse
data_left -= (ui32)((ui64)file->tell() - tile_start_location);
if (data_left == 0)
return;
ui32 max_decompositions = 0;
for (ui32 c = 0; c < num_comps; ++c)
max_decompositions = ojph_max(max_decompositions,
comps[c].get_num_decompositions());
try
{
//sequence the reading of precincts according to progression order
if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
{
max_decompositions -= skipped_res_for_read;
for (ui32 r = 0; r <= max_decompositions; ++r)
for (ui32 c = 0; c < num_comps; ++c)
if (data_left > 0)
comps[c].parse_precincts(r, data_left, file);
}
else if (prog_order == OJPH_PO_RPCL)
{
max_decompositions -= skipped_res_for_read;
for (ui32 r = 0; r <= max_decompositions; ++r)
{
while (true)
{
bool found = false;
ui32 comp_num = 0;
point smallest(INT_MAX, INT_MAX), cur;
for (ui32 c = 0; c < num_comps; ++c)
{
if (!comps[c].get_top_left_precinct(r, cur))
continue;
else
found = true;
if (cur.y < smallest.y)
{ smallest = cur; comp_num = c; }
else if (cur.y == smallest.y && cur.x < smallest.x)
{ smallest = cur; comp_num = c; }
}
if (found == true && data_left > 0)
comps[comp_num].parse_one_precinct(r, data_left, file);
else
break;
}
}
}
else if (prog_order == OJPH_PO_PCRL)
{
while (true)
{
bool found = false;
ui32 comp_num = 0;
ui32 res_num = 0;
point smallest(INT_MAX, INT_MAX), cur;
for (ui32 c = 0; c < num_comps; ++c)
{
for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
{
if (!comps[c].get_top_left_precinct(r, cur))
continue;
else
found = true;
if (cur.y < smallest.y)
{ smallest = cur; comp_num = c; res_num = r; }
else if (cur.y == smallest.y && cur.x < smallest.x)
{ smallest = cur; comp_num = c; res_num = r; }
else if (cur.y == smallest.y && cur.x == smallest.x &&
c < comp_num)
{ smallest = cur; comp_num = c; res_num = r; }
else if (cur.y == smallest.y && cur.x == smallest.x &&
c == comp_num && r < res_num)
{ smallest = cur; comp_num = c; res_num = r; }
}
}
if (found == true && data_left > 0)
comps[comp_num].parse_one_precinct(res_num, data_left, file);
else
break;
}
}
else if (prog_order == OJPH_PO_CPRL)
{
for (ui32 c = 0; c < num_comps; ++c)
{
while (true)
{
bool found = false;
ui32 res_num = 0;
point smallest(INT_MAX, INT_MAX), cur;
for (ui32 r = 0; r <= max_decompositions; ++r)
{
if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
continue;
else
found = true;
if (cur.y < smallest.y)
{ smallest = cur; res_num = r; }
else if (cur.y == smallest.y && cur.x < smallest.x)
{ smallest = cur; res_num = r; }
}
if (found == true && data_left > 0)
comps[c].parse_one_precinct(res_num, data_left, file);
else
break;
}
}
}
else
assert(0);
}
catch (const char *error)
{
if (resilient)
OJPH_INFO(0x00030092, "%s", error)
else
OJPH_ERROR(0x00030092, "%s", error)
}
file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
}
}
}
+112
View File
@@ -0,0 +1,112 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_tile.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_TILE_H
#define OJPH_TILE_H
#include "ojph_defs.h"
#include "ojph_file.h"
#include "ojph_params_local.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class line_buf;
class codestream;
namespace local {
//////////////////////////////////////////////////////////////////////////
//defined here
class tile_comp;
//////////////////////////////////////////////////////////////////////////
class tile
{
public:
static void pre_alloc(codestream *codestream, const rect& tile_rect,
const rect& recon_tile_rect, ui32 &num_tileparts);
void finalize_alloc(codestream *codestream, const rect& tile_rect,
ui32 tile_idx, ui32& offset, ui32 &num_tileparts);
bool push(line_buf *line, ui32 comp_num);
void prepare_for_flush();
void fill_tlm(param_tlm* tlm);
void flush(outfile_base *file);
void parse_tile_header(const param_sot& sot, infile_base *file,
const ui64& tile_start_location);
bool pull(line_buf *, ui32 comp_num);
rect get_tile_rect() { return tile_rect; }
private:
//codestream *parent;
rect tile_rect;
ui32 num_comps;
tile_comp *comps;
ui32 num_lines;
line_buf* lines;
bool employ_color_transform, resilient;
bool *reversible;
rect *comp_rects, *recon_comp_rects;
ui32 *line_offsets;
ui32 skipped_res_for_read;
ui32 *num_bits;
bool *is_signed;
ui32 *cur_line;
ui8 *nlt_type3;
int prog_order;
private:
param_sot sot;
int next_tile_part;
private:
int profile;
ui32 tilepart_div; // tilepart division value
bool need_tlm; // true if tlm markers are needed
ui32 num_bytes; // number of bytes in this tile
// used for tile length
};
}
}
#endif // !OJPH_TILE_H
+200
View File
@@ -0,0 +1,200 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_tile_comp.cpp
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#include <climits>
#include <cmath>
#include "ojph_mem.h"
#include "ojph_params.h"
#include "ojph_codestream_local.h"
#include "ojph_tile_comp.h"
#include "ojph_resolution.h"
namespace ojph {
namespace local
{
//////////////////////////////////////////////////////////////////////////
void tile_comp::pre_alloc(codestream *codestream, ui32 comp_num,
const rect& comp_rect,
const rect& recon_comp_rect)
{
mem_fixed_allocator* allocator = codestream->get_allocator();
//allocate a resolution
ui32 num_decomps;
num_decomps = codestream->get_coc(comp_num)->get_num_decompositions();
allocator->pre_alloc_obj<resolution>(1);
resolution::pre_alloc(codestream, comp_rect, recon_comp_rect, comp_num,
num_decomps);
}
//////////////////////////////////////////////////////////////////////////
void tile_comp::finalize_alloc(codestream *codestream, tile *parent,
ui32 comp_num, const rect& comp_rect,
const rect& recon_comp_rect)
{
mem_fixed_allocator* allocator = codestream->get_allocator();
//allocate a resolution
num_decomps = codestream->get_coc(comp_num)->get_num_decompositions();
comp_downsamp = codestream->get_siz()->get_downsampling(comp_num);
this->comp_rect = comp_rect;
this->parent_tile = parent;
this->comp_num = comp_num;
this->num_bytes = 0;
res = allocator->post_alloc_obj<resolution>(1);
res->finalize_alloc(codestream, comp_rect, recon_comp_rect, comp_num,
num_decomps, comp_downsamp, comp_downsamp, this,
NULL);
}
//////////////////////////////////////////////////////////////////////////
line_buf* tile_comp::get_line()
{
return res->get_line();
}
//////////////////////////////////////////////////////////////////////////
void tile_comp::push_line()
{
res->push_line();
}
//////////////////////////////////////////////////////////////////////////
line_buf* tile_comp::pull_line()
{
return res->pull_line();
}
//////////////////////////////////////////////////////////////////////////
ui32 tile_comp::prepare_precincts()
{
this->num_bytes = res->prepare_precinct();
return this->num_bytes;
}
//////////////////////////////////////////////////////////////////////////
void tile_comp::write_precincts(ui32 res_num, outfile_base *file)
{
assert(res_num <= num_decomps);
res_num = num_decomps - res_num; //how many levels to go down
resolution *r = res;
while (res_num > 0 && r != NULL)
{
r = r->next_resolution();
--res_num;
}
if (r) //resolution does not exist if r is NULL
r->write_precincts(file);
}
//////////////////////////////////////////////////////////////////////////
bool tile_comp::get_top_left_precinct(ui32 res_num, point &top_left)
{
int resolution_num = (int)num_decomps - (int)res_num;
resolution *r = res;
while (resolution_num > 0 && r != NULL)
{
r = r->next_resolution();
--resolution_num;
}
if (r) //resolution does not exist if r is NULL
return r->get_top_left_precinct(top_left);
else
return false;
}
//////////////////////////////////////////////////////////////////////////
void tile_comp::write_one_precinct(ui32 res_num, outfile_base *file)
{
int resolution_num = (int)num_decomps - (int)res_num;
resolution *r = res;
while (resolution_num > 0 && r != NULL)
{
r = r->next_resolution();
--resolution_num;
}
if (r) //resolution does not exist if r is NULL
r->write_one_precinct(file);
}
//////////////////////////////////////////////////////////////////////////
void tile_comp::parse_precincts(ui32 res_num, ui32& data_left,
infile_base *file)
{
assert(res_num <= num_decomps);
res_num = num_decomps - res_num; //how many levels to go down
resolution *r = res;
while (res_num > 0 && r != NULL)
{
r = r->next_resolution();
--res_num;
}
if (r) //resolution does not exist if r is NULL
r->parse_all_precincts(data_left, file);
}
//////////////////////////////////////////////////////////////////////////
void tile_comp::parse_one_precinct(ui32 res_num, ui32& data_left,
infile_base *file)
{
assert(res_num <= num_decomps);
res_num = num_decomps - res_num;
resolution *r = res;
while (res_num > 0 && r != NULL)
{
r = r->next_resolution();
--res_num;
}
if (r) //resolution does not exist if r is NULL
r->parse_one_precinct(data_left, file);
}
//////////////////////////////////////////////////////////////////////////
ui32 tile_comp::get_num_bytes(ui32 resolution_num) const
{
return res->get_num_bytes(resolution_num);
}
}
}
+104
View File
@@ -0,0 +1,104 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_tile_comp.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_TILE_COMP_H
#define OJPH_TILE_COMP_H
#include "ojph_defs.h"
#include "ojph_base.h"
#include "ojph_file.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
//defined elsewhere
class line_buf;
class codestream;
namespace local {
//////////////////////////////////////////////////////////////////////////
//defined here
class tile;
class resolution;
//////////////////////////////////////////////////////////////////////////
class tile_comp
{
public:
static void pre_alloc(codestream *codestream, ui32 comp_num,
const rect& comp_rect,
const rect& recon_comp_rect);
void finalize_alloc(codestream *codestream, tile *parent,
ui32 comp_num, const rect& comp_rect,
const rect& recon_comp_rect);
ui32 get_num_resolutions() { return num_decomps + 1; }
ui32 get_num_decompositions() { return num_decomps; }
tile* get_tile() { return parent_tile; }
line_buf* get_line();
void push_line();
line_buf* pull_line();
ui32 prepare_precincts();
void write_precincts(ui32 res_num, outfile_base *file);
bool get_top_left_precinct(ui32 res_num, point &top_left);
void write_one_precinct(ui32 res_num, outfile_base *file);
void parse_precincts(ui32 res_num, ui32& data_left, infile_base *file);
void parse_one_precinct(ui32 res_num, ui32& data_left,
infile_base *file);
ui32 get_num_bytes() const { return num_bytes; }
ui32 get_num_bytes(ui32 resolution_num) const;
private:
tile *parent_tile;
resolution *res;
rect comp_rect;
ojph::point comp_downsamp;
ui32 num_decomps;
ui32 comp_num;
ui32 num_bytes; // number of bytes in this tile component
// used for tilepart length
};
}
}
#endif // !OJPH_TILE_COMP_H
+345
View File
@@ -0,0 +1,345 @@
/***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_block_common.cpp
// Author: Aous Naman
// Date: 13 May 2022
//***************************************************************************/
#include <cassert>
#include <cstddef>
#include <cstring>
#include "ojph_block_common.h"
//***************************************************************************/
/** @file ojph_block_common.cpp
* @brief defines tables used for decoding HTJ2K blocks
*/
namespace ojph {
namespace local {
//************************************************************************/
/** @defgroup vlc_decoding_tables_grp VLC decoding tables
* @{
* VLC decoding tables used in decoding VLC codewords to these fields: \n
* \li \c cwd_len : 3bits -> the codeword length of the VLC codeword;
* the VLC cwd is in the LSB of bitstream \n
* \li \c u_off : 1bit -> u_offset, which is 1 if u value is not 0 \n
* \li \c rho : 4bits -> significant samples within a quad \n
* \li \c e_1 : 4bits -> EMB e_1 \n
* \li \c e_k : 4bits -> EMB e_k \n
* \n
* The table index is 10 bits and composed of two parts: \n
* The 7 LSBs contain a codeword which might be shorter than 7 bits;
* this word is the next decodable bits in the bitstream. \n
* The 3 MSB is the context of for the codeword. \n
*/
/// @brief vlc_tbl0 contains decoding information for initial row of quads
ui16 vlc_tbl0[1024] = { 0 };
/// @brief vlc_tbl1 contains decoding information for non-initial row of
/// quads
ui16 vlc_tbl1[1024] = { 0 };
/// @}
//************************************************************************/
/** @defgroup uvlc_decoding_tables_grp VLC decoding tables
* @{
* UVLC decoding tables used to partially decode u values from UVLC
* codewords. \n
* The table index is 8 (or 9) bits and composed of two parts: \n
* The 6 LSBs carries the head of the VLC to be decoded. Up to 6 bits to
* be used; these are uvlc prefix code for quad 0 and 1 \n
* The 2 (or 3) MSBs contain u_off of quad 0 + 2 * o_off quad 1
* + 4 * mel event for initial row of quads when needed \n
* \n
* Each entry contains, starting from the LSB \n
* \li \c total total prefix length for quads 0 and 1 (3 bits) \n
* \li \c total total suffix length for quads 0 and 1 (4 bits) \n
* \li \c suffix length for quad 0 (3 bits) \n
* \li \c prefix for quad 0 (3 bits) \n
* \li \c prefix for quad 1 (3 bits) \n
* \n
* Another table is uvlc_bias, which is needed to correctly decode the
* extension u_ext for initial row of quads. Under certain condition,
* we deduct 1 or 2 from u_q0 and u_q1 before encoding them; so for us
* to know that decoding u_ext is needed, we recreate the u_q0 and u_q1
* that we actually encoded. \n
* For simplicity, we use the same index as before \n
* \li \c u_q0 bias is 2 bits \n
* \li \c u_q1 bias is 2 bits \n
*/
/// @brief uvlc_tbl0 contains decoding information for initial row of quads
ui16 uvlc_tbl0[256+64] = { 0 };
/// @brief uvlc_tbl1 contains decoding information for non-initial row of
/// quads
ui16 uvlc_tbl1[256] = { 0 };
/// @brief uvlc_bias contains decoding info. for initial row of quads
ui8 uvlc_bias[256+64] = { 0 };
/// @}
//************************************************************************/
/** @ingroup vlc_decoding_tables_grp
* @brief Initializes vlc_tbl0 and vlc_tbl1 tables, from table0.h and
* table1.h
*/
static bool vlc_init_tables()
{
const bool debug = false; //useful for checking
//Data in the table is arranged in this format (taken from the standard)
// c_q is the context for a quad
// rho is the significance pattern for a quad
// u_off indicate if u value is 0 (u_off is 0), or communicated
// e_k, e_1 EMB patterns
// cwd VLC codeword
// cwd VLC codeword length
struct vlc_src_table { int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; };
// initial quad rows
vlc_src_table tbl0[] = {
#include "table0.h"
};
// number of entries in the table
size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table);
// nono-initial quad rows
vlc_src_table tbl1[] = {
#include "table1.h"
};
// number of entries in the table
size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table);
if (debug) memset(vlc_tbl0, 0, sizeof(vlc_tbl0)); //unnecessary
// this is to convert table entries into values for decoder look up
// There can be at most 1024 possibilities, not all of them are valid.
//
for (int i = 0; i < 1024; ++i)
{
int cwd = i & 0x7F; // from i extract codeword
int c_q = i >> 7; // from i extract context
// See if this case exist in the table, if so then set the entry in
// vlc_tbl0
for (size_t j = 0; j < tbl0_size; ++j)
if (tbl0[j].c_q == c_q) // this is an and operation
if (tbl0[j].cwd == (cwd & ((1 << tbl0[j].cwd_len) - 1)))
{
if (debug) assert(vlc_tbl0[i] == 0);
// Put this entry into the table
vlc_tbl0[i] = (ui16)((tbl0[j].rho << 4) | (tbl0[j].u_off << 3)
| (tbl0[j].e_k << 12) | (tbl0[j].e_1 << 8) | tbl0[j].cwd_len);
}
}
if (debug) memset(vlc_tbl1, 0, sizeof(vlc_tbl1)); //unnecessary
// this the same as above but for non-initial rows
for (int i = 0; i < 1024; ++i)
{
int cwd = i & 0x7F; //7 bits
int c_q = i >> 7;
for (size_t j = 0; j < tbl1_size; ++j)
if (tbl1[j].c_q == c_q) // this is an and operation
if (tbl1[j].cwd == (cwd & ((1 << tbl1[j].cwd_len) - 1)))
{
if (debug) assert(vlc_tbl1[i] == 0);
vlc_tbl1[i] = (ui16)((tbl1[j].rho << 4) | (tbl1[j].u_off << 3)
| (tbl1[j].e_k << 12) | (tbl1[j].e_1 << 8) | tbl1[j].cwd_len);
}
}
return true;
}
//************************************************************************/
/** @ingroup uvlc_decoding_tables_grp
* @brief Initializes uvlc_tbl0 and uvlc_tbl1 tables
*/
static bool uvlc_init_tables()
{
// table stores possible decoding three bits from vlc
// there are 8 entries for xx1, x10, 100, 000, where x means do not
// care table value is made up of
// 2 bits in the LSB for prefix length
// 3 bits for suffix length
// 3 bits in the MSB for prefix value (u_pfx in Table 3 of ITU T.814)
static const ui8 dec[8] = { // the index is the prefix codeword
3 | (5 << 2) | (5 << 5), //000 == 000, prefix codeword "000"
1 | (0 << 2) | (1 << 5), //001 == xx1, prefix codeword "1"
2 | (0 << 2) | (2 << 5), //010 == x10, prefix codeword "01"
1 | (0 << 2) | (1 << 5), //011 == xx1, prefix codeword "1"
3 | (1 << 2) | (3 << 5), //100 == 100, prefix codeword "001"
1 | (0 << 2) | (1 << 5), //101 == xx1, prefix codeword "1"
2 | (0 << 2) | (2 << 5), //110 == x10, prefix codeword "01"
1 | (0 << 2) | (1 << 5) //111 == xx1, prefix codeword "1"
};
for (ui32 i = 0; i < 256 + 64; ++i)
{
ui32 mode = i >> 6;
ui32 vlc = i & 0x3F;
if (mode == 0) { // both u_off are 0
uvlc_tbl0[i] = 0;
uvlc_bias[i] = 0;
}
else if (mode <= 2) // u_off are either 01 or 10
{
ui32 d = dec[vlc & 0x7]; //look at the least significant 3 bits
ui32 total_prefix = d & 0x3;
ui32 total_suffix = (d >> 2) & 0x7;
ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
ui32 u0 = (mode == 1) ? (d >> 5) : 0;
ui32 u1 = (mode == 1) ? 0 : (d >> 5);
uvlc_tbl0[i] = (ui16)(total_prefix |
(total_suffix << 3) |
(u0_suffix_len << 7) |
(u0 << 10) |
(u1 << 13));
}
else if (mode == 3) // both u_off are 1, and MEL event is 0
{
ui32 d0 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
vlc >>= d0 & 0x3; // Consume bits
ui32 d1 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
ui32 total_prefix, u0_suffix_len, total_suffix, u0, u1;
if ((d0 & 0x3) == 3)
{
total_prefix = (d0 & 0x3) + 1;
u0_suffix_len = (d0 >> 2) & 0x7;
total_suffix = u0_suffix_len;
u0 = d0 >> 5;
u1 = (vlc & 1) + 1;
uvlc_bias[i] = 4; // 0b00 for u0 and 0b01 for u1
}
else
{
total_prefix = (d0 & 0x3) + (d1 & 0x3);
u0_suffix_len = (d0 >> 2) & 0x7;
total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
u0 = d0 >> 5;
u1 = d1 >> 5;
uvlc_bias[i] = 0;
}
uvlc_tbl0[i] = (ui16)(total_prefix |
(total_suffix << 3) |
(u0_suffix_len << 7) |
(u0 << 10) |
(u1 << 13));
}
else if (mode == 4) // both u_off are 1, and MEL event is 1
{
ui32 d0 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
vlc >>= d0 & 0x3; // Consume bits
ui32 d1 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
ui32 u0_suffix_len = (d0 >> 2) & 0x7;
ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
ui32 u0 = (d0 >> 5) + 2;
ui32 u1 = (d1 >> 5) + 2;
uvlc_tbl0[i] = (ui16)(total_prefix |
(total_suffix << 3) |
(u0_suffix_len << 7) |
(u0 << 10) |
(u1 << 13));
uvlc_bias[i] = 10; // 0b10 for u0 and 0b10 for u1
}
}
for (ui32 i = 0; i < 256; ++i)
{
ui32 mode = i >> 6;
ui32 vlc = i & 0x3F;
if (mode == 0) // both u_off are 0
uvlc_tbl1[i] = 0;
else if (mode <= 2) // u_off are either 01 or 10
{
ui32 d = dec[vlc & 0x7]; // look at the 3 LSB bits
ui32 total_prefix = d & 0x3;
ui32 total_suffix = (d >> 2) & 0x7;
ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
ui32 u0 = (mode == 1) ? (d >> 5) : 0;
ui32 u1 = (mode == 1) ? 0 : (d >> 5);
uvlc_tbl1[i] = (ui16)(total_prefix |
(total_suffix << 3) |
(u0_suffix_len << 7) |
(u0 << 10) |
(u1 << 13));
}
else if (mode == 3) // both u_off are 1
{
ui32 d0 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
vlc >>= d0 & 0x3; // Consume bits
ui32 d1 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
ui32 u0_suffix_len = (d0 >> 2) & 0x7;
ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
ui32 u0 = d0 >> 5;
ui32 u1 = d1 >> 5;
uvlc_tbl1[i] = (ui16)(total_prefix |
(total_suffix << 3) |
(u0_suffix_len << 7) |
(u0 << 10) |
(u1 << 13));
}
}
return true;
}
//************************************************************************/
/** @ingroup vlc_decoding_tables_grp
* @brief Initializes VLC tables vlc_tbl0 and vlc_tbl1
*/
static bool vlc_tables_initialized = vlc_init_tables();
//************************************************************************/
/** @ingroup uvlc_decoding_tables_grp
* @brief Initializes UVLC tables uvlc_tbl0 and uvlc_tbl1
*/
static bool uvlc_tables_initialized = uvlc_init_tables();
} // !namespace local
} // !namespace ojph
+49
View File
@@ -0,0 +1,49 @@
/***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2022, Aous Naman
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2022, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_block_common.h
// Author: Aous Naman
// Date: 13 May 2022
//***************************************************************************/
#include "ojph_defs.h"
namespace ojph{
namespace local {
extern ui16 vlc_tbl0[1024];
extern ui16 vlc_tbl1[1024];
extern ui16 uvlc_tbl0[256+64];
extern ui16 uvlc_tbl1[256];
extern ui8 uvlc_bias[256+64];
} // !namespace local
} // !namespace ojph
+83
View File
@@ -0,0 +1,83 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_block_decoder.h
// Author: Aous Naman
// Date: 28 August 2019
//***************************************************************************/
#ifndef OJPH_BLOCK_DECODER_H
#define OJPH_BLOCK_DECODER_H
#include "ojph_defs.h"
namespace ojph {
namespace local {
//////////////////////////////////////////////////////////////////////////
//decodes the cleanup pass, significance propagation pass,
// and magnitude refinement pass
// generic decoder
bool
ojph_decode_codeblock32(ui8* coded_data, ui32* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
bool
ojph_decode_codeblock64(ui8* coded_data, ui64* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
// SSSE3-accelerated decoder
bool
ojph_decode_codeblock_ssse3(ui8* coded_data, ui32* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
// AVX2-accelerated decoder
bool
ojph_decode_codeblock_avx2(ui8* coded_data, ui32* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
// WASM SIMD-accelerated decoder
bool
ojph_decode_codeblock_wasm(ui8* coded_data, ui32* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
}
}
#endif // !OJPH_BLOCK_DECODER_H
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+88
View File
@@ -0,0 +1,88 @@
//***************************************************************************/
// This software is released under the 2-Clause BSD license, included
// below.
//
// Copyright (c) 2019, Aous Naman
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
// Copyright (c) 2019, The University of New South Wales, Australia
//
// 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.
//
// 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.
//***************************************************************************/
// This file is part of the OpenJPH software implementation.
// File: ojph_block_encoder.h
// Author: Aous Naman
// Date: 17 September 2019
//***************************************************************************/
#ifndef OJPH_BLOCK_ENCODER_H
#define OJPH_BLOCK_ENCODER_H
#include "ojph_defs.h"
namespace ojph {
////////////////////////////////////////////////////////////////////////////
// defined elsewhere
class mem_elastic_allocator;
struct coded_lists;
namespace local {
//////////////////////////////////////////////////////////////////////////
void
ojph_encode_codeblock32(ui32* buf, ui32 missing_msbs, ui32 num_passes,
ui32 width, ui32 height, ui32 stride,
ui32* lengths,
ojph::mem_elastic_allocator *elastic,
ojph::coded_lists *& coded);
void
ojph_encode_codeblock64(ui64* buf, ui32 missing_msbs, ui32 num_passes,
ui32 width, ui32 height, ui32 stride,
ui32* lengths,
ojph::mem_elastic_allocator *elastic,
ojph::coded_lists *& coded);
void
ojph_encode_codeblock_avx2(ui32* buf, ui32 missing_msbs,
ui32 num_passes, ui32 width, ui32 height,
ui32 stride, ui32* lengths,
ojph::mem_elastic_allocator* elastic,
ojph::coded_lists*& coded);
void
ojph_encode_codeblock_avx512(ui32* buf, ui32 missing_msbs,
ui32 num_passes, ui32 width, ui32 height,
ui32 stride, ui32* lengths,
ojph::mem_elastic_allocator *elastic,
ojph::coded_lists *& coded);
bool initialize_block_encoder_tables();
bool initialize_block_encoder_tables_avx2();
bool initialize_block_encoder_tables_avx512();
}
}
#endif // !OJPH_BLOCK_ENCODER_H
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+444
View File
@@ -0,0 +1,444 @@
{0, 0x1, 0x0, 0x0, 0x0, 0x06, 4},
{0, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
{0, 0x2, 0x0, 0x0, 0x0, 0x00, 3},
{0, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
{0, 0x3, 0x0, 0x0, 0x0, 0x11, 5},
{0, 0x3, 0x1, 0x2, 0x2, 0x5F, 7},
{0, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
{0, 0x4, 0x1, 0x4, 0x4, 0x13, 6},
{0, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
{0, 0x5, 0x1, 0x4, 0x4, 0x23, 6},
{0, 0x5, 0x1, 0x5, 0x1, 0x0F, 7},
{0, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
{0, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
{0, 0x7, 0x0, 0x0, 0x0, 0x2F, 7},
{0, 0x7, 0x1, 0x2, 0x2, 0x4F, 7},
{0, 0x7, 0x1, 0x2, 0x0, 0x0D, 6},
{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
{0, 0x8, 0x1, 0x8, 0x8, 0x3D, 6},
{0, 0x9, 0x0, 0x0, 0x0, 0x1D, 6},
{0, 0x9, 0x1, 0x0, 0x0, 0x2D, 6},
{0, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
{0, 0xA, 0x1, 0x8, 0x8, 0x35, 6},
{0, 0xA, 0x1, 0xA, 0x2, 0x77, 7},
{0, 0xB, 0x0, 0x0, 0x0, 0x37, 7},
{0, 0xB, 0x1, 0x1, 0x1, 0x57, 7},
{0, 0xB, 0x1, 0x1, 0x0, 0x09, 6},
{0, 0xC, 0x0, 0x0, 0x0, 0x1E, 5},
{0, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
{0, 0xC, 0x1, 0xC, 0x4, 0x15, 6},
{0, 0xC, 0x1, 0xC, 0x8, 0x25, 6},
{0, 0xD, 0x0, 0x0, 0x0, 0x67, 7},
{0, 0xD, 0x1, 0x1, 0x1, 0x27, 7},
{0, 0xD, 0x1, 0x5, 0x4, 0x47, 7},
{0, 0xD, 0x1, 0xD, 0x8, 0x07, 7},
{0, 0xE, 0x0, 0x0, 0x0, 0x7B, 7},
{0, 0xE, 0x1, 0x2, 0x2, 0x4B, 7},
{0, 0xE, 0x1, 0xA, 0x8, 0x05, 6},
{0, 0xE, 0x1, 0xE, 0x4, 0x3B, 7},
{0, 0xF, 0x0, 0x0, 0x0, 0x5B, 7},
{0, 0xF, 0x1, 0x9, 0x9, 0x1B, 7},
{0, 0xF, 0x1, 0xB, 0xA, 0x6B, 7},
{0, 0xF, 0x1, 0xF, 0xC, 0x2B, 7},
{0, 0xF, 0x1, 0xF, 0x8, 0x39, 6},
{0, 0xF, 0x1, 0xE, 0x6, 0x73, 7},
{0, 0xF, 0x1, 0xE, 0x2, 0x19, 6},
{0, 0xF, 0x1, 0xF, 0x5, 0x0B, 7},
{0, 0xF, 0x1, 0xF, 0x4, 0x29, 6},
{0, 0xF, 0x1, 0xF, 0x1, 0x33, 7},
{1, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
{1, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
{1, 0x1, 0x1, 0x1, 0x1, 0x1F, 7},
{1, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
{1, 0x2, 0x1, 0x2, 0x2, 0x3B, 6},
{1, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
{1, 0x3, 0x1, 0x0, 0x0, 0x3D, 6},
{1, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
{1, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
{1, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
{1, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
{1, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
{1, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
{1, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
{1, 0x7, 0x0, 0x0, 0x0, 0x3F, 7},
{1, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
{1, 0x7, 0x1, 0x2, 0x0, 0x03, 6},
{1, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
{1, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
{1, 0x9, 0x0, 0x0, 0x0, 0x2D, 6},
{1, 0x9, 0x1, 0x0, 0x0, 0x0D, 6},
{1, 0xA, 0x0, 0x0, 0x0, 0x35, 6},
{1, 0xA, 0x1, 0x8, 0x8, 0x15, 6},
{1, 0xA, 0x1, 0xA, 0x2, 0x6F, 7},
{1, 0xB, 0x0, 0x0, 0x0, 0x2F, 7},
{1, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
{1, 0xB, 0x1, 0x1, 0x0, 0x11, 6},
{1, 0xC, 0x0, 0x0, 0x0, 0x01, 5},
{1, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
{1, 0xC, 0x1, 0xC, 0x4, 0x05, 6},
{1, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
{1, 0xD, 0x1, 0x1, 0x1, 0x17, 7},
{1, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
{1, 0xD, 0x1, 0xD, 0x8, 0x77, 7},
{1, 0xE, 0x0, 0x0, 0x0, 0x37, 7},
{1, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
{1, 0xE, 0x1, 0xA, 0x8, 0x19, 6},
{1, 0xE, 0x1, 0xE, 0x4, 0x67, 7},
{1, 0xF, 0x0, 0x0, 0x0, 0x07, 7},
{1, 0xF, 0x1, 0xB, 0x8, 0x29, 6},
{1, 0xF, 0x1, 0x8, 0x8, 0x27, 7},
{1, 0xF, 0x1, 0xA, 0x2, 0x09, 6},
{1, 0xF, 0x1, 0xE, 0x4, 0x31, 6},
{1, 0xF, 0x1, 0xF, 0x1, 0x47, 7},
{2, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
{2, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
{2, 0x1, 0x1, 0x1, 0x1, 0x1B, 6},
{2, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
{2, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
{2, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
{2, 0x3, 0x1, 0x1, 0x1, 0x33, 6},
{2, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
{2, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
{2, 0x4, 0x1, 0x4, 0x4, 0x0B, 6},
{2, 0x5, 0x0, 0x0, 0x0, 0x01, 5},
{2, 0x5, 0x1, 0x5, 0x5, 0x2F, 7},
{2, 0x5, 0x1, 0x5, 0x1, 0x13, 6},
{2, 0x5, 0x1, 0x5, 0x4, 0x23, 6},
{2, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
{2, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
{2, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
{2, 0x7, 0x1, 0x2, 0x2, 0x6F, 7},
{2, 0x7, 0x1, 0x3, 0x1, 0x11, 6},
{2, 0x7, 0x1, 0x7, 0x4, 0x37, 7},
{2, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
{2, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
{2, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
{2, 0x9, 0x1, 0x0, 0x0, 0x1D, 6},
{2, 0xA, 0x0, 0x0, 0x0, 0x2D, 6},
{2, 0xA, 0x1, 0x0, 0x0, 0x0D, 6},
{2, 0xB, 0x0, 0x0, 0x0, 0x0F, 7},
{2, 0xB, 0x1, 0x2, 0x2, 0x77, 7},
{2, 0xB, 0x1, 0x2, 0x0, 0x35, 6},
{2, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
{2, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
{2, 0xC, 0x1, 0xC, 0x8, 0x57, 7},
{2, 0xD, 0x0, 0x0, 0x0, 0x17, 7},
{2, 0xD, 0x1, 0x8, 0x8, 0x05, 6},
{2, 0xD, 0x1, 0xC, 0x4, 0x39, 6},
{2, 0xD, 0x1, 0xD, 0x1, 0x67, 7},
{2, 0xE, 0x0, 0x0, 0x0, 0x27, 7},
{2, 0xE, 0x1, 0x2, 0x2, 0x7B, 7},
{2, 0xE, 0x1, 0x2, 0x0, 0x19, 6},
{2, 0xF, 0x0, 0x0, 0x0, 0x47, 7},
{2, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
{2, 0xF, 0x1, 0x1, 0x1, 0x09, 6},
{2, 0xF, 0x1, 0x3, 0x2, 0x07, 7},
{2, 0xF, 0x1, 0x7, 0x4, 0x31, 6},
{2, 0xF, 0x1, 0xF, 0x8, 0x3B, 7},
{3, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
{3, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
{3, 0x1, 0x1, 0x1, 0x1, 0x3D, 6},
{3, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
{3, 0x2, 0x1, 0x2, 0x2, 0x4F, 7},
{3, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
{3, 0x3, 0x1, 0x1, 0x1, 0x05, 6},
{3, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
{3, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
{3, 0x5, 0x0, 0x0, 0x0, 0x06, 5},
{3, 0x5, 0x1, 0x5, 0x5, 0x1A, 5},
{3, 0x5, 0x1, 0x5, 0x1, 0x0D, 6},
{3, 0x5, 0x1, 0x5, 0x4, 0x35, 6},
{3, 0x6, 0x0, 0x0, 0x0, 0x3F, 7},
{3, 0x6, 0x1, 0x4, 0x4, 0x5F, 7},
{3, 0x6, 0x1, 0x6, 0x2, 0x1F, 7},
{3, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
{3, 0x7, 0x1, 0x6, 0x6, 0x2F, 7},
{3, 0x7, 0x1, 0x6, 0x4, 0x15, 6},
{3, 0x7, 0x1, 0x7, 0x3, 0x77, 7},
{3, 0x7, 0x1, 0x7, 0x1, 0x25, 6},
{3, 0x7, 0x1, 0x7, 0x2, 0x0F, 7},
{3, 0x8, 0x0, 0x0, 0x0, 0x0A, 5},
{3, 0x8, 0x1, 0x8, 0x8, 0x07, 7},
{3, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
{3, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
{3, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
{3, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
{3, 0xA, 0x1, 0x8, 0x8, 0x29, 6},
{3, 0xA, 0x1, 0xA, 0x2, 0x17, 7},
{3, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
{3, 0xB, 0x1, 0xB, 0x1, 0x27, 7},
{3, 0xB, 0x1, 0x1, 0x1, 0x47, 7},
{3, 0xB, 0x1, 0x3, 0x2, 0x09, 6},
{3, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
{3, 0xC, 0x0, 0x0, 0x0, 0x31, 6},
{3, 0xC, 0x1, 0x4, 0x4, 0x11, 6},
{3, 0xC, 0x1, 0xC, 0x8, 0x3B, 7},
{3, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
{3, 0xD, 0x1, 0x9, 0x9, 0x1B, 7},
{3, 0xD, 0x1, 0xD, 0x5, 0x2B, 7},
{3, 0xD, 0x1, 0xD, 0x1, 0x21, 6},
{3, 0xD, 0x1, 0xD, 0xC, 0x6B, 7},
{3, 0xD, 0x1, 0xD, 0x4, 0x01, 6},
{3, 0xD, 0x1, 0xD, 0x8, 0x4B, 7},
{3, 0xE, 0x0, 0x0, 0x0, 0x0B, 7},
{3, 0xE, 0x1, 0xE, 0x4, 0x73, 7},
{3, 0xE, 0x1, 0x4, 0x4, 0x13, 7},
{3, 0xE, 0x1, 0xC, 0x8, 0x3E, 6},
{3, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
{3, 0xF, 0x0, 0x0, 0x0, 0x53, 7},
{3, 0xF, 0x1, 0xA, 0xA, 0x0E, 6},
{3, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
{3, 0xF, 0x1, 0xF, 0xC, 0x03, 7},
{3, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
{3, 0xF, 0x1, 0xE, 0x6, 0x23, 7},
{3, 0xF, 0x1, 0xF, 0x5, 0x1E, 6},
{3, 0xF, 0x1, 0xF, 0x4, 0x02, 5},
{3, 0xF, 0x1, 0xF, 0x3, 0x43, 7},
{3, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
{3, 0xF, 0x1, 0xF, 0x2, 0x2E, 6},
{4, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
{4, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
{4, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
{4, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
{4, 0x2, 0x1, 0x2, 0x2, 0x1B, 6},
{4, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
{4, 0x3, 0x1, 0x2, 0x2, 0x3D, 6},
{4, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
{4, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
{4, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
{4, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
{4, 0x5, 0x1, 0x0, 0x0, 0x33, 6},
{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
{4, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
{4, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
{4, 0x7, 0x1, 0x4, 0x4, 0x6F, 7},
{4, 0x7, 0x1, 0x4, 0x0, 0x03, 6},
{4, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
{4, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
{4, 0x9, 0x0, 0x0, 0x0, 0x11, 6},
{4, 0x9, 0x1, 0x0, 0x0, 0x77, 7},
{4, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
{4, 0xA, 0x1, 0xA, 0xA, 0x2F, 7},
{4, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
{4, 0xA, 0x1, 0xA, 0x8, 0x0D, 6},
{4, 0xB, 0x0, 0x0, 0x0, 0x4F, 7},
{4, 0xB, 0x1, 0xB, 0x2, 0x0F, 7},
{4, 0xB, 0x1, 0x0, 0x0, 0x35, 6},
{4, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
{4, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
{4, 0xC, 0x1, 0xC, 0x4, 0x37, 7},
{4, 0xD, 0x0, 0x0, 0x0, 0x57, 7},
{4, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
{4, 0xD, 0x1, 0x1, 0x0, 0x05, 6},
{4, 0xE, 0x0, 0x0, 0x0, 0x17, 7},
{4, 0xE, 0x1, 0x4, 0x4, 0x39, 6},
{4, 0xE, 0x1, 0xC, 0x8, 0x19, 6},
{4, 0xE, 0x1, 0xE, 0x2, 0x67, 7},
{4, 0xF, 0x0, 0x0, 0x0, 0x27, 7},
{4, 0xF, 0x1, 0x9, 0x9, 0x47, 7},
{4, 0xF, 0x1, 0x9, 0x1, 0x29, 6},
{4, 0xF, 0x1, 0x7, 0x6, 0x7B, 7},
{4, 0xF, 0x1, 0x7, 0x2, 0x09, 6},
{4, 0xF, 0x1, 0xB, 0x8, 0x31, 6},
{4, 0xF, 0x1, 0xF, 0x4, 0x3B, 7},
{5, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
{5, 0x1, 0x0, 0x0, 0x0, 0x1A, 5},
{5, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
{5, 0x2, 0x1, 0x2, 0x2, 0x1D, 6},
{5, 0x3, 0x0, 0x0, 0x0, 0x2D, 6},
{5, 0x3, 0x1, 0x3, 0x3, 0x5F, 7},
{5, 0x3, 0x1, 0x3, 0x2, 0x39, 6},
{5, 0x3, 0x1, 0x3, 0x1, 0x3F, 7},
{5, 0x4, 0x0, 0x0, 0x0, 0x12, 5},
{5, 0x4, 0x1, 0x4, 0x4, 0x1F, 7},
{5, 0x5, 0x0, 0x0, 0x0, 0x0D, 6},
{5, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
{5, 0x5, 0x1, 0x5, 0x1, 0x6F, 7},
{5, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
{5, 0x6, 0x1, 0x2, 0x2, 0x25, 6},
{5, 0x6, 0x1, 0x6, 0x4, 0x2F, 7},
{5, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
{5, 0x7, 0x1, 0x6, 0x6, 0x57, 7},
{5, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
{5, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
{5, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
{5, 0x7, 0x1, 0x7, 0x1, 0x37, 7},
{5, 0x8, 0x0, 0x0, 0x0, 0x02, 5},
{5, 0x8, 0x1, 0x8, 0x8, 0x19, 6},
{5, 0x9, 0x0, 0x0, 0x0, 0x26, 6},
{5, 0x9, 0x1, 0x8, 0x8, 0x17, 7},
{5, 0x9, 0x1, 0x9, 0x1, 0x67, 7},
{5, 0xA, 0x0, 0x0, 0x0, 0x1C, 5},
{5, 0xA, 0x1, 0xA, 0xA, 0x29, 6},
{5, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
{5, 0xA, 0x1, 0xA, 0x8, 0x31, 6},
{5, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
{5, 0xB, 0x1, 0x9, 0x9, 0x07, 7},
{5, 0xB, 0x1, 0x9, 0x8, 0x11, 6},
{5, 0xB, 0x1, 0xB, 0x3, 0x47, 7},
{5, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
{5, 0xB, 0x1, 0xB, 0x1, 0x7B, 7},
{5, 0xC, 0x0, 0x0, 0x0, 0x01, 6},
{5, 0xC, 0x1, 0x8, 0x8, 0x3E, 6},
{5, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
{5, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
{5, 0xD, 0x1, 0x9, 0x9, 0x6B, 7},
{5, 0xD, 0x1, 0x9, 0x8, 0x1E, 6},
{5, 0xD, 0x1, 0xD, 0x5, 0x1B, 7},
{5, 0xD, 0x1, 0xD, 0x4, 0x2E, 6},
{5, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
{5, 0xE, 0x0, 0x0, 0x0, 0x4B, 7},
{5, 0xE, 0x1, 0x6, 0x6, 0x0B, 7},
{5, 0xE, 0x1, 0xE, 0xA, 0x33, 7},
{5, 0xE, 0x1, 0xE, 0x2, 0x0E, 6},
{5, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
{5, 0xE, 0x1, 0xE, 0x8, 0x36, 6},
{5, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
{5, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
{5, 0xF, 0x1, 0x7, 0x7, 0x43, 7},
{5, 0xF, 0x1, 0x7, 0x6, 0x16, 6},
{5, 0xF, 0x1, 0x7, 0x5, 0x63, 7},
{5, 0xF, 0x1, 0xF, 0xC, 0x23, 7},
{5, 0xF, 0x1, 0xF, 0x4, 0x0C, 5},
{5, 0xF, 0x1, 0xD, 0x9, 0x03, 7},
{5, 0xF, 0x1, 0xF, 0xA, 0x3D, 7},
{5, 0xF, 0x1, 0xF, 0x8, 0x14, 5},
{5, 0xF, 0x1, 0xF, 0x3, 0x7D, 7},
{5, 0xF, 0x1, 0xF, 0x2, 0x04, 5},
{5, 0xF, 0x1, 0xF, 0x1, 0x06, 6},
{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
{6, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
{6, 0x2, 0x1, 0x2, 0x2, 0x0D, 6},
{6, 0x3, 0x0, 0x0, 0x0, 0x1A, 5},
{6, 0x3, 0x1, 0x3, 0x3, 0x3D, 6},
{6, 0x3, 0x1, 0x3, 0x1, 0x1D, 6},
{6, 0x3, 0x1, 0x3, 0x2, 0x2D, 6},
{6, 0x4, 0x0, 0x0, 0x0, 0x0A, 5},
{6, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
{6, 0x5, 0x0, 0x0, 0x0, 0x35, 6},
{6, 0x5, 0x1, 0x1, 0x1, 0x15, 6},
{6, 0x5, 0x1, 0x5, 0x4, 0x7F, 7},
{6, 0x6, 0x0, 0x0, 0x0, 0x25, 6},
{6, 0x6, 0x1, 0x2, 0x2, 0x5F, 7},
{6, 0x6, 0x1, 0x6, 0x4, 0x1F, 7},
{6, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
{6, 0x7, 0x1, 0x6, 0x6, 0x4F, 7},
{6, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
{6, 0x7, 0x1, 0x7, 0x3, 0x2F, 7},
{6, 0x7, 0x1, 0x7, 0x1, 0x36, 6},
{6, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
{6, 0x8, 0x0, 0x0, 0x0, 0x12, 5},
{6, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
{6, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
{6, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
{6, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
{6, 0xA, 0x1, 0x2, 0x2, 0x29, 6},
{6, 0xA, 0x1, 0xA, 0x8, 0x17, 7},
{6, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
{6, 0xB, 0x1, 0x9, 0x9, 0x47, 7},
{6, 0xB, 0x1, 0x9, 0x1, 0x09, 6},
{6, 0xB, 0x1, 0xB, 0xA, 0x27, 7},
{6, 0xB, 0x1, 0xB, 0x2, 0x31, 6},
{6, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
{6, 0xC, 0x0, 0x0, 0x0, 0x11, 6},
{6, 0xC, 0x1, 0xC, 0xC, 0x07, 7},
{6, 0xC, 0x1, 0xC, 0x8, 0x21, 6},
{6, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
{6, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
{6, 0xD, 0x1, 0x5, 0x5, 0x33, 7},
{6, 0xD, 0x1, 0x5, 0x4, 0x01, 6},
{6, 0xD, 0x1, 0xC, 0x8, 0x1B, 7},
{6, 0xD, 0x1, 0xD, 0x1, 0x6B, 7},
{6, 0xE, 0x0, 0x0, 0x0, 0x2B, 7},
{6, 0xE, 0x1, 0xE, 0x2, 0x4B, 7},
{6, 0xE, 0x1, 0x2, 0x2, 0x0B, 7},
{6, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
{6, 0xE, 0x1, 0xE, 0x8, 0x3E, 6},
{6, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
{6, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
{6, 0xF, 0x1, 0x6, 0x6, 0x1E, 6},
{6, 0xF, 0x1, 0xE, 0xA, 0x2E, 6},
{6, 0xF, 0x1, 0xF, 0x3, 0x0E, 6},
{6, 0xF, 0x1, 0xF, 0x2, 0x02, 5},
{6, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
{6, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
{6, 0xF, 0x1, 0xF, 0x8, 0x06, 6},
{6, 0xF, 0x1, 0xF, 0x5, 0x23, 7},
{6, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
{6, 0xF, 0x1, 0xF, 0x4, 0x26, 6},
{7, 0x0, 0x0, 0x0, 0x0, 0x12, 5},
{7, 0x1, 0x0, 0x0, 0x0, 0x05, 6},
{7, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
{7, 0x2, 0x0, 0x0, 0x0, 0x39, 6},
{7, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
{7, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
{7, 0x3, 0x1, 0x3, 0x3, 0x1F, 7},
{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
{7, 0x3, 0x1, 0x3, 0x1, 0x2F, 7},
{7, 0x4, 0x0, 0x0, 0x0, 0x4F, 7},
{7, 0x4, 0x1, 0x4, 0x4, 0x0F, 7},
{7, 0x5, 0x0, 0x0, 0x0, 0x57, 7},
{7, 0x5, 0x1, 0x1, 0x1, 0x19, 6},
{7, 0x5, 0x1, 0x5, 0x4, 0x77, 7},
{7, 0x6, 0x0, 0x0, 0x0, 0x37, 7},
{7, 0x6, 0x1, 0x0, 0x0, 0x29, 6},
{7, 0x7, 0x0, 0x0, 0x0, 0x17, 7},
{7, 0x7, 0x1, 0x6, 0x6, 0x67, 7},
{7, 0x7, 0x1, 0x7, 0x3, 0x27, 7},
{7, 0x7, 0x1, 0x7, 0x2, 0x47, 7},
{7, 0x7, 0x1, 0x7, 0x5, 0x1B, 7},
{7, 0x7, 0x1, 0x7, 0x1, 0x09, 6},
{7, 0x7, 0x1, 0x7, 0x4, 0x07, 7},
{7, 0x8, 0x0, 0x0, 0x0, 0x7B, 7},
{7, 0x8, 0x1, 0x8, 0x8, 0x3B, 7},
{7, 0x9, 0x0, 0x0, 0x0, 0x5B, 7},
{7, 0x9, 0x1, 0x0, 0x0, 0x31, 6},
{7, 0xA, 0x0, 0x0, 0x0, 0x53, 7},
{7, 0xA, 0x1, 0x2, 0x2, 0x11, 6},
{7, 0xA, 0x1, 0xA, 0x8, 0x6B, 7},
{7, 0xB, 0x0, 0x0, 0x0, 0x2B, 7},
{7, 0xB, 0x1, 0x9, 0x9, 0x4B, 7},
{7, 0xB, 0x1, 0xB, 0x3, 0x0B, 7},
{7, 0xB, 0x1, 0xB, 0x1, 0x73, 7},
{7, 0xB, 0x1, 0xB, 0xA, 0x33, 7},
{7, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
{7, 0xB, 0x1, 0xB, 0x8, 0x13, 7},
{7, 0xC, 0x0, 0x0, 0x0, 0x63, 7},
{7, 0xC, 0x1, 0x8, 0x8, 0x23, 7},
{7, 0xC, 0x1, 0xC, 0x4, 0x43, 7},
{7, 0xD, 0x0, 0x0, 0x0, 0x03, 7},
{7, 0xD, 0x1, 0x9, 0x9, 0x7D, 7},
{7, 0xD, 0x1, 0xD, 0x5, 0x5D, 7},
{7, 0xD, 0x1, 0xD, 0x1, 0x01, 6},
{7, 0xD, 0x1, 0xD, 0xC, 0x3D, 7},
{7, 0xD, 0x1, 0xD, 0x4, 0x3E, 6},
{7, 0xD, 0x1, 0xD, 0x8, 0x1D, 7},
{7, 0xE, 0x0, 0x0, 0x0, 0x6D, 7},
{7, 0xE, 0x1, 0x6, 0x6, 0x2D, 7},
{7, 0xE, 0x1, 0xE, 0xA, 0x0D, 7},
{7, 0xE, 0x1, 0xE, 0x2, 0x1E, 6},
{7, 0xE, 0x1, 0xE, 0xC, 0x4D, 7},
{7, 0xE, 0x1, 0xE, 0x8, 0x0E, 6},
{7, 0xE, 0x1, 0xE, 0x4, 0x75, 7},
{7, 0xF, 0x0, 0x0, 0x0, 0x15, 7},
{7, 0xF, 0x1, 0xF, 0xF, 0x06, 5},
{7, 0xF, 0x1, 0xF, 0xD, 0x35, 7},
{7, 0xF, 0x1, 0xF, 0x7, 0x55, 7},
{7, 0xF, 0x1, 0xF, 0x5, 0x1A, 5},
{7, 0xF, 0x1, 0xF, 0xB, 0x25, 7},
{7, 0xF, 0x1, 0xF, 0x3, 0x0A, 5},
{7, 0xF, 0x1, 0xF, 0x9, 0x2E, 6},
{7, 0xF, 0x1, 0xF, 0x1, 0x00, 4},
{7, 0xF, 0x1, 0xF, 0xE, 0x65, 7},
{7, 0xF, 0x1, 0xF, 0x6, 0x36, 6},
{7, 0xF, 0x1, 0xF, 0xA, 0x02, 5},
{7, 0xF, 0x1, 0xF, 0x2, 0x0C, 4},
{7, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
{7, 0xF, 0x1, 0xF, 0x8, 0x04, 4},
{7, 0xF, 0x1, 0xF, 0x4, 0x08, 4}
+358
View File
@@ -0,0 +1,358 @@
{0, 0x1, 0x0, 0x0, 0x0, 0x00, 3},
{0, 0x1, 0x1, 0x1, 0x1, 0x27, 6},
{0, 0x2, 0x0, 0x0, 0x0, 0x06, 3},
{0, 0x2, 0x1, 0x2, 0x2, 0x17, 6},
{0, 0x3, 0x0, 0x0, 0x0, 0x0D, 5},
{0, 0x3, 0x1, 0x0, 0x0, 0x3B, 6},
{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
{0, 0x4, 0x1, 0x4, 0x4, 0x07, 6},
{0, 0x5, 0x0, 0x0, 0x0, 0x15, 5},
{0, 0x5, 0x1, 0x0, 0x0, 0x2B, 6},
{0, 0x6, 0x0, 0x0, 0x0, 0x01, 5},
{0, 0x6, 0x1, 0x0, 0x0, 0x7F, 7},
{0, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
{0, 0x7, 0x1, 0x0, 0x0, 0x1B, 6},
{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
{0, 0x8, 0x1, 0x8, 0x8, 0x05, 5},
{0, 0x9, 0x0, 0x0, 0x0, 0x19, 5},
{0, 0x9, 0x1, 0x0, 0x0, 0x13, 6},
{0, 0xA, 0x0, 0x0, 0x0, 0x09, 5},
{0, 0xA, 0x1, 0x8, 0x8, 0x0B, 6},
{0, 0xA, 0x1, 0xA, 0x2, 0x3F, 7},
{0, 0xB, 0x0, 0x0, 0x0, 0x5F, 7},
{0, 0xB, 0x1, 0x0, 0x0, 0x33, 6},
{0, 0xC, 0x0, 0x0, 0x0, 0x11, 5},
{0, 0xC, 0x1, 0x8, 0x8, 0x23, 6},
{0, 0xC, 0x1, 0xC, 0x4, 0x6F, 7},
{0, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
{0, 0xD, 0x1, 0x0, 0x0, 0x03, 6},
{0, 0xE, 0x0, 0x0, 0x0, 0x2F, 7},
{0, 0xE, 0x1, 0x4, 0x4, 0x4F, 7},
{0, 0xE, 0x1, 0x4, 0x0, 0x3D, 6},
{0, 0xF, 0x0, 0x0, 0x0, 0x77, 7},
{0, 0xF, 0x1, 0x1, 0x1, 0x37, 7},
{0, 0xF, 0x1, 0x1, 0x0, 0x1D, 6},
{1, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
{1, 0x1, 0x0, 0x0, 0x0, 0x05, 4},
{1, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
{1, 0x2, 0x0, 0x0, 0x0, 0x09, 4},
{1, 0x2, 0x1, 0x2, 0x2, 0x1F, 7},
{1, 0x3, 0x0, 0x0, 0x0, 0x1D, 5},
{1, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
{1, 0x3, 0x1, 0x3, 0x2, 0x5F, 7},
{1, 0x4, 0x0, 0x0, 0x0, 0x0D, 5},
{1, 0x4, 0x1, 0x4, 0x4, 0x37, 7},
{1, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
{1, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
{1, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
{1, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
{1, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
{1, 0x7, 0x1, 0x0, 0x0, 0x77, 7},
{1, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
{1, 0x8, 0x1, 0x8, 0x8, 0x17, 7},
{1, 0x9, 0x0, 0x0, 0x0, 0x0B, 6},
{1, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
{1, 0xA, 0x0, 0x0, 0x0, 0x33, 6},
{1, 0xA, 0x1, 0x0, 0x0, 0x67, 7},
{1, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
{1, 0xB, 0x1, 0x0, 0x0, 0x2B, 7},
{1, 0xC, 0x0, 0x0, 0x0, 0x13, 6},
{1, 0xC, 0x1, 0x0, 0x0, 0x47, 7},
{1, 0xD, 0x0, 0x0, 0x0, 0x07, 7},
{1, 0xD, 0x1, 0x0, 0x0, 0x7B, 7},
{1, 0xE, 0x0, 0x0, 0x0, 0x3B, 7},
{1, 0xE, 0x1, 0x0, 0x0, 0x5B, 7},
{1, 0xF, 0x0, 0x0, 0x0, 0x1B, 7},
{1, 0xF, 0x1, 0x4, 0x4, 0x6B, 7},
{1, 0xF, 0x1, 0x4, 0x0, 0x23, 6},
{2, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
{2, 0x1, 0x0, 0x0, 0x0, 0x09, 4},
{2, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
{2, 0x2, 0x0, 0x0, 0x0, 0x01, 4},
{2, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
{2, 0x3, 0x0, 0x0, 0x0, 0x3D, 6},
{2, 0x3, 0x1, 0x2, 0x2, 0x3F, 7},
{2, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
{2, 0x4, 0x0, 0x0, 0x0, 0x15, 5},
{2, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
{2, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
{2, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
{2, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
{2, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
{2, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
{2, 0x7, 0x1, 0x0, 0x0, 0x17, 7},
{2, 0x8, 0x0, 0x0, 0x0, 0x05, 5},
{2, 0x8, 0x1, 0x8, 0x8, 0x77, 7},
{2, 0x9, 0x0, 0x0, 0x0, 0x37, 7},
{2, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
{2, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
{2, 0xA, 0x1, 0xA, 0xA, 0x7B, 7},
{2, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
{2, 0xA, 0x1, 0xA, 0x8, 0x67, 7},
{2, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
{2, 0xB, 0x1, 0xB, 0x2, 0x47, 7},
{2, 0xB, 0x1, 0x0, 0x0, 0x07, 7},
{2, 0xC, 0x0, 0x0, 0x0, 0x0D, 6},
{2, 0xC, 0x1, 0x0, 0x0, 0x3B, 7},
{2, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
{2, 0xD, 0x1, 0x0, 0x0, 0x1B, 7},
{2, 0xE, 0x0, 0x0, 0x0, 0x6B, 7},
{2, 0xE, 0x1, 0x4, 0x4, 0x2B, 7},
{2, 0xE, 0x1, 0x4, 0x0, 0x4B, 7},
{2, 0xF, 0x0, 0x0, 0x0, 0x0B, 7},
{2, 0xF, 0x1, 0x4, 0x4, 0x73, 7},
{2, 0xF, 0x1, 0x5, 0x1, 0x33, 7},
{2, 0xF, 0x1, 0x7, 0x2, 0x53, 7},
{2, 0xF, 0x1, 0xF, 0x8, 0x13, 7},
{3, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
{3, 0x1, 0x0, 0x0, 0x0, 0x0A, 4},
{3, 0x1, 0x1, 0x1, 0x1, 0x0B, 6},
{3, 0x2, 0x0, 0x0, 0x0, 0x02, 4},
{3, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
{3, 0x3, 0x0, 0x0, 0x0, 0x0E, 5},
{3, 0x3, 0x1, 0x3, 0x3, 0x7F, 7},
{3, 0x3, 0x1, 0x3, 0x2, 0x33, 6},
{3, 0x3, 0x1, 0x3, 0x1, 0x13, 6},
{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
{3, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
{3, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
{3, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
{3, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
{3, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
{3, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
{3, 0x7, 0x0, 0x0, 0x0, 0x2D, 6},
{3, 0x7, 0x1, 0x4, 0x4, 0x2F, 7},
{3, 0x7, 0x1, 0x5, 0x1, 0x1E, 6},
{3, 0x7, 0x1, 0x7, 0x2, 0x6F, 7},
{3, 0x8, 0x0, 0x0, 0x0, 0x06, 5},
{3, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
{3, 0x9, 0x0, 0x0, 0x0, 0x0D, 6},
{3, 0x9, 0x1, 0x0, 0x0, 0x35, 6},
{3, 0xA, 0x0, 0x0, 0x0, 0x15, 6},
{3, 0xA, 0x1, 0x2, 0x2, 0x25, 6},
{3, 0xA, 0x1, 0xA, 0x8, 0x0F, 7},
{3, 0xB, 0x0, 0x0, 0x0, 0x05, 6},
{3, 0xB, 0x1, 0x8, 0x8, 0x39, 6},
{3, 0xB, 0x1, 0xB, 0x3, 0x17, 7},
{3, 0xB, 0x1, 0xB, 0x2, 0x19, 6},
{3, 0xB, 0x1, 0xB, 0x1, 0x77, 7},
{3, 0xC, 0x0, 0x0, 0x0, 0x29, 6},
{3, 0xC, 0x1, 0x0, 0x0, 0x09, 6},
{3, 0xD, 0x0, 0x0, 0x0, 0x37, 7},
{3, 0xD, 0x1, 0x4, 0x4, 0x57, 7},
{3, 0xD, 0x1, 0x4, 0x0, 0x31, 6},
{3, 0xE, 0x0, 0x0, 0x0, 0x67, 7},
{3, 0xE, 0x1, 0x4, 0x4, 0x27, 7},
{3, 0xE, 0x1, 0xC, 0x8, 0x47, 7},
{3, 0xE, 0x1, 0xE, 0x2, 0x6B, 7},
{3, 0xF, 0x0, 0x0, 0x0, 0x11, 6},
{3, 0xF, 0x1, 0x6, 0x6, 0x07, 7},
{3, 0xF, 0x1, 0x7, 0x3, 0x7B, 7},
{3, 0xF, 0x1, 0xF, 0xA, 0x3B, 7},
{3, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
{3, 0xF, 0x1, 0xF, 0x8, 0x01, 6},
{3, 0xF, 0x1, 0xA, 0x8, 0x5B, 7},
{3, 0xF, 0x1, 0xF, 0x5, 0x1B, 7},
{3, 0xF, 0x1, 0xF, 0x1, 0x3E, 6},
{3, 0xF, 0x1, 0xF, 0x4, 0x2B, 7},
{4, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
{4, 0x1, 0x0, 0x0, 0x0, 0x0D, 5},
{4, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
{4, 0x2, 0x0, 0x0, 0x0, 0x15, 5},
{4, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
{4, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
{4, 0x3, 0x1, 0x0, 0x0, 0x6F, 7},
{4, 0x4, 0x0, 0x0, 0x0, 0x09, 4},
{4, 0x4, 0x1, 0x4, 0x4, 0x23, 6},
{4, 0x5, 0x0, 0x0, 0x0, 0x33, 6},
{4, 0x5, 0x1, 0x0, 0x0, 0x1F, 7},
{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
{4, 0x6, 0x1, 0x0, 0x0, 0x2F, 7},
{4, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
{4, 0x7, 0x1, 0x0, 0x0, 0x57, 7},
{4, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
{4, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
{4, 0x9, 0x0, 0x0, 0x0, 0x77, 7},
{4, 0x9, 0x1, 0x0, 0x0, 0x37, 7},
{4, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
{4, 0xA, 0x1, 0x0, 0x0, 0x17, 7},
{4, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
{4, 0xB, 0x1, 0x0, 0x0, 0x6B, 7},
{4, 0xC, 0x0, 0x0, 0x0, 0x05, 5},
{4, 0xC, 0x1, 0xC, 0xC, 0x27, 7},
{4, 0xC, 0x1, 0xC, 0x8, 0x47, 7},
{4, 0xC, 0x1, 0xC, 0x4, 0x07, 7},
{4, 0xD, 0x0, 0x0, 0x0, 0x7B, 7},
{4, 0xD, 0x1, 0x0, 0x0, 0x3B, 7},
{4, 0xE, 0x0, 0x0, 0x0, 0x5B, 7},
{4, 0xE, 0x1, 0x2, 0x2, 0x1B, 7},
{4, 0xE, 0x1, 0x2, 0x0, 0x03, 6},
{4, 0xF, 0x0, 0x0, 0x0, 0x2B, 7},
{4, 0xF, 0x1, 0x1, 0x1, 0x4B, 7},
{4, 0xF, 0x1, 0x3, 0x2, 0x0B, 7},
{4, 0xF, 0x1, 0x3, 0x0, 0x3D, 6},
{5, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
{5, 0x1, 0x0, 0x0, 0x0, 0x1E, 5},
{5, 0x1, 0x1, 0x1, 0x1, 0x3B, 6},
{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
{5, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
{5, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
{5, 0x3, 0x1, 0x0, 0x0, 0x0B, 6},
{5, 0x4, 0x0, 0x0, 0x0, 0x02, 4},
{5, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
{5, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
{5, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
{5, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
{5, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
{5, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
{5, 0x7, 0x0, 0x0, 0x0, 0x23, 6},
{5, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
{5, 0x7, 0x1, 0x2, 0x0, 0x15, 6},
{5, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
{5, 0x8, 0x1, 0x8, 0x8, 0x03, 6},
{5, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
{5, 0x9, 0x1, 0x0, 0x0, 0x1F, 7},
{5, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
{5, 0xA, 0x1, 0x0, 0x0, 0x2D, 6},
{5, 0xB, 0x0, 0x0, 0x0, 0x0D, 6},
{5, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
{5, 0xB, 0x1, 0x1, 0x0, 0x35, 6},
{5, 0xC, 0x0, 0x0, 0x0, 0x06, 5},
{5, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
{5, 0xC, 0x1, 0xC, 0x8, 0x2F, 7},
{5, 0xD, 0x0, 0x0, 0x0, 0x05, 6},
{5, 0xD, 0x1, 0x1, 0x1, 0x77, 7},
{5, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
{5, 0xD, 0x1, 0xD, 0x8, 0x0F, 7},
{5, 0xE, 0x0, 0x0, 0x0, 0x19, 6},
{5, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
{5, 0xE, 0x1, 0xA, 0x8, 0x01, 6},
{5, 0xE, 0x1, 0xE, 0x4, 0x37, 7},
{5, 0xF, 0x0, 0x0, 0x0, 0x1A, 5},
{5, 0xF, 0x1, 0x9, 0x9, 0x17, 7},
{5, 0xF, 0x1, 0xD, 0x5, 0x67, 7},
{5, 0xF, 0x1, 0xF, 0x3, 0x07, 7},
{5, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
{5, 0xF, 0x1, 0x7, 0x6, 0x27, 7},
{5, 0xF, 0x1, 0xF, 0xC, 0x09, 6},
{5, 0xF, 0x1, 0xF, 0x4, 0x31, 6},
{5, 0xF, 0x1, 0xF, 0xA, 0x47, 7},
{5, 0xF, 0x1, 0xF, 0x8, 0x11, 6},
{5, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
{6, 0x1, 0x0, 0x0, 0x0, 0x02, 4},
{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 4},
{6, 0x2, 0x1, 0x2, 0x2, 0x3D, 6},
{6, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
{6, 0x3, 0x1, 0x2, 0x2, 0x0D, 6},
{6, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
{6, 0x4, 0x0, 0x0, 0x0, 0x04, 4},
{6, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
{6, 0x5, 0x0, 0x0, 0x0, 0x0A, 5},
{6, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
{6, 0x5, 0x1, 0x5, 0x1, 0x2F, 7},
{6, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
{6, 0x6, 0x1, 0x2, 0x2, 0x3F, 7},
{6, 0x6, 0x1, 0x6, 0x4, 0x5F, 7},
{6, 0x7, 0x0, 0x0, 0x0, 0x25, 6},
{6, 0x7, 0x1, 0x2, 0x2, 0x29, 6},
{6, 0x7, 0x1, 0x3, 0x1, 0x1F, 7},
{6, 0x7, 0x1, 0x7, 0x4, 0x6F, 7},
{6, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
{6, 0x8, 0x1, 0x8, 0x8, 0x05, 6},
{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
{6, 0x9, 0x1, 0x0, 0x0, 0x19, 6},
{6, 0xA, 0x0, 0x0, 0x0, 0x06, 5},
{6, 0xA, 0x1, 0xA, 0xA, 0x0F, 7},
{6, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
{6, 0xA, 0x1, 0xA, 0x8, 0x4F, 7},
{6, 0xB, 0x0, 0x0, 0x0, 0x0E, 6},
{6, 0xB, 0x1, 0xB, 0x2, 0x77, 7},
{6, 0xB, 0x1, 0x2, 0x2, 0x37, 7},
{6, 0xB, 0x1, 0xA, 0x8, 0x57, 7},
{6, 0xB, 0x1, 0xB, 0x1, 0x47, 7},
{6, 0xC, 0x0, 0x0, 0x0, 0x1A, 5},
{6, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
{6, 0xC, 0x1, 0xC, 0x8, 0x67, 7},
{6, 0xC, 0x1, 0xC, 0x4, 0x27, 7},
{6, 0xD, 0x0, 0x0, 0x0, 0x31, 6},
{6, 0xD, 0x1, 0xD, 0x4, 0x07, 7},
{6, 0xD, 0x1, 0x4, 0x4, 0x7B, 7},
{6, 0xD, 0x1, 0xC, 0x8, 0x3B, 7},
{6, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
{6, 0xE, 0x0, 0x0, 0x0, 0x11, 6},
{6, 0xE, 0x1, 0xE, 0x4, 0x5B, 7},
{6, 0xE, 0x1, 0x4, 0x4, 0x1B, 7},
{6, 0xE, 0x1, 0xE, 0xA, 0x6B, 7},
{6, 0xE, 0x1, 0xE, 0x8, 0x21, 6},
{6, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
{6, 0xF, 0x0, 0x0, 0x0, 0x01, 6},
{6, 0xF, 0x1, 0x3, 0x3, 0x4B, 7},
{6, 0xF, 0x1, 0x7, 0x6, 0x0B, 7},
{6, 0xF, 0x1, 0xF, 0xA, 0x73, 7},
{6, 0xF, 0x1, 0xF, 0x2, 0x3E, 6},
{6, 0xF, 0x1, 0xB, 0x9, 0x53, 7},
{6, 0xF, 0x1, 0xF, 0xC, 0x63, 7},
{6, 0xF, 0x1, 0xF, 0x8, 0x1E, 6},
{6, 0xF, 0x1, 0xF, 0x5, 0x13, 7},
{6, 0xF, 0x1, 0xF, 0x4, 0x2E, 6},
{6, 0xF, 0x1, 0xF, 0x1, 0x23, 7},
{7, 0x0, 0x0, 0x0, 0x0, 0x04, 4},
{7, 0x1, 0x0, 0x0, 0x0, 0x33, 6},
{7, 0x1, 0x1, 0x1, 0x1, 0x13, 6},
{7, 0x2, 0x0, 0x0, 0x0, 0x23, 6},
{7, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
{7, 0x3, 0x0, 0x0, 0x0, 0x03, 6},
{7, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
{7, 0x4, 0x0, 0x0, 0x0, 0x2D, 6},
{7, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
{7, 0x5, 0x0, 0x0, 0x0, 0x16, 5},
{7, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
{7, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
{7, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
{7, 0x6, 0x1, 0x0, 0x0, 0x77, 7},
{7, 0x7, 0x0, 0x0, 0x0, 0x06, 5},
{7, 0x7, 0x1, 0x7, 0x4, 0x2F, 7},
{7, 0x7, 0x1, 0x4, 0x4, 0x4F, 7},
{7, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
{7, 0x7, 0x1, 0x7, 0x1, 0x0D, 6},
{7, 0x7, 0x1, 0x7, 0x2, 0x57, 7},
{7, 0x8, 0x0, 0x0, 0x0, 0x35, 6},
{7, 0x8, 0x1, 0x8, 0x8, 0x37, 7},
{7, 0x9, 0x0, 0x0, 0x0, 0x15, 6},
{7, 0x9, 0x1, 0x0, 0x0, 0x27, 7},
{7, 0xA, 0x0, 0x0, 0x0, 0x25, 6},
{7, 0xA, 0x1, 0x0, 0x0, 0x29, 6},
{7, 0xB, 0x0, 0x0, 0x0, 0x1A, 5},
{7, 0xB, 0x1, 0xB, 0x1, 0x17, 7},
{7, 0xB, 0x1, 0x1, 0x1, 0x67, 7},
{7, 0xB, 0x1, 0x3, 0x2, 0x05, 6},
{7, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
{7, 0xC, 0x0, 0x0, 0x0, 0x39, 6},
{7, 0xC, 0x1, 0x0, 0x0, 0x19, 6},
{7, 0xD, 0x0, 0x0, 0x0, 0x0C, 5},
{7, 0xD, 0x1, 0xD, 0x1, 0x47, 7},
{7, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
{7, 0xD, 0x1, 0x5, 0x4, 0x09, 6},
{7, 0xD, 0x1, 0xD, 0x8, 0x1B, 7},
{7, 0xE, 0x0, 0x0, 0x0, 0x31, 6},
{7, 0xE, 0x1, 0xE, 0x2, 0x3B, 7},
{7, 0xE, 0x1, 0x2, 0x2, 0x5B, 7},
{7, 0xE, 0x1, 0xA, 0x8, 0x3E, 6},
{7, 0xE, 0x1, 0xE, 0x4, 0x0B, 7},
{7, 0xF, 0x0, 0x0, 0x0, 0x00, 3},
{7, 0xF, 0x1, 0xF, 0xF, 0x6B, 7},
{7, 0xF, 0x1, 0xF, 0x7, 0x2B, 7},
{7, 0xF, 0x1, 0xF, 0xB, 0x4B, 7},
{7, 0xF, 0x1, 0xF, 0x3, 0x11, 6},
{7, 0xF, 0x1, 0x7, 0x6, 0x21, 6},
{7, 0xF, 0x1, 0xF, 0xA, 0x01, 6},
{7, 0xF, 0x1, 0xF, 0x2, 0x0A, 5},
{7, 0xF, 0x1, 0xB, 0x9, 0x1E, 6},
{7, 0xF, 0x1, 0xF, 0xC, 0x0E, 6},
{7, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
{7, 0xF, 0x1, 0xF, 0x5, 0x2E, 6},
{7, 0xF, 0x1, 0xF, 0x1, 0x02, 5},
{7, 0xF, 0x1, 0xF, 0x4, 0x1C, 5}

Some files were not shown because too many files have changed in this diff Show More