OmaPhoto 1.0.0: the Linux port of Compositor
A layered image editor for Linux and Omarchy, ported from Compositor (github.com/robbietilton/Compositor), whose Swift source is its specification. It reads and writes Compositor's .comp projects. Packages for Ubuntu, Fedora and Arch come from the release workflow; scripts/install/ holds one install script per distribution family, and flake.nix serves NixOS. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
commit
c864304695
564 files changed
+100804
No files matched your search
@@ -0,0 +1,5 @@
|
||||
FROM ubuntu:24.04
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
g++ qt6-base-dev libheif-examples libheif-plugin-x265 libheif-plugin-libde265 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# Runs inside the container: /generator read-only, /fixtures to fill.
|
||||
set -eu
|
||||
|
||||
qt=/usr/include/x86_64-linux-gnu/qt6
|
||||
g++ -std=c++20 -fPIC -I$qt -I$qt/QtCore -I$qt/QtGui /generator/sources.cpp -o sources -lQt6Gui -lQt6Core
|
||||
./sources
|
||||
encode="heif-enc -q 100 -p chroma=444"
|
||||
$encode -o /fixtures/red.heic red.png
|
||||
$encode --premultiplied-alpha -o /fixtures/premultiplied.heic premultiplied.png
|
||||
$encode -o /fixtures/turned-p3.heic turned-p3.jpg
|
||||
# Lossless, no ICC profile: the nclx box names Display P3.
|
||||
heif-enc -L -p chroma=444 --matrix_coefficients=0 --colour_primaries 12 --transfer_characteristic 13 -o /fixtures/p3-nclx.heic warm.png
|
||||
for name in red premultiplied turned-p3 p3-nclx; do
|
||||
heif-info /fixtures/$name.heic | grep -E "^image|color profile|angle"
|
||||
done
|
||||
@@ -0,0 +1,46 @@
|
||||
#include <QBuffer>
|
||||
#include <QColorSpace>
|
||||
#include <QFile>
|
||||
#include <QGuiApplication>
|
||||
#include <QImage>
|
||||
#include <QImageWriter>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
// Red on the left; right: clear over half-clear blue.
|
||||
QImage red(64, 32, QImage::Format_RGBA8888);
|
||||
red.fill(Qt::transparent);
|
||||
// (200, 100, 50) left; right: white over dark gray.
|
||||
QImage warm(64, 32, QImage::Format_RGB888);
|
||||
warm.fill(Qt::white);
|
||||
for (int y = 16; y < 32; ++y) {
|
||||
for (int x = 32; x < 64; ++x)
|
||||
warm.setPixel(x, y, qRgb(16, 16, 16));
|
||||
}
|
||||
for (int y = 0; y < 32; ++y) {
|
||||
for (int x = 0; x < 32; ++x) {
|
||||
red.setPixel(x, y, qRgba(255, 0, 0, 255));
|
||||
warm.setPixel(x, y, qRgb(200, 100, 50));
|
||||
if (y >= 16)
|
||||
red.setPixel(x + 32, y, qRgba(0, 0, 255, 128));
|
||||
}
|
||||
}
|
||||
// The same picture with its colours already multiplied.
|
||||
const QImage multiplied = red.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
|
||||
const QImage stored(multiplied.constBits(), 64, 32, multiplied.bytesPerLine(), QImage::Format_RGBA8888);
|
||||
bool written = red.save("red.png") && stored.save("premultiplied.png") && warm.save("warm.png");
|
||||
// Display P3 by ICC profile, turned by EXIF orientation 6.
|
||||
warm.setColorSpace(QColorSpace::DisplayP3);
|
||||
QByteArray jpeg;
|
||||
QBuffer buffer(&jpeg);
|
||||
QImageWriter writer(&buffer, "jpeg");
|
||||
writer.setQuality(100);
|
||||
written = written && writer.write(warm);
|
||||
QByteArray exif("\xFF\xE1\x00\x22" "Exif\0\0" "II\x2A\x00\x08\x00\x00\x00" "\x01\x00" "\x12\x01\x03\x00\x01\x00\x00\x00", 28);
|
||||
exif += QByteArray("\x06\x00\x00\x00" "\x00\x00\x00\x00", 8);
|
||||
jpeg.insert(2, exif);
|
||||
QFile file("turned-p3.jpg");
|
||||
written = written && file.open(QIODevice::WriteOnly) && file.write(jpeg) == jpeg.size();
|
||||
return written ? 0 : 1;
|
||||
}
|
||||
Reference in new issue
Block a user