小红书.apk(点击下载) / a.java


package t4;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import com.facebook.imagepipeline.nativecode.Bitmaps;
import h4.f;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import k4.i;

/* compiled from: BasePostprocessor */
public abstract class a implements b {

    /* renamed from: a  reason: collision with root package name */
    public static final Bitmap.Config f132384a = Bitmap.Config.ARGB_8888;

    /* renamed from: b  reason: collision with root package name */
    public static Method f132385b;

    public static void d(Bitmap bitmap, Bitmap bitmap2) {
        if (!i.a() || bitmap.getConfig() != bitmap2.getConfig()) {
            new Canvas(bitmap).drawBitmap(bitmap2, 0.0f, 0.0f, (Paint) null);
            return;
        }
        try {
            if (f132385b == null) {
                int i10 = Bitmaps.f22012a;
                f132385b = Bitmaps.class.getDeclaredMethod("copyBitmap", Bitmap.class, Bitmap.class);
            }
            f132385b.invoke(null, bitmap, bitmap2);
        } catch (ClassNotFoundException e14) {
            throw new RuntimeException("Wrong Native code setup, reflection failed.", e14);
        } catch (IllegalAccessException e15) {
            throw new RuntimeException("Wrong Native code setup, reflection failed.", e15);
        } catch (NoSuchMethodException e16) {
            throw new RuntimeException("Wrong Native code setup, reflection failed.", e16);
        } catch (InvocationTargetException e17) {
            throw new RuntimeException("Wrong Native code setup, reflection failed.", e17);
        }
    }

    @Override // t4.b
    public g3.a<Bitmap> c(Bitmap bitmap, f fVar) {
        Bitmap.Config config = bitmap.getConfig();
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        if (config == null) {
            config = f132384a;
        }
        g3.a<Bitmap> c14 = fVar.c(width, height, config);
        try {
            f(c14.F(), bitmap);
            return g3.a.q(c14);
        } finally {
            g3.a.D(c14);
        }
    }

    public abstract void e(Bitmap bitmap);

    public void f(Bitmap bitmap, Bitmap bitmap2) {
        d(bitmap, bitmap2);
        e(bitmap);
    }

    @Override // t4.b
    public String getName() {
        return "Unknown postprocessor";
    }
}