/
ColorCurve.h
81 lines (75 loc) · 1.76 KB
/
ColorCurve.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
73
74
75
76
77
78
79
80
81
// ColorCurve.h
#pragma once
#include "Stdafx.h"
#include "GdipEffects.h"
using namespace System;
using namespace System::Drawing;
using namespace System::Runtime::CompilerServices;
namespace GdipEffects {
public enum class CurveAdjustments
{
Exposure = 0,
Density = 1,
Contrast = 2,
Highlight = 3,
Shadow = 4,
Midtone = 5,
WhiteSaturation = 6,
BlackSaturation = 7
};
public enum class CurveChannel
{
All = 0,
Red = 1,
Green = 2,
Blue = 3
};
public ref class ColorCurve sealed :
public Effect
{
public:
ColorCurve();
~ColorCurve();
virtual IntPtr GetNativeWrapper() override {return IntPtr(dynamic_cast<gdip_call_e*>(nativeMember));}
property int AdjustValue
{
int get()
{
return GetParams().adjustValue;
}
void set(int val)
{
auto params = GetParams();
SetParams(params.adjustment, params.channel, val);
}
}
property CurveAdjustments Adjustment
{
CurveAdjustments get()
{
return static_cast<CurveAdjustments>(GetParams().adjustment);
}
void set(CurveAdjustments val)
{
auto params = GetParams();
SetParams(static_cast<Gdiplus::CurveAdjustments>(val), params.channel, params.adjustValue);
}
}
property CurveChannel Channel
{
CurveChannel get()
{
return static_cast<CurveChannel>(GetParams().adjustValue);
}
void set(CurveChannel val)
{
auto params = GetParams();
SetParams(params.adjustment, static_cast<Gdiplus::CurveChannel>(val), params.adjustValue);
}
}
private:
gdip_effect_wrap<Gdiplus::ColorCurve>* nativeMember;
Gdiplus::ColorCurveParams GetParams();
void SetParams(Gdiplus::CurveAdjustments adjustment, Gdiplus::CurveChannel channel, int adjustValue);
};
}