what-the-bank/sources/com/facetec/sdk/Cdo.java

84 lines
3.0 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.facetec.sdk;
import android.content.Context;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicYuvToRGB;
import android.renderscript.Type;
import android.util.Size;
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: com.facetec.sdk.do, reason: invalid class name */
/* loaded from: classes.dex */
public final class Cdo {
private static RenderScript h;
final Allocation a;
e b;
private final ScriptIntrinsicYuvToRGB c;
private final Allocation d;
private final Size e;
/* JADX INFO: Access modifiers changed from: package-private */
@FunctionalInterface
/* renamed from: com.facetec.sdk.do$e */
/* loaded from: classes.dex */
public interface e {
void onImageAvailable(byte[] bArr, Size size);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static void d(Context context) {
if (h == null) {
h = RenderScript.create(context);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public Cdo(Context context, Size size) {
d(context);
RenderScript renderScript = h;
Type.Builder builder = new Type.Builder(renderScript, Element.YUV(renderScript));
builder.setX(size.getWidth());
builder.setY(size.getHeight());
builder.setYuvFormat(35);
Allocation createTyped = Allocation.createTyped(h, builder.create(), 33);
this.a = createTyped;
createTyped.setOnBufferAvailableListener(new Allocation.OnBufferAvailableListener(this) { // from class: com.facetec.sdk.do$$ExternalSyntheticLambda0
public final Cdo f$0;
@Override // android.renderscript.Allocation.OnBufferAvailableListener
public final void onBufferAvailable(Allocation allocation) {
this.f$0.e(allocation);
}
{
this.f$0 = this;
}
});
this.e = size;
ScriptIntrinsicYuvToRGB create = ScriptIntrinsicYuvToRGB.create(h, Element.createPixel(h, Element.DataType.UNSIGNED_8, Element.DataKind.PIXEL_YUV));
this.c = create;
create.setInput(createTyped);
RenderScript renderScript2 = h;
this.d = Allocation.createTyped(h, new Type.Builder(renderScript2, Element.RGBA_8888(renderScript2)).setX(size.getWidth()).setY(size.getHeight()).create(), 1);
}
/* JADX INFO: Access modifiers changed from: private */
public void e(Allocation allocation) {
this.a.ioReceive();
e eVar = this.b;
if (eVar != null) {
this.c.forEach(this.d);
byte[] bArr = new byte[this.d.getBytesSize()];
this.d.copyTo(bArr);
eVar.onImageAvailable(bArr, this.e);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void e(e eVar) {
this.b = eVar;
}
}