Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 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
3749a00
Pixel format from memory fix
Oct 15, 2025
9fbbf04
Correct RGB565 conversion and use the extract function everywhere
Oct 15, 2025
51251b5
Re-add missing RGB555 BE
Nov 20, 2025
a203c37
Merge branch 'develop' into feature/RGB564
Apr 25, 2026
6693d23
Add a test that executes the calculation of a difference. With this w…
Apr 27, 2026
e2ac875
GCC misses queue include
Apr 27, 2026
0098142
Update checkout action
Apr 27, 2026
81561ba
Refine test to also check the output is zero.
Apr 27, 2026
6b57324
Add test case for RGB565.
Apr 27, 2026
736a789
Correct AI "fix"
Apr 27, 2026
79543c5
In windows, the used image format is different.
Apr 27, 2026
84cb1cd
Also update upload-artifact action
Apr 27, 2026
d35a3de
Add test case for getPixelValue with differences.
Apr 27, 2026
ccac682
Remove unused code
Apr 27, 2026
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
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ IndentWidth: 2
ContinuationIndentWidth: 2
---
Language: Cpp
Standard: c++17
Standard: c++20
ColumnLimit: 100
AlignAfterOpenBracket: Align
BreakBeforeBraces: Allman
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
- run: git fetch --prune --unshallow
Expand All @@ -30,13 +30,15 @@ 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:
matrix:
os: [macos-15, macos-15-intel]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
- run: git fetch --prune --unshallow
Expand All @@ -51,13 +53,15 @@ 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:
matrix:
os: [ubuntu-22.04, macos-15]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
- run: git fetch --prune --unshallow
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 All @@ -125,7 +131,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/artifacts
cp YUView.AppImage $GITHUB_WORKSPACE/artifacts/
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{steps.artifacts.outputs.outputZip}}
path: artifacts
Expand All @@ -140,7 +146,7 @@ jobs:
matrix:
autoUpdate: [true, false]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -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 All @@ -212,19 +220,19 @@ jobs:
cp deployment/wix/bin/Release/YUViewSetup.msi ./
- name: Upload Artifact (Autoupdate)
if: matrix.autoUpdate == true
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: YUView-windows-2022-autoupdate.zip
path: artifacts
- name: Upload Artifact (Autoupdate disabled)
if: matrix.autoUpdate == false
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: YUView-windows-2022.zip
path: artifacts
- name: Upload Windows installer Artifact
if: matrix.autoUpdate == true
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: YYUView-windows-2022.msi
path: ./YUViewSetup.msi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
options: --privileged
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: "YUView.flatpak"
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
59 changes: 6 additions & 53 deletions YUViewLib/src/common/Typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@
// Convenience macro definitions which can be used in if clauses:
// if (is_Q_OS_MAC) ...
#ifdef Q_OS_MAC
const bool is_Q_OS_MAC = true;
constexpr bool is_Q_OS_MAC = true;
#else
const bool is_Q_OS_MAC = false;
constexpr bool is_Q_OS_MAC = false;
#endif

#ifdef Q_OS_WIN
const bool is_Q_OS_WIN = true;
constexpr bool is_Q_OS_WIN = true;
#else
const bool is_Q_OS_WIN = false;
constexpr bool is_Q_OS_WIN = false;
#endif

#ifdef Q_OS_LINUX
const bool is_Q_OS_LINUX = true;
constexpr bool is_Q_OS_LINUX = true;
#else
const bool is_Q_OS_LINUX = false;
constexpr bool is_Q_OS_LINUX = false;
#endif

// Set this to one to enable the code that handles single instances.
Expand Down 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
Loading
Loading