-
Notifications
You must be signed in to change notification settings - Fork 2
/
Widget_Filter_PaintRed.h
80 lines (71 loc) · 1.33 KB
/
Widget_Filter_PaintRed.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
#ifndef _WIDGET_PAINT_RED_UI
#define _WIDGET_PAINT_RED_UI
#include "Filters.h"
#include "Widget_SliderInput.h"
class Widget_UI_paintRed
{
int min,max;
ImageProcessor::Filters::Paint_Red filter_agent;
Widget::SliderInput ui_pannel;
bool visible;
bool intrrupt;
int saved_filter_param;
public:
Widget_UI_paintRed()
{
min=0;
max=140;
intrrupt=false;
ui_pannel=Widget::SliderInput("effect","Artify",min,max);
}
void render()
{
if(visible)
{
ui_pannel.render();
if(saved_filter_param!=ui_pannel.getvalue())
{
intrrupt=true;
saved_filter_param=ui_pannel.getvalue();
filter_agent.setvalue(saved_filter_param);
}
else if(ui_pannel.isApplyButtonpressed())
{
intrrupt=true;
}
else
{intrrupt=false;}
}
else return;
}
bool isVisible()
{
return visible;
}
bool applyFilter()
{
return ui_pannel.isApplyButtonpressed();
}
void processWith(unsigned char *image_input,int h,int w,int c)
{
filter_agent.setimage(image_input,h,w,c);
filter_agent.process();
}
bool hasintrrupted()
{
if(intrrupt==true)
{intrrupt=false;
return true;}
else
return false;
}
void setVisiblity(bool visiblity)
{
visible=visiblity;
}
unsigned char* getProcessed()
{
return filter_agent.getimage();
}
};
#endif