Skip to content

Commit 2e55121

Browse files
committed
Merge branch 'main' into cicp-interop-id
2 parents 8cd3c0f + 203d669 commit 2e55121

File tree

12 files changed

+65
-40
lines changed

12 files changed

+65
-40
lines changed

.github/workflows/build-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
run: echo "date=`date -u +'%Y-%m-%dT%H:%M:%SZ'`" >> $GITHUB_OUTPUT
138138
- name: ccache-restore
139139
id: ccache-restore
140-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
140+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
141141
with:
142142
path: ${{ env.CCACHE_DIR }}
143143
# path: ./ccache
@@ -177,7 +177,7 @@ jobs:
177177
popd
178178
- name: ccache-save
179179
id: ccache-save
180-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
180+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
181181
with:
182182
path: ${{ env.CCACHE_DIR }}
183183
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,13 @@ jobs:
627627
ctest_test_timeout: 1200
628628
setenvs: export MACOSX_DEPLOYMENT_TARGET=12.0
629629
benchmark: 1
630-
- desc: MacOS-14-ARM aclang15/C++20/py3.12
630+
- desc: MacOS-14-ARM aclang15/C++20/py3.13
631631
runner: macos-14
632-
nametag: macos14-arm-py312
632+
nametag: macos14-arm-py313
633633
cc_compiler: clang
634634
cxx_compiler: clang++
635635
cxx_std: 20
636-
python_ver: "3.12"
636+
python_ver: "3.13"
637637
- desc: MacOS-15-ARM aclang16/C++20/py3.13
638638
runner: macos-15
639639
nametag: macos15-arm-py313

.github/workflows/wheel.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129

130130
- name: ccache-restore
131131
id: ccache-restore
132-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
132+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
133133
with:
134134
path: ~/.ccache
135135
key: wheel-${{runner.os}}-${{matrix.manylinux}}-${{matrix.python}}
@@ -163,7 +163,7 @@ jobs:
163163

164164
- name: ccache-save
165165
id: ccache-save
166-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
166+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
167167
with:
168168
path: ~/.ccache
169169
key: wheel-${{runner.os}}-${{matrix.manylinux}}-${{matrix.python}}
@@ -236,7 +236,7 @@ jobs:
236236

237237
- name: ccache-restore
238238
id: ccache-restore
239-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
239+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
240240
with:
241241
path: ~/.ccache
242242
key: wheel-${{runner.os}}-${{matrix.python}}
@@ -265,7 +265,7 @@ jobs:
265265
266266
- name: ccache-save
267267
id: ccache-save
268-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
268+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
269269
with:
270270
path: ~/.ccache
271271
key: wheel-${{runner.os}}-${{matrix.python}}
@@ -332,7 +332,7 @@ jobs:
332332

333333
- name: ccache-restore
334334
id: ccache-restore
335-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
335+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
336336
with:
337337
path: ~/.ccache
338338
key: wheel-${{runner.os}}-${{matrix.python}}
@@ -364,7 +364,7 @@ jobs:
364364

365365
- name: ccache-save
366366
id: ccache-save
367-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
367+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
368368
with:
369369
path: ~/.ccache
370370
key: wheel-${{runner.os}}-${{matrix.python}}
@@ -421,7 +421,7 @@ jobs:
421421

422422
- name: ccache-restore
423423
id: ccache-restore
424-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
424+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
425425
with:
426426
path: ~/.ccache
427427
key: wheel-${{runner.os}}-${{matrix.python}}
@@ -445,7 +445,7 @@ jobs:
445445

446446
- name: ccache-save
447447
id: ccache-save
448-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
448+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
449449
with:
450450
path: ~/.ccache
451451
key: wheel-${{runner.os}}-${{matrix.python}}

src/cmake/testing.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ macro (oiio_add_all_tests)
149149
oiiotool-xform
150150
diff
151151
dither dup-channels
152-
jpeg-corrupt jpeg-metadata
152+
jpeg jpeg-corrupt jpeg-metadata
153153
maketx oiiotool-maketx
154154
misnamed-file
155155
missingcolor

src/doc/builtinplugins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,13 +1661,13 @@ control aspects of the writing itself:
16611661
- One of `none` (default), `strict`, or `relaxed`.
16621662
If not `none`, the spec will be checked to see if it is compliant
16631663
with the ACES Container format defined in `ST 2065-4`_. If it is,
1664-
`chromaticities` will be set to the ACES AP0 ones, `colorInteropId`
1664+
`chromaticities` will be set to the ACES AP0 ones, `colorInteropID`
16651665
will be set to 'lin_ap0_scene' and the `acesImageContainerFlag`
16661666
attribute will be set to 1.
16671667
In `strict` mode, if the spec is non-compliant, the output will
16681668
throw an error and avoid writing the image.
16691669
While in `relaxed` mode, if the spec is non-compliant, `chromaticities`
1670-
and `colorInteropId` will be set, but `acesImageContainerFlag`
1670+
and `colorInteropID` will be set, but `acesImageContainerFlag`
16711671
will NOT.
16721672
* - ``oiio:RawColor``
16731673
- int

src/jpeg.imageio/jpeginput.cpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -532,22 +532,24 @@ JpgInput::read_uhdr(Filesystem::IOProxy* ioproxy)
532532

533533

534534

535+
template<typename Tcmyk, typename Trgb>
535536
static void
536-
cmyk_to_rgb(int n, const unsigned char* cmyk, size_t cmyk_stride,
537-
unsigned char* rgb, size_t rgb_stride)
537+
cmyk_to_rgb(cspan<Tcmyk> cmyk, span<Trgb> rgb)
538538
{
539-
for (; n; --n, cmyk += cmyk_stride, rgb += rgb_stride) {
539+
size_t n = cmyk.size() / 4;
540+
OIIO_ASSERT(rgb.size() == n * 3);
541+
for (size_t i = 0; i < n; ++i) {
540542
// JPEG seems to store CMYK as 1-x
541-
float C = convert_type<unsigned char, float>(cmyk[0]);
542-
float M = convert_type<unsigned char, float>(cmyk[1]);
543-
float Y = convert_type<unsigned char, float>(cmyk[2]);
544-
float K = convert_type<unsigned char, float>(cmyk[3]);
545-
float R = C * K;
546-
float G = M * K;
547-
float B = Y * K;
548-
rgb[0] = convert_type<float, unsigned char>(R);
549-
rgb[1] = convert_type<float, unsigned char>(G);
550-
rgb[2] = convert_type<float, unsigned char>(B);
543+
float C = convert_type<Tcmyk, float>(cmyk[4 * i + 0]);
544+
float M = convert_type<Tcmyk, float>(cmyk[4 * i + 1]);
545+
float Y = convert_type<Tcmyk, float>(cmyk[4 * i + 2]);
546+
float K = convert_type<Tcmyk, float>(cmyk[4 * i + 3]);
547+
float R = C * K;
548+
float G = M * K;
549+
float B = Y * K;
550+
rgb[3 * i + 0] = convert_type<float, Trgb>(R);
551+
rgb[3 * i + 1] = convert_type<float, Trgb>(G);
552+
rgb[3 * i + 2] = convert_type<float, Trgb>(B);
551553
}
552554
}
553555

@@ -682,10 +684,12 @@ JpgInput::read_native_scanlines(int subimage, int miplevel, int ybegin,
682684
}
683685
m_next_scanline = yend;
684686

685-
if (m_cmyk)
686-
cmyk_to_rgb(m_spec.width * nscanlines,
687-
reinterpret_cast<unsigned char*>(readdata), 4,
688-
reinterpret_cast<unsigned char*>(data.data()), 3);
687+
if (m_cmyk) {
688+
for (int i = 0; i < nscanlines; ++i)
689+
cmyk_to_rgb(make_cspan(readdata[i], m_spec.width * 4),
690+
span_cast<unsigned char>(data).subspan(
691+
m_spec.width * 3 * i, m_spec.width * 3));
692+
}
689693

690694
return true;
691695
}

src/openexr.imageio/exroutput.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ static constexpr float ACES_AP0_chromaticities[8] = {
299299
0.32168f, 0.33767f // white
300300
};
301301

302-
static const std::string ACES_AP0_colorInteropId = "lin_ap0_scene";
302+
static const std::string ACES_AP0_colorInteropID = "lin_ap0_scene";
303303

304304

305305
bool
@@ -407,10 +407,10 @@ is_aces_container_compliant(const OIIO::ImageSpec& spec, std::string& reason)
407407
}
408408

409409
// Check attributes with exact values if they exist
410-
if (spec.get_string_attribute("oiio:ColorSpace", ACES_AP0_colorInteropId)
411-
!= ACES_AP0_colorInteropId
412-
|| spec.get_string_attribute("colorInteropId", ACES_AP0_colorInteropId)
413-
!= ACES_AP0_colorInteropId) {
410+
if (spec.get_string_attribute("oiio:ColorSpace", ACES_AP0_colorInteropID)
411+
!= ACES_AP0_colorInteropID
412+
|| spec.get_string_attribute("colorInteropID", ACES_AP0_colorInteropID)
413+
!= ACES_AP0_colorInteropID) {
414414
reason
415415
= "Color space is not lin_ap0_scene as required for an ACES Container.";
416416
return false;
@@ -448,7 +448,7 @@ set_aces_container_attributes(OIIO::ImageSpec& spec)
448448
{
449449
spec.attribute("chromaticities", OIIO::TypeDesc(OIIO::TypeDesc::FLOAT, 8),
450450
ACES_AP0_chromaticities);
451-
spec.attribute("colorInteropId", ACES_AP0_colorInteropId);
451+
spec.attribute("colorInteropID", ACES_AP0_colorInteropID);
452452
spec.attribute("acesImageContainerFlag", 1);
453453
}
454454

testsuite/jpeg/ref/out.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Reading src/YCbCrK.jpg
2+
src/YCbCrK.jpg : 52 x 52, 3 channel, uint8 jpeg
3+
SHA-1: 888C1DD026F9C9A613A94BE5053292AC7010E79C
4+
channel list: R, G, B
5+
jpeg:ColorSpace: "YCbCrK"
6+
jpeg:subsampling: "4:4:4"
7+
oiio:ColorSpace: "srgb_rec709_scene"
8+
Comparing "rgb-from-YCbCrK.tif" and "ref/rgb-from-YCbCrK.tif"
9+
PASS
4.13 KB
Binary file not shown.

testsuite/jpeg/run.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright Contributors to the OpenImageIO project.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# https://github.com/AcademySoftwareFoundation/OpenImageIO
6+
7+
8+
# Test ability to read a JPEG YCbCrK encoded file
9+
command += info_command ("src/YCbCrK.jpg", safematch=True)
10+
command += oiiotool ("src/YCbCrK.jpg -o rgb-from-YCbCrK.tif")
11+
12+
outputs = [ "rgb-from-YCbCrK.tif", "out.txt" ]

0 commit comments

Comments
 (0)