-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathVideoTransformFilterUiCtrl.h
59 lines (53 loc) · 1.82 KB
/
VideoTransformFilterUiCtrl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include <vector>
#include <imgui.h>
#include <Logger.h>
#include <VideoTransformFilter.h>
namespace MEC
{
class VideoTransformFilterUiCtrl
{
public:
VideoTransformFilterUiCtrl(MediaCore::VideoTransformFilter::Holder hTransformFilter);
VideoTransformFilterUiCtrl() = delete;
VideoTransformFilterUiCtrl(const VideoTransformFilterUiCtrl&) = delete;
bool Draw(const ImVec2& v2ViewPos, const ImVec2& v2ViewSize, const ImVec2& v2ImageViewPos, const ImVec2& v2ImageViewSize, int64_t i64Tick, bool* pParamChanged);
enum HandleType : int
{
HT_NONE = 0,
HT_TOP_LEFT,
HT_TOP,
HT_TOP_RIGHT,
HT_LEFT,
HT_CENTER,
HT_RIGHT,
HT_BOTTOM_LEFT,
HT_BOTTOM,
HT_BOTTOM_RIGHT,
HT_AREA,
};
void SetLogLevel(Logger::Level l)
{ m_pLogger->SetShowLevels(l); }
private:
Logger::ALogger* m_pLogger;
MediaCore::VideoTransformFilter::Holder m_hTransformFilter;
ImVec2 m_aImageCornerPoints[4];
std::vector<ImVec2> m_aUiCornerPoints;
bool m_bNeedUpdateCornerPoints{true};
ImU32 m_u32GradLineColor;
float m_fGradLineThickness{1.5f};
ImU32 m_u32ResizeGrabberColor, m_u32ResizeGrabberHoveredColor;
float m_fResizeGrabberRadius{5.f};
ImU32 m_u32CropGrabberColor, m_u32CropGrabberHoveredColor;
float m_fCropGrabberRadius{5.f}, m_fCropGrabberRounding{2.f};
ImU32 m_u32RotationGrabberColor, m_u32RotationGrabberHoveredColor;
float m_fRotationGrabberRadius{5.f};
ImU32 m_u32GrabberBorderColor, m_u32GrabberBorderHoveredColor;
float m_fGrabberBorderThickness{1.5};
float m_fGrabberHoverDetectExtendRadius{5.f};
ImVec2 m_v2PrevMousePos;
ImVec2 m_v2OpBeginHandlePos, m_v2OpBeginAnchorPos, m_v2OpBeginMousePos;
float m_fOpBeginParamVal;
HandleType m_ePrevHandleType{HT_NONE};
};
}