Files
OmaPhoto/tests/BrushCanvasFixtures.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

23 lines
784 B
C++

#pragma once
#include "IO/ImageExporter.h"
#include "SelectionCanvasFixtures.h"
// Shared by the brush's canvas tests: pixels, a red brush.
inline std::vector<int> pixel(const EditorSession &session, int x, int y)
{
const QImage image = ImageExporter::render(session.projectSnapshot().value()).image.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
const uchar *at = image.constScanLine(y) + x * 4;
return {at[0], at[1], at[2], at[3]};
}
// A blank layer, and a hard 10 px red brush.
inline void red(Canvas &shown)
{
shown.session.addBlankLayer();
shown.session.selectTool(NavigationTool::brush);
BrushSettings settings = shown.session.brushSettings();
settings.diameter = 10;
settings.red = 1;
shown.session.setBrushSettings(settings);
}