376 lines
17 KiB
Java
376 lines
17 KiB
Java
package o;
|
|
|
|
import android.content.Context;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.Paint;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.PorterDuffColorFilter;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.renderscript.RSRuntimeException;
|
|
import android.view.View;
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
import java.lang.reflect.Array;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public final class fZI {
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
public static Bitmap aCV_(View view) {
|
|
Bitmap createBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
|
|
Canvas canvas = new Canvas(createBitmap);
|
|
Drawable background = view.getBackground();
|
|
if (background != null) {
|
|
background.draw(canvas);
|
|
} else {
|
|
canvas.drawColor(-1);
|
|
}
|
|
view.draw(canvas);
|
|
return createBitmap;
|
|
}
|
|
|
|
public static Bitmap aCX_(View view, fZG fzg) {
|
|
Bitmap aCV_ = aCV_(view);
|
|
Bitmap aCW_ = aCW_(view.getContext(), aCV_, fzg);
|
|
aCV_.recycle();
|
|
return aCW_;
|
|
}
|
|
|
|
public static Bitmap aCW_(Context context, Bitmap bitmap, fZG fzg) {
|
|
Bitmap bitmap2;
|
|
int[] iArr;
|
|
fZG fzg2 = fzg;
|
|
int i = fzg2.b / fzg2.a;
|
|
int i2 = fzg2.d / fzg2.a;
|
|
int[] iArr2 = {i, i2};
|
|
int i3 = 0;
|
|
while (true) {
|
|
Bitmap bitmap3 = null;
|
|
if (i3 >= 2) {
|
|
Bitmap createBitmap = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
|
|
Canvas canvas = new Canvas(createBitmap);
|
|
canvas.scale(1.0f / fzg2.a, 1.0f / fzg2.a);
|
|
Paint paint = new Paint();
|
|
paint.setFlags(3);
|
|
paint.setColorFilter(new PorterDuffColorFilter(fzg2.e, PorterDuff.Mode.SRC_ATOP));
|
|
canvas.drawBitmap(bitmap, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, paint);
|
|
try {
|
|
bitmap2 = aCY_(context, createBitmap, fzg2.c);
|
|
} catch (RSRuntimeException unused) {
|
|
int i4 = fzg2.c;
|
|
if (i4 > 0) {
|
|
int width = createBitmap.getWidth();
|
|
int height = createBitmap.getHeight();
|
|
int i5 = width * height;
|
|
int[] iArr3 = new int[i5];
|
|
createBitmap.getPixels(iArr3, 0, width, 0, 0, width, height);
|
|
int i6 = width - 1;
|
|
int i7 = height - 1;
|
|
int i8 = i4 + i4;
|
|
int i9 = i8 + 1;
|
|
int[] iArr4 = new int[i5];
|
|
int[] iArr5 = new int[i5];
|
|
int[] iArr6 = new int[i5];
|
|
int[] iArr7 = new int[Math.max(width, height)];
|
|
int i10 = (i8 + 2) >> 1;
|
|
int i11 = i10 * i10;
|
|
int i12 = i11 << 8;
|
|
int[] iArr8 = new int[i12];
|
|
for (int i13 = 0; i13 < i12; i13++) {
|
|
iArr8[i13] = i13 / i11;
|
|
}
|
|
int[][] iArr9 = (int[][]) Array.newInstance((Class<?>) Integer.TYPE, i9, 3);
|
|
int i14 = i4 + 1;
|
|
int i15 = 0;
|
|
int i16 = 0;
|
|
int i17 = 0;
|
|
while (i15 < height) {
|
|
int i18 = -i4;
|
|
int i19 = 0;
|
|
int i20 = 0;
|
|
int i21 = 0;
|
|
int i22 = 0;
|
|
int i23 = 0;
|
|
int i24 = 0;
|
|
int i25 = 0;
|
|
int i26 = 0;
|
|
int i27 = 0;
|
|
while (i18 <= i4) {
|
|
Bitmap bitmap4 = createBitmap;
|
|
int i28 = height;
|
|
int i29 = iArr3[i16 + Math.min(i6, Math.max(i18, 0))];
|
|
int[] iArr10 = iArr9[i18 + i4];
|
|
int i30 = i7;
|
|
iArr10[0] = (i29 >> 16) & 255;
|
|
iArr10[1] = (i29 >> 8) & 255;
|
|
iArr10[2] = i29 & 255;
|
|
int abs = i14 - Math.abs(i18);
|
|
int i31 = iArr10[0];
|
|
i19 += i31 * abs;
|
|
int i32 = iArr10[1];
|
|
i23 += i32 * abs;
|
|
int i33 = iArr10[2];
|
|
i24 += abs * i33;
|
|
if (i18 > 0) {
|
|
i22 += i31;
|
|
i21 += i32;
|
|
i20 += i33;
|
|
} else {
|
|
i25 += i31;
|
|
i26 += i32;
|
|
i27 += i33;
|
|
}
|
|
i18++;
|
|
height = i28;
|
|
createBitmap = bitmap4;
|
|
i7 = i30;
|
|
}
|
|
Bitmap bitmap5 = createBitmap;
|
|
int i34 = i7;
|
|
int i35 = height;
|
|
int i36 = i4;
|
|
int i37 = 0;
|
|
while (i37 < width) {
|
|
iArr4[i16] = iArr8[i19];
|
|
iArr5[i16] = iArr8[i23];
|
|
iArr6[i16] = iArr8[i24];
|
|
int[] iArr11 = iArr9[((i36 - i4) + i9) % i9];
|
|
int i38 = iArr11[0];
|
|
int i39 = iArr11[1];
|
|
int i40 = iArr11[2];
|
|
if (i15 == 0) {
|
|
iArr = iArr8;
|
|
iArr7[i37] = Math.min(i37 + i4 + 1, i6);
|
|
} else {
|
|
iArr = iArr8;
|
|
}
|
|
int i41 = iArr3[i17 + iArr7[i37]];
|
|
int i42 = (i41 >> 16) & 255;
|
|
iArr11[0] = i42;
|
|
int i43 = i6;
|
|
int i44 = (i41 >> 8) & 255;
|
|
iArr11[1] = i44;
|
|
int i45 = i41 & 255;
|
|
iArr11[2] = i45;
|
|
int i46 = i22 + i42;
|
|
int i47 = i21 + i44;
|
|
int i48 = i20 + i45;
|
|
i19 = (i19 - i25) + i46;
|
|
i23 = (i23 - i26) + i47;
|
|
i24 = (i24 - i27) + i48;
|
|
i36 = (i36 + 1) % i9;
|
|
int[] iArr12 = iArr9[i36 % i9];
|
|
int i49 = iArr12[0];
|
|
i25 = (i25 - i38) + i49;
|
|
int i50 = iArr12[1];
|
|
i26 = (i26 - i39) + i50;
|
|
int i51 = iArr12[2];
|
|
i27 = (i27 - i40) + i51;
|
|
i22 = i46 - i49;
|
|
i21 = i47 - i50;
|
|
i20 = i48 - i51;
|
|
i16++;
|
|
i37++;
|
|
i6 = i43;
|
|
iArr8 = iArr;
|
|
}
|
|
i17 += width;
|
|
i15++;
|
|
height = i35;
|
|
createBitmap = bitmap5;
|
|
i7 = i34;
|
|
}
|
|
Bitmap bitmap6 = createBitmap;
|
|
int[] iArr13 = iArr8;
|
|
int i52 = i7;
|
|
int i53 = height;
|
|
int i54 = 0;
|
|
while (i54 < width) {
|
|
int i55 = -i4;
|
|
int i56 = i55 * width;
|
|
int i57 = 0;
|
|
int i58 = 0;
|
|
int i59 = 0;
|
|
int i60 = 0;
|
|
int i61 = 0;
|
|
int i62 = 0;
|
|
int i63 = 0;
|
|
int i64 = 0;
|
|
int i65 = 0;
|
|
while (i55 <= i4) {
|
|
int[] iArr14 = iArr7;
|
|
int max = Math.max(0, i56) + i54;
|
|
int[] iArr15 = iArr9[i55 + i4];
|
|
iArr15[0] = iArr4[max];
|
|
iArr15[1] = iArr5[max];
|
|
iArr15[2] = iArr6[max];
|
|
int abs2 = i14 - Math.abs(i55);
|
|
i59 += iArr4[max] * abs2;
|
|
i60 += iArr5[max] * abs2;
|
|
i61 += iArr6[max] * abs2;
|
|
if (i55 > 0) {
|
|
i64 += iArr15[0];
|
|
i57 += iArr15[1];
|
|
i65 += iArr15[2];
|
|
} else {
|
|
i58 += iArr15[0];
|
|
i62 += iArr15[1];
|
|
i63 += iArr15[2];
|
|
}
|
|
int i66 = i52;
|
|
if (i55 < i66) {
|
|
i56 += width;
|
|
}
|
|
i55++;
|
|
i52 = i66;
|
|
iArr7 = iArr14;
|
|
}
|
|
int[] iArr16 = iArr7;
|
|
int i67 = i52;
|
|
int i68 = 0;
|
|
int i69 = i53;
|
|
int i70 = i54;
|
|
int i71 = i4;
|
|
while (i68 < i69) {
|
|
iArr3[i70] = (iArr3[i70] & (-16777216)) | (iArr13[i59] << 16) | (iArr13[i60] << 8) | iArr13[i61];
|
|
int[] iArr17 = iArr9[((i71 - i4) + i9) % i9];
|
|
int i72 = iArr17[0];
|
|
int i73 = iArr17[1];
|
|
int i74 = iArr17[2];
|
|
int i75 = i4;
|
|
if (i54 == 0) {
|
|
iArr16[i68] = Math.min(i68 + i14, i67) * width;
|
|
}
|
|
int i76 = iArr16[i68] + i54;
|
|
int i77 = iArr4[i76];
|
|
iArr17[0] = i77;
|
|
int i78 = iArr5[i76];
|
|
iArr17[1] = i78;
|
|
int i79 = iArr6[i76];
|
|
iArr17[2] = i79;
|
|
int i80 = i64 + i77;
|
|
int i81 = i57 + i78;
|
|
int i82 = i65 + i79;
|
|
i59 = (i59 - i58) + i80;
|
|
i60 = (i60 - i62) + i81;
|
|
i61 = (i61 - i63) + i82;
|
|
i71 = (i71 + 1) % i9;
|
|
int[] iArr18 = iArr9[i71];
|
|
int i83 = iArr18[0];
|
|
i58 = (i58 - i72) + i83;
|
|
int i84 = iArr18[1];
|
|
i62 = (i62 - i73) + i84;
|
|
int i85 = iArr18[2];
|
|
i63 = (i63 - i74) + i85;
|
|
i64 = i80 - i83;
|
|
i57 = i81 - i84;
|
|
i65 = i82 - i85;
|
|
i70 += width;
|
|
i68++;
|
|
i4 = i75;
|
|
}
|
|
i54++;
|
|
i53 = i69;
|
|
i52 = i67;
|
|
iArr7 = iArr16;
|
|
}
|
|
bitmap6.setPixels(iArr3, 0, width, 0, 0, width, i53);
|
|
bitmap3 = bitmap6;
|
|
}
|
|
fzg2 = fzg;
|
|
bitmap2 = bitmap3;
|
|
}
|
|
if (fzg2.a == 1) {
|
|
return bitmap2;
|
|
}
|
|
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap2, fzg2.b, fzg2.d, true);
|
|
bitmap2.recycle();
|
|
return createScaledBitmap;
|
|
}
|
|
if (iArr2[i3] == 0) {
|
|
return null;
|
|
}
|
|
i3++;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:25:0x0059 */
|
|
/* JADX WARN: Removed duplicated region for block: B:27:0x005e */
|
|
/* JADX WARN: Removed duplicated region for block: B:29:0x0063 */
|
|
/* JADX WARN: Removed duplicated region for block: B:31:0x0068 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private static android.graphics.Bitmap aCY_(android.content.Context r5, android.graphics.Bitmap r6, int r7) throws android.renderscript.RSRuntimeException {
|
|
/*
|
|
r0 = 0
|
|
android.renderscript.RenderScript r5 = android.renderscript.RenderScript.create(r5) // Catch: java.lang.Throwable -> L53
|
|
android.renderscript.RenderScript$RSMessageHandler r1 = new android.renderscript.RenderScript$RSMessageHandler // Catch: java.lang.Throwable -> L4d
|
|
r1.<init>() // Catch: java.lang.Throwable -> L4d
|
|
r5.setMessageHandler(r1) // Catch: java.lang.Throwable -> L4d
|
|
android.renderscript.Allocation$MipmapControl r1 = android.renderscript.Allocation.MipmapControl.MIPMAP_NONE // Catch: java.lang.Throwable -> L4d
|
|
r2 = 1
|
|
android.renderscript.Allocation r1 = android.renderscript.Allocation.createFromBitmap(r5, r6, r1, r2) // Catch: java.lang.Throwable -> L4d
|
|
android.renderscript.Type r2 = r1.getType() // Catch: java.lang.Throwable -> L4b
|
|
android.renderscript.Allocation r2 = android.renderscript.Allocation.createTyped(r5, r2) // Catch: java.lang.Throwable -> L4b
|
|
android.renderscript.Element r3 = android.renderscript.Element.U8_4(r5) // Catch: java.lang.Throwable -> L46
|
|
android.renderscript.ScriptIntrinsicBlur r0 = android.renderscript.ScriptIntrinsicBlur.create(r5, r3) // Catch: java.lang.Throwable -> L46
|
|
r0.setInput(r1) // Catch: java.lang.Throwable -> L46
|
|
float r7 = (float) r7 // Catch: java.lang.Throwable -> L46
|
|
r0.setRadius(r7) // Catch: java.lang.Throwable -> L46
|
|
r0.forEach(r2) // Catch: java.lang.Throwable -> L46
|
|
r2.copyTo(r6) // Catch: java.lang.Throwable -> L46
|
|
if (r5 == 0) goto L36
|
|
r5.destroy()
|
|
L36:
|
|
if (r1 == 0) goto L3b
|
|
r1.destroy()
|
|
L3b:
|
|
if (r2 == 0) goto L40
|
|
r2.destroy()
|
|
L40:
|
|
if (r0 == 0) goto L45
|
|
r0.destroy()
|
|
L45:
|
|
return r6
|
|
L46:
|
|
r6 = move-exception
|
|
r4 = r0
|
|
r0 = r5
|
|
r5 = r4
|
|
goto L57
|
|
L4b:
|
|
r6 = move-exception
|
|
goto L4f
|
|
L4d:
|
|
r6 = move-exception
|
|
r1 = r0
|
|
L4f:
|
|
r2 = r0
|
|
r0 = r5
|
|
r5 = r2
|
|
goto L57
|
|
L53:
|
|
r6 = move-exception
|
|
r5 = r0
|
|
r1 = r5
|
|
r2 = r1
|
|
L57:
|
|
if (r0 == 0) goto L5c
|
|
r0.destroy()
|
|
L5c:
|
|
if (r1 == 0) goto L61
|
|
r1.destroy()
|
|
L61:
|
|
if (r2 == 0) goto L66
|
|
r2.destroy()
|
|
L66:
|
|
if (r5 == 0) goto L6b
|
|
r5.destroy()
|
|
L6b:
|
|
throw r6
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: o.fZI.aCY_(android.content.Context, android.graphics.Bitmap, int):android.graphics.Bitmap");
|
|
}
|
|
}
|