forked from Zomato/AndroidPhotoFilters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleFilters.java
138 lines (118 loc) · 4.57 KB
/
SampleFilters.java
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package com.zomato.photofilters;
import com.zomato.photofilters.geometry.Point;
import com.zomato.photofilters.imageprocessors.Filter;
import com.zomato.photofilters.imageprocessors.subfilters.BrightnessSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.ContrastSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.ToneCurveSubfilter;
/**
* @author Varun on 01/07/15.
*/
public final class SampleFilters {
private SampleFilters() {
}
public static Filter getStarLitFilter() {
Point[] rgbKnots;
rgbKnots = new Point[8];
rgbKnots[0] = new Point(0, 0);
rgbKnots[1] = new Point(34, 6);
rgbKnots[2] = new Point(69, 23);
rgbKnots[3] = new Point(100, 58);
rgbKnots[4] = new Point(150, 154);
rgbKnots[5] = new Point(176, 196);
rgbKnots[6] = new Point(207, 233);
rgbKnots[7] = new Point(255, 255);
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(rgbKnots, null, null, null));
return filter;
}
public static Filter getBlueMessFilter() {
Point[] redKnots;
redKnots = new Point[8];
redKnots[0] = new Point(0, 0);
redKnots[1] = new Point(86, 34);
redKnots[2] = new Point(117, 41);
redKnots[3] = new Point(146, 80);
redKnots[4] = new Point(170, 151);
redKnots[5] = new Point(200, 214);
redKnots[6] = new Point(225, 242);
redKnots[7] = new Point(255, 255);
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(null, redKnots, null, null));
filter.addSubFilter(new BrightnessSubfilter(30));
filter.addSubFilter(new ContrastSubfilter(1f));
return filter;
}
public static Filter getAweStruckVibeFilter() {
Point[] rgbKnots;
Point[] redKnots;
Point[] greenKnots;
Point[] blueKnots;
rgbKnots = new Point[5];
rgbKnots[0] = new Point(0, 0);
rgbKnots[1] = new Point(80, 43);
rgbKnots[2] = new Point(149, 102);
rgbKnots[3] = new Point(201, 173);
rgbKnots[4] = new Point(255, 255);
redKnots = new Point[5];
redKnots[0] = new Point(0, 0);
redKnots[1] = new Point(125, 147);
redKnots[2] = new Point(177, 199);
redKnots[3] = new Point(213, 228);
redKnots[4] = new Point(255, 255);
greenKnots = new Point[6];
greenKnots[0] = new Point(0, 0);
greenKnots[1] = new Point(57, 76);
greenKnots[2] = new Point(103, 130);
greenKnots[3] = new Point(167, 192);
greenKnots[4] = new Point(211, 229);
greenKnots[5] = new Point(255, 255);
blueKnots = new Point[7];
blueKnots[0] = new Point(0, 0);
blueKnots[1] = new Point(38, 62);
blueKnots[2] = new Point(75, 112);
blueKnots[3] = new Point(116, 158);
blueKnots[4] = new Point(171, 204);
blueKnots[5] = new Point(212, 233);
blueKnots[6] = new Point(255, 255);
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(rgbKnots, redKnots, greenKnots, blueKnots));
return filter;
}
public static Filter getLimeStutterFilter() {
Point[] blueKnots;
blueKnots = new Point[3];
blueKnots[0] = new Point(0, 0);
blueKnots[1] = new Point(165, 114);
blueKnots[2] = new Point(255, 255);
// Check whether output is null or not.
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(null, null, null, blueKnots));
return filter;
}
public static Filter getNightWhisperFilter() {
Point[] rgbKnots;
Point[] redKnots;
Point[] greenKnots;
Point[] blueKnots;
rgbKnots = new Point[3];
rgbKnots[0] = new Point(0, 0);
rgbKnots[1] = new Point(174, 109);
rgbKnots[2] = new Point(255, 255);
redKnots = new Point[4];
redKnots[0] = new Point(0, 0);
redKnots[1] = new Point(70, 114);
redKnots[2] = new Point(157, 145);
redKnots[3] = new Point(255, 255);
greenKnots = new Point[3];
greenKnots[0] = new Point(0, 0);
greenKnots[1] = new Point(109, 138);
greenKnots[2] = new Point(255, 255);
blueKnots = new Point[3];
blueKnots[0] = new Point(0, 0);
blueKnots[1] = new Point(113, 152);
blueKnots[2] = new Point(255, 255);
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(rgbKnots, redKnots, greenKnots, blueKnots));
return filter;
}
}