M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<SurfaceView
android:id="@+id/surface"
android:layout_width="1dip"
android:layout_height="1dip" />
<ImageView
android:id="@+id/display"
android:layout_width="320dip"
android:layout_height="266dip" />
<SeekBar
android:id="@+id/threshold"
android:layout_marginBottom="10dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" />
</merge>

View File

@ -0,0 +1,62 @@
/*
// block of defines matching what RS will insert at runtime.
struct Params_s{
int inHeight;
int inWidth;
int outHeight;
int outWidth;
float threshold;
};
struct Params_s * Params;
struct InPixel_s{
char a;
char b;
char g;
char r;
};
struct InPixel_s * InPixel;
struct OutPixel_s{
char a;
char b;
char g;
char r;
};
struct OutPixel_s * OutPixel;
*/
struct color_s {
char b;
char g;
char r;
char a;
};
void main() {
int t = uptimeMillis();
struct color_s *in = (struct color_s *) InPixel;
struct color_s *out = (struct color_s *) OutPixel;
int count = Params->inWidth * Params->inHeight;
int i;
float threshold = (Params->threshold * 255.f);
for (i = 0; i < count; i++) {
float luminance = 0.2125f * in->r +
0.7154f * in->g +
0.0721f * in->b;
if (luminance > threshold) {
*out = *in;
} else {
*((int *)out) = *((int *)in) & 0xff000000;
}
in++;
out++;
}
t= uptimeMillis() - t;
debugI32("Filter time", t);
sendToClient(&count, 1, 4, 0);
}