Files
OmaPhoto/src/UI/JPEGExportSheet.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

53 lines
1.4 KiB
C++

#pragma once
#include "Document/ColorPalette.h"
#include "IO/ImageExporter.h"
#include <QWidget>
#include <atomic>
#include <functional>
#include <memory>
#include <optional>
class QLabel;
class QProgressBar;
class QPushButton;
class QSlider;
class QTimer;
class SwatchButton;
// Swift's JPEGExportSheet: quality, matte and the encoded preview.
class JPEGExportSheet : public QWidget {
Q_OBJECT
public:
// The last export's quality, where the next one starts.
static const QString qualityKey;
JPEGExportSheet(ExportRaster raster, std::function<void(std::optional<QByteArray>)> finish, QWidget *parent = nullptr);
~JPEGExportSheet() override;
private:
class Preview;
void request();
void encode();
void pickMatte();
void synchronize();
const ExportRaster m_raster;
const std::function<void(std::optional<QByteArray>)> m_finish;
JPEGOptions m_options;
std::optional<JPEGResult> m_result;
std::optional<JPEGOptions> m_readyOptions;
std::optional<QString> m_error;
// The newest request's flag, Swift's task cancellation.
std::shared_ptr<std::atomic_bool> m_cancelled;
QTimer *const m_wait;
Preview *const m_preview;
QProgressBar *const m_spinner;
QSlider *const m_quality;
QLabel *const m_percent;
SwatchButton *const m_matteSwatch;
QLabel *const m_failure;
QLabel *const m_bytes;
QLabel *const m_note;
QPushButton *const m_export;
};