mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-24 14:33:02 +02:00
48 lines
880 B
C++
48 lines
880 B
C++
/*
|
|
This file is part of Telegram Desktop,
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
For license and copyright information please follow this link:
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QGraphicsScene>
|
|
|
|
namespace Editor {
|
|
|
|
struct PhotoEditorMode {
|
|
enum class Mode {
|
|
Transform,
|
|
Paint,
|
|
} mode = Mode::Transform;
|
|
|
|
enum class Action {
|
|
None,
|
|
Save,
|
|
Discard,
|
|
} action = Action::None;
|
|
};
|
|
|
|
struct PhotoModifications {
|
|
int angle = 0;
|
|
bool flipped = false;
|
|
QRect crop;
|
|
std::shared_ptr<QGraphicsScene> paint = nullptr;
|
|
|
|
[[nodiscard]] bool empty() const;
|
|
[[nodiscard]] explicit operator bool() const;
|
|
~PhotoModifications();
|
|
|
|
};
|
|
|
|
struct Brush {
|
|
float sizeRatio = 0.;
|
|
QColor color;
|
|
};
|
|
|
|
[[nodiscard]] QImage ImageModified(
|
|
QImage image,
|
|
const PhotoModifications &mods);
|
|
|
|
} // namespace Editor
|