package com.lynx.tasm.utils;

import android.graphics.Bitmap;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.lynx.tasm.base.LLog;
import com.lynx.tasm.base.TraceEvent;

public class BlurUtils {
    static {
        Covode.recordClassIndex(47092);
    }

    public static native void nativeIterativeBoxBlur(Bitmap bitmap, int i, int i2);

    public static void iterativeBoxBlur(Bitmap bitmap, int i) {
        MethodCollector.i(5250);
        if (bitmap == null) {
            LLog.LIZ(5, "Blur", "bitmap is null");
            MethodCollector.o(5250);
        } else if (i <= 0) {
            LLog.LIZ(5, "Blur", "radius <= 0");
            MethodCollector.o(5250);
        } else {
            try {
                TraceEvent.LIZ(0, "image.BlurUtils.nativeIterativeBoxBlur");
                nativeIterativeBoxBlur(bitmap, 3, i);
                TraceEvent.LIZIZ(0, "image.BlurUtils.nativeIterativeBoxBlur");
                MethodCollector.o(5250);
            } catch (RuntimeException e) {
                LLog.LIZ(5, "Blur", e.getMessage());
                MethodCollector.o(5250);
            }
        }
    }
}
