Skip to content

Commit 9843826

Browse files
committed
WIP soft
Signed-off-by: Larry Gritz <[email protected]>
1 parent a24b661 commit 9843826

File tree

5 files changed

+38
-32
lines changed

5 files changed

+38
-32
lines changed

src/cmake/testing.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ macro (oiio_add_all_tests)
334334
IMAGEDIR oiio-images)
335335
oiio_add_tests (softimage
336336
ENABLEVAR ENABLE_SOFTIMAGE
337-
IMAGEDIR oiio-images)
337+
IMAGEDIR oiio-images/softimage)
338338
oiio_add_tests (targa
339339
ENABLEVAR ENABLE_TARGA
340340
IMAGEDIR oiio-images)

src/softimage.imageio/softimageinput.cpp

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -225,43 +225,33 @@ SoftimageInput::close()
225225

226226

227227

228-
inline bool
228+
bool
229229
SoftimageInput::read_next_scanline(void* data)
230230
{
231231
// Each scanline is stored using one or more channel packets.
232232
// We go through each of those to pull the data
233233
for (auto& cp : m_channel_packets) {
234-
if (cp.type & UNCOMPRESSED) {
235-
if (!read_pixels_uncompressed(cp, data)) {
236-
errorfmt("Failed to read uncompressed pixel data from \"{}\"",
237-
m_filename);
238-
close();
239-
return false;
240-
}
241-
} else if (cp.type & PURE_RUN_LENGTH) {
242-
if (!read_pixels_pure_run_length(cp, data)) {
243-
errorfmt(
244-
"Failed to read pure run length encoded pixel data from \"{}\"",
245-
m_filename);
246-
close();
247-
return false;
248-
}
249-
} else if (cp.type & MIXED_RUN_LENGTH) {
250-
if (!read_pixels_mixed_run_length(cp, data)) {
251-
errorfmt(
252-
"Failed to read mixed run length encoded pixel data from \"{}\"",
253-
m_filename);
254-
close();
255-
return false;
256-
}
234+
bool ok = false;
235+
if (cp.type == UNCOMPRESSED) {
236+
ok = read_pixels_uncompressed(cp, data);
237+
} else if (cp.type == PURE_RUN_LENGTH) {
238+
ok = read_pixels_pure_run_length(cp, data);
239+
} else if (cp.type == MIXED_RUN_LENGTH) {
240+
ok = read_pixels_mixed_run_length(cp, data);
241+
}
242+
if (!ok) {
243+
errorfmt("Failed to read channel packed type {:d} from \"{}\"",
244+
int(cp.type), m_filename);
245+
close();
246+
return false;
257247
}
258248
}
259249
return true;
260250
}
261251

262252

263253

264-
inline bool
254+
bool
265255
SoftimageInput::read_pixels_uncompressed(
266256
const softimage_pvt::ChannelPacket& curPacket, void* data)
267257
{
@@ -304,7 +294,7 @@ SoftimageInput::read_pixels_uncompressed(
304294

305295

306296

307-
inline bool
297+
bool
308298
SoftimageInput::read_pixels_pure_run_length(
309299
const softimage_pvt::ChannelPacket& curPacket, void* data)
310300
{
@@ -365,7 +355,7 @@ SoftimageInput::read_pixels_pure_run_length(
365355

366356

367357

368-
inline bool
358+
bool
369359
SoftimageInput::read_pixels_mixed_run_length(
370360
const softimage_pvt::ChannelPacket& curPacket, void* data)
371361
{
-14.2 KB
Binary file not shown.

testsuite/softimage/ref/out.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Reading data/data/fisheye.pic
2-
data/data/fisheye.pic : 75 x 75, 4 channel, uint8 softimage
1+
Reading ../oiio-images/softimage/fisheye.pic
2+
../oiio-images/softimage/fisheye.pic : 75 x 75, 4 channel, uint8 softimage
33
SHA-1: 3A3D307729BEDC0855302F3FD2846A6477887E61
44
channel list: R, G, B, A
55
BitsPerSample: 8
@@ -13,3 +13,18 @@ data/data/fisheye.pic : 75 x 75, 4 channel, uint8 softimage
1313
Stats FiniteCount: 5625 5625 5625 5625
1414
Constant: No
1515
Monochrome: No
16+
Reading ../oiio-images/softimage/astone64.pic
17+
../oiio-images/softimage/astone64.pic : 64 x 64, 3 channel, uint8 softimage
18+
SHA-1: 0FD57F8BBD941261055C65A64BBA294D9C21664F
19+
channel list: R, G, B
20+
BitsPerSample: 8
21+
ImageDescription: "ImageFX SoftImage Saver (Amiga)"
22+
Stats Min: 26 30 0 (of 255)
23+
Stats Max: 255 255 174 (of 255)
24+
Stats Avg: 154.83 158.82 68.19 (of 255)
25+
Stats StdDev: 37.89 37.86 29.05 (of 255)
26+
Stats NanCount: 0 0 0
27+
Stats InfCount: 0 0 0
28+
Stats FiniteCount: 4096 4096 4096
29+
Constant: No
30+
Monochrome: No

testsuite/softimage/run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0
55
# https://github.com/AcademySoftwareFoundation/OpenImageIO
66

7-
8-
command += info_command ("data/data/fisheye.pic", extraargs="--stats")
7+
files = [ "fisheye.pic", "astone64.pic" ]
8+
for f in files:
9+
command += info_command (OIIO_TESTSUITE_IMAGEDIR + "/" + f, extraargs="--stats")
910

0 commit comments

Comments
 (0)