Skip to content

Commit 521bd2b

Browse files
committed
Added add blend, chroma key blend, colour blend, colour burn blend,
colour dodge blend, darken blend, difference blend, divide blend, exclusion blend, hard light blend, hue blend filter, lighten blend, linear burn blend, luminosity blend, mask filter, multiply blend, overlay blend, saturation blend, screen blend, soft light blend, source over blend, subtract blend, crosshatch, halftone, pixellate, polar pixellate, and polka dot. Added example project for all of the two input blend filters.
1 parent 6b053aa commit 521bd2b

File tree

78 files changed

+3222
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3222
-4
lines changed

examples/AllFiltersExample/src/project/android/allfiltersexample/ImageProcessingActivity.java

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,35 @@
3232
import project.android.imageprocessing.filter.colour.AdaptiveThresholdFilter;
3333
import project.android.imageprocessing.filter.colour.ChromaKeyFilter;
3434
import project.android.imageprocessing.filter.processing.ConvolutionFilter;
35-
import project.android.imageprocessing.filter.processing.GaussianBlurFilter;
35+
import project.android.imageprocessing.filter.processing.BilateralBlurFilter;
3636
import project.android.imageprocessing.filter.processing.BoxBlurFilter;
37+
import project.android.imageprocessing.filter.processing.DilationRGBFilter;
38+
import project.android.imageprocessing.filter.processing.FastBlurFilter;
39+
import project.android.imageprocessing.filter.processing.GaussianBlurFilter;
3740
import project.android.imageprocessing.filter.processing.GaussianBlurPositionFilter;
3841
import project.android.imageprocessing.filter.processing.GaussianSelectiveBlurFilter;
3942
import project.android.imageprocessing.filter.processing.SingleComponentFastBlurFilter;
43+
import project.android.imageprocessing.filter.processing.CannyEdgeDetectionFilter;
44+
import project.android.imageprocessing.filter.processing.SingleComponentGaussianBlurFilter;
45+
import project.android.imageprocessing.filter.processing.ThresholdEdgeDetectionFilter;
46+
import project.android.imageprocessing.filter.processing.TiltShiftFilter;
4047
import project.android.imageprocessing.filter.processing.TransformFilter;
4148
import project.android.imageprocessing.filter.processing.MedianFilter;
4249
import project.android.imageprocessing.filter.processing.CropFilter;
4350
import project.android.imageprocessing.filter.processing.LanczosResamplingFilter;
4451
import project.android.imageprocessing.filter.processing.SharpenFilter;
45-
import project.android.imageprocessing.filter.processing.SingleComponentGaussianBlurFilter;
46-
import project.android.imageprocessing.filter.processing.FastBlurFilter;
52+
import project.android.imageprocessing.filter.processing.DilationFilter;
53+
import project.android.imageprocessing.filter.processing.ErosionFilter;
54+
import project.android.imageprocessing.filter.processing.ErosionRGBFilter;
55+
import project.android.imageprocessing.filter.processing.SobelEdgeDetectionFilter;
56+
import project.android.imageprocessing.filter.processing.OpeningFilter;
57+
import project.android.imageprocessing.filter.processing.OpeningRGBFilter;
58+
import project.android.imageprocessing.filter.processing.ClosingFilter;
59+
import project.android.imageprocessing.filter.processing.ClosingRGBFilter;
60+
import project.android.imageprocessing.filter.processing.MotionBlurFilter;
4761
import project.android.imageprocessing.filter.processing.UnsharpMaskFilter;
62+
import project.android.imageprocessing.filter.processing.ZoomBlurFilter;
63+
import project.android.imageprocessing.filter.effect.*;
4864
import project.android.imageprocessing.input.ImageResourceInput;
4965
import project.android.imageprocessing.output.ScreenEndpoint;
5066
import android.os.Bundle;
@@ -81,6 +97,29 @@ protected void onCreate(Bundle savedInstanceState) {
8197
setContentView(view);
8298
image = new ImageResourceInput(view, this, R.drawable.tiger);
8399
filters = new ArrayList<BasicFilter>();
100+
101+
addFilter(new CrosshatchFilter(0.03f, 0.03f));
102+
addFilter(new HalftoneFilter(0.01f, 1f));
103+
addFilter(new PolkaDotFilter(0.9f, 0.03f, 1f));
104+
addFilter(new PolarPixellateFilter(new PointF(0.4f, 0.5f), new PointF(0.05f, 0.05f)));
105+
addFilter(new PixellateFilter(0.01f, 1f));
106+
addFilter(new ZoomBlurFilter(2f, new PointF(0.4f, 0.5f)));
107+
addFilter(new MotionBlurFilter(2f, 45f));
108+
addFilter(new OpeningFilter(1));
109+
addFilter(new OpeningRGBFilter(3));
110+
addFilter(new ClosingFilter(2));
111+
addFilter(new ClosingRGBFilter(4));
112+
addFilter(new ErosionRGBFilter(3));
113+
addFilter(new ErosionFilter(1));
114+
addFilter(new DilationRGBFilter(2));
115+
addFilter(new DilationFilter(4));
116+
addFilter(new CannyEdgeDetectionFilter(1.0f, 0.1f, 0.4f));
117+
addFilter(new ThresholdEdgeDetectionFilter(0.6f));
118+
addFilter(new SobelEdgeDetectionFilter());
119+
TiltShiftFilter tiltShift = new TiltShiftFilter(2f, 0.4f, 0.6f, 0.2f);
120+
tiltShift.registerFilter(image);
121+
addFilter(tiltShift);
122+
addFilter(new BilateralBlurFilter(1f));
84123
addFilter(new MedianFilter());
85124
GaussianBlurPositionFilter positionBlur = new GaussianBlurPositionFilter(2.3f, 1.2f, new PointF(0.4f,0.5f), 0.5f, 0.1f);
86125
positionBlur.registerFilter(image);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="project.android.twoinputfilterexample"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="8"
9+
android:targetSdkVersion="17" />
10+
11+
<application
12+
android:allowBackup="true"
13+
android:icon="@drawable/ic_launcher"
14+
android:label="@string/app_name"
15+
android:theme="@style/AppTheme" >
16+
<activity
17+
android:name="project.android.twoinputfilterexample.ImageProcessingActivity"
18+
android:label="@string/app_name"
19+
android:screenOrientation="landscape" >
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
</application>
27+
28+
</manifest>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
package project.android.fastimageprocessing;
8+
9+
public final class R {
10+
public static final class style {
11+
public static final int AppTheme = 0x7f040001;
12+
public static final int AppBaseTheme = 0x7f040000;
13+
}
14+
public static final class string {
15+
public static final int app_name = 0x7f030000;
16+
}
17+
public static final class drawable {
18+
public static final int ic_launcher = 0x7f020000;
19+
public static final int lookup = 0x7f020001;
20+
public static final int lookup_soft_elegance_1 = 0x7f020004;
21+
public static final int lookup_miss_etikate = 0x7f020003;
22+
public static final int lookup_amatorka = 0x7f020002;
23+
public static final int lookup_soft_elegance_2 = 0x7f020005;
24+
}
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** Automatically generated file. DO NOT MODIFY */
2+
package project.android.twoinputfilterexample;
3+
4+
public final class BuildConfig {
5+
public final static boolean DEBUG = true;
6+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
8+
package project.android.twoinputfilterexample;
9+
10+
public final class R {
11+
public static final class attr {
12+
}
13+
public static final class drawable {
14+
public static final int ic_launcher=0x7f020000;
15+
public static final int lookup=0x7f020001;
16+
public static final int lookup_amatorka=0x7f020002;
17+
public static final int lookup_miss_etikate=0x7f020003;
18+
public static final int lookup_soft_elegance_1=0x7f020004;
19+
public static final int lookup_soft_elegance_2=0x7f020005;
20+
public static final int tiger=0x7f020006;
21+
}
22+
public static final class id {
23+
public static final int menu_settings=0x7f060000;
24+
}
25+
public static final class menu {
26+
public static final int activity_image_processing=0x7f050000;
27+
}
28+
public static final class string {
29+
public static final int app_name=0x7f030000;
30+
public static final int hello_world=0x7f030001;
31+
public static final int menu_settings=0x7f030002;
32+
}
33+
public static final class style {
34+
/**
35+
Base application theme, dependent on API level. This theme is replaced
36+
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
37+
38+
39+
Theme customizations available in newer API levels can go in
40+
res/values-vXX/styles.xml, while customizations related to
41+
backward-compatibility can go here.
42+
43+
44+
Base application theme for API 11+. This theme completely replaces
45+
AppBaseTheme from res/values/styles.xml on API 11+ devices.
46+
47+
API 11 theme customizations can go here.
48+
49+
Base application theme for API 14+. This theme completely replaces
50+
AppBaseTheme from BOTH res/values/styles.xml and
51+
res/values-v11/styles.xml on API 14+ devices.
52+
53+
API 14 theme customizations can go here.
54+
55+
Base application theme, dependent on API level. This theme is replaced
56+
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
57+
58+
59+
Theme customizations available in newer API levels can go in
60+
res/values-vXX/styles.xml, while customizations related to
61+
backward-compatibility can go here.
62+
63+
64+
Base application theme for API 11+. This theme completely replaces
65+
AppBaseTheme from res/values/styles.xml on API 11+ devices.
66+
67+
API 11 theme customizations can go here.
68+
69+
Base application theme for API 14+. This theme completely replaces
70+
AppBaseTheme from BOTH res/values/styles.xml and
71+
res/values-v11/styles.xml on API 14+ devices.
72+
73+
API 14 theme customizations can go here.
74+
*/
75+
public static final int AppBaseTheme=0x7f040000;
76+
/** Application theme.
77+
All customizations that are NOT specific to a particular API-level can go here.
78+
Application theme.
79+
All customizations that are NOT specific to a particular API-level can go here.
80+
*/
81+
public static final int AppTheme=0x7f040001;
82+
}
83+
}
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-17
15+
android.library.reference.1=../../framework/FastImageProcessing
Loading
Loading
Loading
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
2+
3+
<item
4+
android:id="@+id/menu_settings"
5+
android:orderInCategory="100"
6+
android:showAsAction="never"
7+
android:title="@string/menu_settings"/>
8+
9+
</menu>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 11+. This theme completely replaces
5+
AppBaseTheme from res/values/styles.xml on API 11+ devices.
6+
-->
7+
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
8+
<!-- API 11 theme customizations can go here. -->
9+
</style>
10+
11+
</resources>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 14+. This theme completely replaces
5+
AppBaseTheme from BOTH res/values/styles.xml and
6+
res/values-v11/styles.xml on API 14+ devices.
7+
-->
8+
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
9+
<!-- API 14 theme customizations can go here. -->
10+
</style>
11+
12+
</resources>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<string name="app_name">TwoInputFilterExample</string>
5+
<string name="hello_world">Hello world!</string>
6+
<string name="menu_settings">Settings</string>
7+
8+
</resources>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme, dependent on API level. This theme is replaced
5+
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
6+
-->
7+
<style name="AppBaseTheme" parent="android:Theme.Light">
8+
<!--
9+
Theme customizations available in newer API levels can go in
10+
res/values-vXX/styles.xml, while customizations related to
11+
backward-compatibility can go here.
12+
-->
13+
</style>
14+
15+
<!-- Application theme. -->
16+
<style name="AppTheme" parent="AppBaseTheme">
17+
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
18+
</style>
19+
20+
</resources>

0 commit comments

Comments
 (0)