mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Moved to separate file some structs for internal usage in photo editor.
This commit is contained in:
parent
bf8f3e42f4
commit
d2d97a3e47
8 changed files with 38 additions and 19 deletions
|
@ -525,6 +525,7 @@ PRIVATE
|
||||||
editor/photo_editor_content.h
|
editor/photo_editor_content.h
|
||||||
editor/photo_editor_controls.cpp
|
editor/photo_editor_controls.cpp
|
||||||
editor/photo_editor_controls.h
|
editor/photo_editor_controls.h
|
||||||
|
editor/photo_editor_inner_common.h
|
||||||
editor/photo_editor_layer_widget.cpp
|
editor/photo_editor_layer_widget.cpp
|
||||||
editor/photo_editor_layer_widget.h
|
editor/photo_editor_layer_widget.h
|
||||||
editor/scene/scene.cpp
|
editor/scene/scene.cpp
|
||||||
|
|
|
@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/unique_qptr.h"
|
#include "base/unique_qptr.h"
|
||||||
#include "editor/photo_editor_common.h"
|
#include "editor/photo_editor_inner_common.h"
|
||||||
#include "ui/effects/animations.h"
|
#include "ui/effects/animations.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
|
|
||||||
#include "editor/photo_editor_common.h"
|
#include "editor/photo_editor_common.h"
|
||||||
|
#include "editor/photo_editor_inner_common.h"
|
||||||
#include "editor/scene/scene_item_base.h"
|
#include "editor/scene/scene_item_base.h"
|
||||||
|
|
||||||
class QGraphicsItem;
|
class QGraphicsItem;
|
||||||
|
|
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "base/unique_qptr.h"
|
#include "base/unique_qptr.h"
|
||||||
#include "editor/photo_editor_common.h"
|
#include "editor/photo_editor_common.h"
|
||||||
|
#include "editor/photo_editor_inner_common.h"
|
||||||
#include "ui/image/image.h"
|
#include "ui/image/image.h"
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
|
|
|
@ -11,19 +11,6 @@ namespace Editor {
|
||||||
|
|
||||||
class Scene;
|
class Scene;
|
||||||
|
|
||||||
struct PhotoEditorMode {
|
|
||||||
enum class Mode {
|
|
||||||
Transform,
|
|
||||||
Paint,
|
|
||||||
} mode = Mode::Transform;
|
|
||||||
|
|
||||||
enum class Action {
|
|
||||||
None,
|
|
||||||
Save,
|
|
||||||
Discard,
|
|
||||||
} action = Action::None;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PhotoModifications {
|
struct PhotoModifications {
|
||||||
int angle = 0;
|
int angle = 0;
|
||||||
bool flipped = false;
|
bool flipped = false;
|
||||||
|
@ -46,11 +33,6 @@ struct EditorData {
|
||||||
bool keepAspectRatio = false;
|
bool keepAspectRatio = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Brush {
|
|
||||||
float sizeRatio = 0.;
|
|
||||||
QColor color;
|
|
||||||
};
|
|
||||||
|
|
||||||
[[nodiscard]] QImage ImageModified(
|
[[nodiscard]] QImage ImageModified(
|
||||||
QImage image,
|
QImage image,
|
||||||
const PhotoModifications &mods);
|
const PhotoModifications &mods);
|
||||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
|
|
||||||
#include "editor/photo_editor_common.h"
|
#include "editor/photo_editor_common.h"
|
||||||
|
#include "editor/photo_editor_inner_common.h"
|
||||||
#include "ui/image/image.h"
|
#include "ui/image/image.h"
|
||||||
|
|
||||||
namespace Editor {
|
namespace Editor {
|
||||||
|
|
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "ui/effects/animations.h"
|
#include "ui/effects/animations.h"
|
||||||
#include "editor/photo_editor_common.h"
|
#include "editor/photo_editor_common.h"
|
||||||
|
#include "editor/photo_editor_inner_common.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class IconButton;
|
class IconButton;
|
||||||
|
|
32
Telegram/SourceFiles/editor/photo_editor_inner_common.h
Normal file
32
Telegram/SourceFiles/editor/photo_editor_inner_common.h
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
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 {
|
||||||
|
|
||||||
|
class Scene;
|
||||||
|
|
||||||
|
struct PhotoEditorMode {
|
||||||
|
enum class Mode {
|
||||||
|
Transform,
|
||||||
|
Paint,
|
||||||
|
} mode = Mode::Transform;
|
||||||
|
|
||||||
|
enum class Action {
|
||||||
|
None,
|
||||||
|
Save,
|
||||||
|
Discard,
|
||||||
|
} action = Action::None;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Brush {
|
||||||
|
float sizeRatio = 0.;
|
||||||
|
QColor color;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Editor
|
Loading…
Add table
Reference in a new issue