forked from rainmeter/rainmeter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImageOptions.h
72 lines (64 loc) · 1.93 KB
/
ImageOptions.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
60
61
62
63
64
65
66
67
68
69
70
71
72
/* Copyright (C) 2018 Rainmeter Project Developers
*
* This Source Code Form is subject to the terms of the GNU General Public
* License; either version 2 of the License, or (at your option) any later
* version. If a copy of the GPL was not distributed with this file, You can
* obtain one at <https://www.gnu.org/licenses/gpl-2.0.html>. */
#ifndef __IMAGEOPTIONS_H__
#define __IMAGEOPTIONS_H__
#include "../Common/Gfx/D2DBitmap.h"
#include "../Common/Gfx/Util/D2DEffectStream.h"
struct ImageOptions : Gfx::FileInfo
{
ImageOptions() :
m_ColorMatrix(D2D1::Matrix5x4F(
-1.0f, -1.0f, -1.0f, -1.0f, -1.0f,
-1.0f, -1.0f, -1.0f, -1.0f, -1.0f,
-1.0f, -1.0f, -1.0f, -1.0f, -1.0f,
-1.0f, -1.0f, -1.0f, -1.0f, -1.0f)),
m_Crop(D2D1::RectF(-1.0f, -1.0f, -1.0f, -1.0f)),
m_CropMode(CROPMODE_TL),
m_GreyScale(false),
m_Rotate(0.0f),
m_Flip(Gfx::Util::FlipType::None),
m_UseExifOrientation(false)
{}
enum CROPMODE
{
CROPMODE_TL = 1,
CROPMODE_TR,
CROPMODE_BR,
CROPMODE_BL,
CROPMODE_C
};
bool operator==(const ImageOptions& other) const
{
for (int i = 0; i < 5; ++i)
{
for (int j = 0; j < 4; ++j)
{
if (m_ColorMatrix.m[i][j] != other.m_ColorMatrix.m[i][j]) return false;
}
}
return wcscmp(m_Path.c_str(), other.m_Path.c_str()) == 0 &&
m_FileSize == other.m_FileSize &&
m_FileTime == other.m_FileTime &&
m_Rotate == other.m_Rotate &&
m_GreyScale == other.m_GreyScale &&
m_UseExifOrientation == other.m_UseExifOrientation &&
m_Flip == other.m_Flip &&
m_CropMode == other.m_CropMode &&
m_Crop.left == other.m_Crop.left &&
m_Crop.top == other.m_Crop.top &&
m_Crop.right == other.m_Crop.right &&
m_Crop.bottom == other.m_Crop.bottom;
}
D2D1_MATRIX_5X4_F m_ColorMatrix;
D2D1_RECT_F m_Crop;
CROPMODE m_CropMode;
bool m_GreyScale;
FLOAT m_Rotate;
Gfx::Util::FlipType m_Flip;
bool m_UseExifOrientation;
};
#endif