Files
OmaPhoto/src/Rendering/RasterSnapshot.h
T
雷电芽衣andClaude c864304695
Release / deb (push) Canceled after 0s
Release / rpm (push) Canceled after 0s
Release / arch (push) Canceled after 0s
Release / publish (push) Canceled after 0s
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>
2026-09-26 00:44:52 -04:00

38 lines
1.3 KiB
C++

#pragma once
#include "Document/BrushStroke.h"
#include "IO/ImageImporter.h"
#include <memory>
#include <mutex>
#include <optional>
#include <vector>
// Immutable sparse raster; paint commits share untouched tiles.
class RasterSnapshot {
public:
const int width;
const int height;
const QImage base;
const QRectF baseRect;
const std::vector<BrushPatch> patches;
const bool isMask;
// Origin of the halving grids, kept across commits.
const QPointF alignment;
RasterSnapshot(int width, int height, QImage base, QRectF baseRect, std::vector<BrushPatch> patches,
bool isMask = false, std::optional<QPointF> alignment = std::nullopt);
static std::shared_ptr<const RasterSnapshot> replacing(const std::optional<ImportedImage> &source,
const QRectF &sourceRect,
const std::vector<BrushPatch> &patches,
const QRectF &crop, bool isMask = false);
void draw(const QRectF &rect, QPainter &context) const;
QImage makeImage() const;
bool hasMaterializedPixels() const;
QImage thumbnail() const;
private:
mutable std::mutex m_lock;
mutable QImage m_materialized;
};