2021-02-07 23:10:30 +00:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
|
|
|
|
namespace Editor {
|
|
|
|
|
|
|
|
struct PhotoModifications {
|
|
|
|
int angle = 0;
|
|
|
|
bool flipped = false;
|
2021-02-08 07:01:15 +00:00
|
|
|
QRect crop;
|
2021-02-08 03:13:40 +00:00
|
|
|
|
|
|
|
[[nodiscard]] bool empty() const {
|
2021-02-08 07:01:15 +00:00
|
|
|
return !angle && !flipped && !crop.isValid();
|
2021-02-08 03:13:40 +00:00
|
|
|
}
|
|
|
|
[[nodiscard]] explicit operator bool() const {
|
|
|
|
return !empty();
|
|
|
|
}
|
|
|
|
|
2021-02-07 23:10:30 +00:00
|
|
|
};
|
|
|
|
|
2021-02-08 03:13:40 +00:00
|
|
|
[[nodiscard]] QImage ImageModified(
|
|
|
|
QImage image,
|
|
|
|
const PhotoModifications &mods);
|
|
|
|
|
2021-02-07 23:10:30 +00:00
|
|
|
} // namespace Editor
|