1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright 2013 The Android Open Source Project
3
4    Licensed under the Apache License, Version 2.0 (the "License");
5    you may not use this file except in compliance with the License.
6    You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10    Unless required by applicable law or agreed to in writing, software
11    distributed under the License is distributed on an "AS IS" BASIS,
12    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    See the License for the specific language governing permissions and
14    limitations under the License.
15-->
16
17<graph>
18    <!-- Packages -->
19    <import package="androidx.media.filterpacks.base"/>
20    <import package="androidx.media.filterpacks.image"/>
21    <import package="androidx.media.filterpacks.video"/>
22    <import package="androidx.media.filterpacks.text" />
23    <import package="androidx.media.filterpacks.numeric" />
24    <import package="androidx.media.filterpacks.face" />
25    <import package="androidx.media.filterpacks.transform" />
26    <import package="androidx.media.filterpacks.performance" />
27    <import package="androidx.media.filterfw.samples.simplecamera" />
28    <import package="androidx.media.filterpacks.histogram" />
29    <import package="androidx.media.filterpacks.colorspace" />
30    <import package="androidx.media.filterpacks.sensors" />
31
32    <!-- Filters -->
33    <filter class="ResizeFilter" name="resize" >
34        <input name="outputWidth" intValue="480" />
35        <input name="outputHeight" intValue="640" />
36    </filter>
37
38    <filter class="Camera2Source" name="camera"/>
39
40    <filter class="BranchFilter" name="mainBranch" />
41    <filter class="BranchFilter" name="preMainBranch" />
42    <filter class="BranchFilter" name="featureBranch" />
43
44    <filter class="SurfaceHolderTarget" name="camViewTarget"/>
45
46    <filter class="ScaleFilter" name="scale" >
47        <input name="scale" floatValue="0.50"/>
48    </filter>
49
50    <filter class="SobelFilter" name="sobel" />
51    <filter class="StatsFilter" name="statsFilter" />
52    <filter class="NormFilter" name="normFilter" />
53    <filter class="TextViewTarget" name="goodOrBadTextView" />
54    <filter class="ToGrayValuesFilter" name="sobelConverter" />
55    <filter class="AverageFilter" name="avgFilter" />
56
57    <var name="startCapture" />
58    <filter class="ImageGoodnessFilter" name="goodnessFilter" >
59        <input name="capturing" varValue="startCapture" />
60    </filter>
61
62    <filter class="ToStringFilter" name="scoreToString" />
63    <filter class="TextViewTarget" name="scoreTextView" />
64
65    <filter class="ExposureFilter" name="exposure" />
66
67    <filter class="TextViewTarget" name="fpsTextView" />
68    <filter class="ToStringFilter" name="throughputToString" />
69
70
71    <filter class="ContrastRatioFilter" name="contrast" />
72
73    <filter class="ScaleFilter" name="secondaryScale" >
74        <input name="scale" floatValue="0.50"/>
75    </filter>
76
77    <filter class="ThroughputFilter" name="throughput" />
78
79    <filter class="NewChromaHistogramFilter" name="histogram" />
80    <filter class="ColorfulnessFilter" name="colorfulness" />
81
82    <filter class="MotionSensorWTime" name="motion" />
83
84    <filter class="AvgBrightnessFilter" name="brightness" />
85
86    <filter class="RotateFilter" name="rotate" />
87
88    <filter class="BrightnessFilter" name="snapBrightness" />
89    <filter class="WaveTriggerFilter" name="snapEffect" />
90    <!-- Connections -->
91    <connect sourceFilter="camera" sourcePort="video"
92        targetFilter="rotate" targetPort="image" />
93
94    <connect sourceFilter="camera" sourcePort="orientation"
95        targetFilter="rotate" targetPort="rotateAngle" />
96
97    <connect sourceFilter="rotate" sourcePort="image"
98        targetFilter="resize" targetPort="image" />
99    <connect sourceFilter="resize" sourcePort="image"
100        targetFilter="preMainBranch" targetPort="input" />
101    <connect sourceFilter="preMainBranch" sourcePort="toMainBranch"
102        targetFilter="scale" targetPort="image" />
103    <connect sourceFilter="scale" sourcePort="image"
104         targetFilter="mainBranch" targetPort="input" />
105
106    <connect sourceFilter="preMainBranch" sourcePort="toGoodnessFilter"
107        targetFilter="goodnessFilter" targetPort="image" />
108    <connect sourceFilter="mainBranch" sourcePort="toFeatureBranch"
109        targetFilter="secondaryScale" targetPort="image" />
110    <connect sourceFilter="secondaryScale" sourcePort="image"
111        targetFilter="featureBranch" targetPort="input" />
112
113    <connect sourceFilter="featureBranch" sourcePort="toSobel"
114         targetFilter="sobel" targetPort="image" />
115
116    <connect sourceFilter="sobel" sourcePort="magnitude"
117         targetFilter="sobelConverter" targetPort="image" />
118
119    <connect sourceFilter="sobelConverter" sourcePort="image"
120         targetFilter="statsFilter" targetPort="buffer" />
121
122    <connect sourceFilter="statsFilter" sourcePort="mean"
123         targetFilter="normFilter" targetPort="x" />
124
125    <connect sourceFilter="statsFilter" sourcePort="stdev"
126         targetFilter="normFilter" targetPort="y" />
127
128    <connect sourceFilter="normFilter" sourcePort="norm"
129         targetFilter="avgFilter" targetPort="sharpness" />
130
131    <connect sourceFilter="avgFilter" sourcePort="avg"
132         targetFilter="goodnessFilter" targetPort="sharpness" />
133
134    <connect sourceFilter="goodnessFilter" sourcePort="goodOrBadPic"
135         targetFilter="goodOrBadTextView" targetPort="text" />
136
137    <connect sourceFilter="featureBranch" sourcePort="toExposure"
138        targetFilter="exposure" targetPort="image" />
139    <connect sourceFilter="exposure" sourcePort="underExposureRating"
140        targetFilter="goodnessFilter" targetPort="underExposure" />
141    <connect sourceFilter="exposure" sourcePort="overExposureRating"
142        targetFilter="goodnessFilter" targetPort="overExposure" />
143
144    <connect sourceFilter="goodnessFilter" sourcePort="score"
145        targetFilter="scoreToString" targetPort="object" />
146    <connect sourceFilter="scoreToString" sourcePort="string"
147        targetFilter="scoreTextView" targetPort="text" />
148
149    <connect sourceFilter="mainBranch" sourcePort="camView"
150        targetFilter="throughput" targetPort="frame" />
151    <connect sourceFilter="throughput" sourcePort="frame"
152        targetFilter="snapBrightness" targetPort="image" />
153    <connect sourceFilter="snapEffect" sourcePort="value"
154        targetFilter="snapBrightness" targetPort="brightness" />
155    <connect sourceFilter="snapBrightness" sourcePort="image"
156        targetFilter="camViewTarget" targetPort="image" />
157    <connect sourceFilter="throughput" sourcePort="throughput"
158        targetFilter="throughputToString" targetPort="object" />
159    <connect sourceFilter="throughputToString" sourcePort="string"
160        targetFilter="fpsTextView" targetPort="text" />
161
162    <connect sourceFilter="featureBranch" sourcePort="contrastRatio"
163        targetFilter="contrast" targetPort="image" />
164    <connect sourceFilter="contrast" sourcePort="contrastRatingToGoodness"
165        targetFilter="goodnessFilter" targetPort="contrastRating" />
166
167    <connect sourceFilter="mainBranch" sourcePort="colorfulness"
168        targetFilter="histogram" targetPort="image" />
169    <connect sourceFilter="histogram" sourcePort="histogram"
170        targetFilter="colorfulness" targetPort="histogram" />
171    <connect sourceFilter="colorfulness" sourcePort="score"
172        targetFilter="goodnessFilter" targetPort="colorfulness" />
173
174    <connect sourceFilter="motion" sourcePort="values"
175        targetFilter="goodnessFilter" targetPort="motionValues" />
176
177    <connect sourceFilter="featureBranch" sourcePort="brightness"
178        targetFilter="brightness" targetPort="image" />
179    <connect sourceFilter="brightness" sourcePort="brightnessRating"
180        targetFilter="goodnessFilter" targetPort="brightness" />
181</graph>
182
183