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,48 @@
|
||||
#pragma once
|
||||
#include <QImage>
|
||||
#include <QString>
|
||||
#include <compare>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
class RasterSnapshot;
|
||||
|
||||
// Which pixels an asset holds, as CGImage identity did.
|
||||
struct ImageIdentity {
|
||||
const RasterSnapshot *raster = nullptr;
|
||||
qint64 cacheKey = 0;
|
||||
auto operator<=>(const ImageIdentity &) const = default;
|
||||
};
|
||||
|
||||
class ImportedImage {
|
||||
public:
|
||||
ImportedImage(QImage image, QImage thumbnail, QString name);
|
||||
ImportedImage(std::shared_ptr<const RasterSnapshot> raster, QImage thumbnail, QString name);
|
||||
|
||||
QSize size() const;
|
||||
// Painted tiles flatten on first use.
|
||||
QImage image() const;
|
||||
ImageIdentity identity() const;
|
||||
qint64 byteCount() const;
|
||||
|
||||
QImage thumbnail;
|
||||
QString name;
|
||||
std::shared_ptr<const RasterSnapshot> raster;
|
||||
|
||||
private:
|
||||
QImage m_image;
|
||||
};
|
||||
|
||||
class ImageImportError : public std::runtime_error {
|
||||
public:
|
||||
enum class Kind { unreadable, unsupported, tooLarge };
|
||||
explicit ImageImportError(Kind kind);
|
||||
Kind kind;
|
||||
};
|
||||
|
||||
namespace ImageImporter {
|
||||
// Qt refuses decodes over 128 MB; the app's budgets rule.
|
||||
void liftAllocationLimit();
|
||||
// JPEG, PNG, TIFF or HEIC: upright, sRGB, premultiplied.
|
||||
ImportedImage decode(const QString &path, qint64 remainingPixels = 100'000'000);
|
||||
}
|
||||
Reference in new issue
Block a user