Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
19c8d96
Add basics for handling of RGB565 format
Jun 10, 2025
0a9f397
A bit more testing for the PixelFormatRGB
Jun 11, 2025
f9bc50c
Basic rendering of RGB565 values works.
Jun 12, 2025
4fe3a27
Fix unit test
Jun 12, 2025
c828599
Add test for luminance function
Jun 12, 2025
2a0383c
Redo the format detection from the filename
Jun 12, 2025
df0e59d
Add conversion for RGB565 to single planes
Jun 13, 2025
eaf3a83
Debug windows build
Jun 13, 2025
3cd0bdc
Remove hardcoded paths in windows builds. These changed and we should…
Jun 13, 2025
7d50e0c
Test qmake in individual step
Jun 13, 2025
0c25187
Reenable all builds
Jun 13, 2025
4541a5b
Fix issue with big endianness
Jun 15, 2025
f3f25cb
Prepare to move out the RGB difference calculation from the video han…
Jun 18, 2025
4e0f48d
Update to C++20
Jun 18, 2025
4cd2b7b
More work on the RGB conversion and diff
Sep 15, 2025
be14e2d
Fix unit test for pixelformat
Sep 15, 2025
2a2e80a
Fix restrict definition
Sep 16, 2025
803fe4d
Copilation and warning fixes on ubuntu
Sep 16, 2025
0af71d7
Fix warnings
Sep 16, 2025
e72d27e
Add some first conversion tests
ChristianFeldmann Sep 18, 2025
eb866ab
Add the remaining conversionFunctions tests
Oct 4, 2025
fe2d010
Try a videoHandlerRGB test. I think this failed in CI in the past.
Oct 4, 2025
206b81d
Add test cases for RGB conversion. Next, RGB565.
Oct 7, 2025
eb9ec32
Add more RGB tests. Fix failing tests.
Oct 8, 2025
fe2f7bb
Fix linux compilation
Oct 8, 2025
0360d08
Fix compilation and testing issues.
Oct 8, 2025
916d36f
Fix warnings and unused function.
Oct 8, 2025
53e4dc1
Remove debug code
Oct 8, 2025
733228a
Try testing with QGuiApplication and QT_QPA_PLATFORM set to offscreen.
Oct 8, 2025
fc838f0
Older clang compile fix.
Oct 8, 2025
7a7174f
More tests for conversion and fixed some bugs for RGB565
Oct 9, 2025
0066d86
Also make this less test cases.
Oct 9, 2025
5847a6d
Fix another test with the new pixelFormat iteration function and fix …
Oct 9, 2025
2b2bb2a
Just fix spelling of endianness and some minor things.
Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
make -j$(nproc)
- name: Run Unittests
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
env:
QT_QPA_PLATFORM: 'offscreen'
build-mac-native:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -51,6 +53,8 @@ jobs:
make -j $(sysctl -n hw.logicalcpu)
- name: Run Unittests
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
env:
QT_QPA_PLATFORM: 'offscreen'
build-linux-mac:
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -105,6 +109,8 @@ jobs:
make -j 4
- name: Run Unittests
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
env:
QT_QPA_PLATFORM: 'offscreen'
- name: Build App (Mac)
if: runner.os == 'macOS'
run: |
Expand Down Expand Up @@ -153,6 +159,8 @@ jobs:
curl -L https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.9.0/qtBase-6-9-0-windows-2022.zip -o Qt.zip
7z x Qt.zip
echo "${{ github.workspace }}\..\..\YUViewQt\YUViewQt\Qt\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Test qmake
run : qmake --version
- name: Install libde265
run: |
curl -L https://github.com/ChristianFeldmann/libde265/releases/download/v1.1/libde265.dll -o libde265.dll
Expand All @@ -176,20 +184,20 @@ jobs:
echo "Creating Build dir and entering it"
mkdir build
cd build
echo "Qmake Version:"
d:\a\YUViewQt\YUViewQt\Qt\bin\qmake --version
echo "Executing qmake..."
d:\a\YUViewQt\YUViewQt\Qt\bin\qmake CONFIG+=UNITTESTS ..
qmake CONFIG+=UNITTESTS ..
echo "Executing jom:"
jom
- name: Run Unittests
run: D:\a\YUView\YUView\build\YUViewUnitTest\YUViewUnitTest
run: ${{ github.workspace }}\build\YUViewUnitTest\YUViewUnitTest
env:
QT_QPA_PLATFORM: 'offscreen'
- name: WindeployQT
run: |
mkdir deploy
cd deploy
cp ../build/YUViewApp/YUView.exe .
d:\a\YUViewQt\YUViewQt\Qt\bin\windeployqt.exe --release --no-compiler-runtime YUView.exe
windeployqt --release --no-compiler-runtime YUView.exe
cp ../openSSL/*.dll .
mkdir decoder
cp ..\libde265.dll decoder
Expand Down
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Compiler Requirements

MSVC: Visual Studio 2013 Update 5 or newer.
gcc/llvm: C++17 support is required.
gcc/llvm: C++20 support is required.

# Coding Conventions

Expand Down
2 changes: 1 addition & 1 deletion YUViewApp/YUViewApp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ QT += core gui widgets opengl xml concurrent network

TARGET = YUView
TEMPLATE = app
CONFIG += c++17
CONFIG += c++20
CONFIG -= debug_and_release

SOURCES += $$files(src/*.cpp, false)
Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/YUViewLib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ QT += core gui widgets opengl xml concurrent network

TEMPLATE = lib
CONFIG += staticlib
CONFIG += c++17
CONFIG += c++20
CONFIG -= debug_and_release
CONFIG += object_parallel_to_source

Expand Down
36 changes: 32 additions & 4 deletions YUViewLib/src/common/Functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,32 @@ std::string toLower(const std::string_view str)
return lowercaseStr;
}

std::vector<std::string_view> splitString(const std::string_view str, const char delimiter)
{
std::vector<std::string_view> result;
size_t start = 0;
size_t end = str.find(delimiter);
while (end != std::string_view::npos)
{
result.emplace_back(str.substr(start, end - start));
start = end + 1;
end = str.find(delimiter, start);
}
if (start != str.size())
result.emplace_back(str.substr(start));
return result;
}

std::string_view stripWhitespace(std::string_view str)
{
str.remove_prefix(std::min(str.find_first_not_of(" "), str.size()));

const auto lastNonWhitespace = str.find_last_not_of(" ");
if (lastNonWhitespace != std::string_view::npos)
str.remove_suffix(str.size() - lastNonWhitespace - 1);
return str;
}

ByteVector readData(std::istream &istream, const size_t nrBytes)
{
ByteVector data;
Expand All @@ -211,11 +237,12 @@ ByteVector readData(std::istream &istream, const size_t nrBytes)
std::optional<unsigned> toUnsigned(const std::string_view text)
{
unsigned value{};
const auto result = std::from_chars(text.data(), text.data() + text.size(), value);
const auto endPointer = text.data() + text.size();
const auto result = std::from_chars(text.data(), endPointer, value);

if (result.ec != std::errc())
return {};
const auto allCharactersParsed = (result.ptr == &(*text.end()));
const auto allCharactersParsed = (result.ptr == endPointer);
if (!allCharactersParsed)
return {};

Expand All @@ -225,11 +252,12 @@ std::optional<unsigned> toUnsigned(const std::string_view text)
std::optional<int> toInt(const std::string_view text)
{
int value{};
const auto result = std::from_chars(text.data(), text.data() + text.size(), value);
const auto endPointer = text.data() + text.size();
const auto result = std::from_chars(text.data(), endPointer, value);

if (result.ec != std::errc())
return {};
const auto allCharactersParsed = (result.ptr == &(*text.end()));
const auto allCharactersParsed = (result.ptr == endPointer);
if (!allCharactersParsed)
return {};

Expand Down
10 changes: 8 additions & 2 deletions YUViewLib/src/common/Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

#include <istream>
#include <optional>
#include <string_view>
#include <vector>

namespace functions
{
Expand Down Expand Up @@ -77,8 +79,12 @@ template <size_t N> QStringList toQStringList(const std::array<std::string_view,
return list;
}

std::string toLower(const std::string_view str);
ByteVector readData(std::istream &istream, const size_t nrBytes);
std::string toLower(const std::string_view str);
std::optional<int> toInt(const std::string_view str);
std::vector<std::string_view> splitString(const std::string_view str, const char delimiter);
std::string_view stripWhitespace(std::string_view str);

ByteVector readData(std::istream &istream, const size_t nrBytes);

template <typename T> unsigned clipToUnsigned(T val)
{
Expand Down
34 changes: 0 additions & 34 deletions YUViewLib/src/common/FunctionsGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,40 +108,6 @@ QIcon functionsGui::convertIcon(QString iconPath)
return outIcon;
}

QPixmap functionsGui::convertPixmap(QString pixmapPath)
{
QSettings settings;
QString themeName = settings.value("Theme", "Default").toString();

// Get the active and inactive colors
QStringList colors = functions::getThemeColors(themeName);
QRgb activeColor;
if (colors.size() == 4)
{
QColor active(colors[1]);
activeColor = active.rgb();
}
else
activeColor = qRgb(0, 0, 0);

QImage input(pixmapPath);

QImage active(input.size(), input.format());
for (int y = 0; y < input.height(); y++)
{
for (int x = 0; x < input.width(); x++)
{
QRgb in = input.pixel(x, y);
if (qAlpha(in) != 0)
active.setPixel(x, y, activeColor);
else
active.setPixel(x, y, in);
}
}

return QPixmap::fromImage(active);
}

QString functionsGui::pixelFormatToString(QImage::Format f)
{
if (f == QImage::Format_Invalid)
Expand Down
1 change: 0 additions & 1 deletion YUViewLib/src/common/FunctionsGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,5 @@ void setupUi(void *ui, void (*setupUi)(void *ui, QWidget *widget));

// Return the icon/pixmap from the given file path (inverted if necessary)
QIcon convertIcon(QString iconPath);
QPixmap convertPixmap(QString pixmapPath);

} // namespace functionsGui
47 changes: 0 additions & 47 deletions YUViewLib/src/common/Typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,50 +256,3 @@ enum recacheIndicator
// useless in the cache.
};
Q_DECLARE_METATYPE(recacheIndicator)

#if QT_VERSION <= 0x050700
// copied from newer version of qglobal.h
template <typename... Args> struct QNonConstOverload
{
template <typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
template <typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
{
return ptr;
}
};
template <typename... Args> struct QConstOverload
{
template <typename R, typename T>
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
template <typename R, typename T>
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) Q_DECL_NOTHROW -> decltype(ptr)
{
return ptr;
}
};
template <typename... Args> struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
{
using QConstOverload<Args...>::of;
using QConstOverload<Args...>::operator();
using QNonConstOverload<Args...>::of;
using QNonConstOverload<Args...>::operator();
template <typename R>
Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const Q_DECL_NOTHROW->decltype(ptr)
{
return ptr;
}
template <typename R>
static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
{
return ptr;
}
};
#endif
42 changes: 42 additions & 0 deletions YUViewLib/src/common/TypedefQtDeprecated.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* This file is part of YUView - The YUV player with advanced analytics toolset
* <https://github.com/IENT/YUView>
* Copyright (C) 2015 Institut für Nachrichtentechnik, RWTH Aachen University, GERMANY
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*
* You must obey the GNU General Public License in all respects for all
* of the code used other than OpenSSL. If you modify file(s) with this
* exception, you may extend this exception to your version of the
* file(s), but you are not obligated to do so. If you do not wish to do
* so, delete this exception statement from your version. If you delete
* this exception statement from all source files in the program, then
* also delete it here.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <QCheckBox>

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
constexpr auto QCheckBoxStateChanged = &QCheckBox::checkStateChanged;
#else
constexpr auto QCheckBoxStateChanged = &QCheckBox::stateChanged;
#endif

Loading