8 | A simple viewer for OpenEXR files with detailed metadata probing.
9 | You can display various types of layers, automatically combines RGB, Luminance-Chroma and Y layers.
10 |
11 |
12 | openexr-viewer.desktop
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | openexr-viewer
25 |
26 |
27 |
--------------------------------------------------------------------------------
/deploy/linux/openexr-viewer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OpenEXR image
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/format-all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | for folder in src
4 | do
5 | find ${folder} -regex '.*\.\(c\|cpp\|h\)' -exec sed -i "s/#pragma omp/\\/\\/#pragma omp/g" {} \;
6 | find ${folder} -regex '.*\.\(c\|cpp\|h\)' -exec clang-format -style=file -i {} \;
7 | find ${folder} -regex '.*\.\(c\|cpp\|h\)' -exec sed -i "s/\\/\\/ *#pragma omp/#pragma omp/g" {} \;
8 | done
9 |
10 |
--------------------------------------------------------------------------------
/openexr-viewer.rc:
--------------------------------------------------------------------------------
1 | IDI_ICON1 ICON DISCARDABLE "deploy/icon/openexr-viewer.ico"
--------------------------------------------------------------------------------
/snap/gui/openexr-viewer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afichet/openexr-viewer/4f3b278ce4591e0cfbbee5f0fac5774b69a1df96/snap/gui/openexr-viewer.png
--------------------------------------------------------------------------------
/src/config.h.in:
--------------------------------------------------------------------------------
1 | #cmakedefine CMAKE_PROJECT_VERSION "@CMAKE_PROJECT_VERSION@"
2 |
--------------------------------------------------------------------------------
/src/model/StdIStream.cpp:
--------------------------------------------------------------------------------
1 | #include "StdIStream.h"
2 |
3 | StdIStream::StdIStream(std::istream& stream)
4 | : IStream("Stream")
5 | , m_stream(stream)
6 | {}
7 |
8 | bool StdIStream::read(char c[], int n)
9 | {
10 | m_stream.read(c, n);
11 |
12 | return m_stream.good();
13 | }
14 |
15 | uint64_t StdIStream::tellg()
16 | {
17 | return m_stream.tellg();
18 | }
19 |
20 | void StdIStream::seekg(uint64_t pos)
21 | {
22 | m_stream.seekg(pos);
23 | }
24 |
--------------------------------------------------------------------------------
/src/util/ColorTransform.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2021 Alban Fichet
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * * Redistributions in binary form must reproduce the above
12 | * copyright notice, this list of conditions and the following
13 | * disclaimer in the documentation and/or other materials provided
14 | * with the distribution.
15 | * * Neither the name of the organization(s) nor the names of its
16 | * contributors may be used to endorse or promote products derived
17 | * from this software without specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30 | * OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | #pragma once
34 |
35 | class ColorTransform
36 | {
37 | public:
38 | static float to_sRGB(float rgb_color);
39 | static unsigned char to_sRGB_255(float rgb_color);
40 | };
41 |
--------------------------------------------------------------------------------
/src/util/Colormap.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2021 Alban Fichet
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * * Redistributions in binary form must reproduce the above
12 | * copyright notice, this list of conditions and the following
13 | * disclaimer in the documentation and/or other materials provided
14 | * with the distribution.
15 | * * Neither the name of the organization(s) nor the names of its
16 | * contributors may be used to endorse or promote products derived
17 | * from this software without specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30 | * OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | #include "Colormap.h"
34 |
--------------------------------------------------------------------------------
/src/util/Colormap.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2021 Alban Fichet
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * * Redistributions in binary form must reproduce the above
12 | * copyright notice, this list of conditions and the following
13 | * disclaimer in the documentation and/or other materials provided
14 | * with the distribution.
15 | * * Neither the name of the organization(s) nor the names of its
16 | * contributors may be used to endorse or promote products derived
17 | * from this software without specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30 | * OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | #pragma once
34 |
35 | class Colormap
36 | {
37 | public:
38 | Colormap() {}
39 |
40 | virtual ~Colormap() {}
41 |
42 | virtual void getRGBValue(float v, float RGB[3]) const = 0;
43 |
44 | virtual void
45 | getRGBValue(float v, float v_min, float v_max, float RGB[3]) const
46 | {
47 | getRGBValue((v - v_min) / (v_max - v_min), RGB);
48 | }
49 | };
50 |
--------------------------------------------------------------------------------
/src/util/YColormap.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2021 Alban Fichet
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * * Redistributions in binary form must reproduce the above
12 | * copyright notice, this list of conditions and the following
13 | * disclaimer in the documentation and/or other materials provided
14 | * with the distribution.
15 | * * Neither the name of the organization(s) nor the names of its
16 | * contributors may be used to endorse or promote products derived
17 | * from this software without specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30 | * OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | #include "YColormap.h"
34 |
35 | #include
36 |
37 | YColormap::YColormap() {}
38 |
39 | YColormap::~YColormap() {}
40 |
41 | void YColormap::getRGBValue(float v, float RGB[]) const
42 | {
43 | // memset(RGB, v, 3*sizeof(float));
44 | for (int c = 0; c < 3; c++) {
45 | RGB[c] = v;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/util/YColormap.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2021 Alban Fichet
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * * Redistributions in binary form must reproduce the above
12 | * copyright notice, this list of conditions and the following
13 | * disclaimer in the documentation and/or other materials provided
14 | * with the distribution.
15 | * * Neither the name of the organization(s) nor the names of its
16 | * contributors may be used to endorse or promote products derived
17 | * from this software without specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30 | * OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | #pragma once
34 |
35 | #include "Colormap.h"
36 |
37 | class YColormap: public Colormap
38 | {
39 | public:
40 | YColormap();
41 |
42 | virtual ~YColormap();
43 |
44 | virtual void getRGBValue(float v, float RGB[3]) const;
45 | };
46 |
--------------------------------------------------------------------------------
/src/view/about.h:
--------------------------------------------------------------------------------
1 | #ifndef ABOUT_H
2 | #define ABOUT_H
3 |
4 | #include
5 |
6 | namespace Ui
7 | {
8 | class About;
9 | }
10 |
11 | class About: public QDialog
12 | {
13 | Q_OBJECT
14 |
15 | public:
16 | explicit About(QWidget* parent = nullptr);
17 | ~About();
18 |
19 | private slots:
20 | void on_pushButton_clicked();
21 |
22 | private:
23 | Ui::About* ui;
24 | };
25 |
26 | #endif // ABOUT_H
27 |
--------------------------------------------------------------------------------
/src/view/about.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | About
4 |
5 |
6 |
7 | 0
8 | 0
9 | 684
10 | 533
11 |
12 |
13 |
14 | Form
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | Qt::Horizontal
26 |
27 |
28 |
29 | 40
30 | 20
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | Close
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------