package com.ss.android.ttve.nativePort;

import X.8XX;
import android.graphics.Bitmap;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.util.Map;

public class TEEffectUtils {

    public interface ImageListener {
        static {
            Covode.recordClassIndex(49420);
        }

        void onData(int[] iArr, int i, int i2, int i3);
    }

    public interface QrImageListener {
        static {
            Covode.recordClassIndex(49421);
        }

        void onData(int[] iArr, int i, int i2, int i3);
    }

    public static native String getAudioAECModelName();

    public static native String getAudioAECResnet44KModelName();

    public static native String getEffectVersion();

    public static String getTaintSceneDetectModelName() {
        return "lens_taint_scene_detect";
    }

    public static native int nativeGetQREncodedData(String str, int[] iArr, ImageListener imageListener);

    public static native int nativeGetQREncodedDataWithWH(String str, int i, int i2, int[] iArr, QrImageListener qrImageListener);

    public static native boolean nativeResizeImageWithEffect2(Bitmap bitmap, Bitmap bitmap2, boolean z);

    static {
        Covode.recordClassIndex(49419);
        8XX.LIZ();
    }

    public static boolean resizeImageWithEffect(Bitmap bitmap, Bitmap bitmap2, boolean z) {
        MethodCollector.i(4368);
        boolean nativeResizeImageWithEffect2 = nativeResizeImageWithEffect2(bitmap, bitmap2, z);
        MethodCollector.o(4368);
        return nativeResizeImageWithEffect2;
    }

    public static int getQREncodedData(String str, Map<Integer, Integer> map, ImageListener imageListener) {
        int[] iArr;
        MethodCollector.i(4221);
        if (map != null) {
            iArr = new int[(map.size() * 2)];
            int i = 0;
            for (Map.Entry next : map.entrySet()) {
                iArr[i] = ((Integer) next.getKey()).intValue();
                iArr[i + 1] = ((Integer) next.getValue()).intValue();
                i += 2;
            }
        } else {
            iArr = null;
        }
        int nativeGetQREncodedData = nativeGetQREncodedData(str, iArr, imageListener);
        MethodCollector.o(4221);
        return nativeGetQREncodedData;
    }

    public static int getQREncodedData(String str, int i, int i2, Map<Integer, Integer> map, QrImageListener qrImageListener) {
        int[] iArr;
        MethodCollector.i(4298);
        if (map != null) {
            iArr = new int[(map.size() * 2)];
            int i3 = 0;
            for (Map.Entry next : map.entrySet()) {
                iArr[i3] = ((Integer) next.getKey()).intValue();
                iArr[i3 + 1] = ((Integer) next.getValue()).intValue();
                i3 += 2;
            }
        } else {
            iArr = null;
        }
        int nativeGetQREncodedDataWithWH = nativeGetQREncodedDataWithWH(str, i, i2, iArr, qrImageListener);
        MethodCollector.o(4298);
        return nativeGetQREncodedDataWithWH;
    }
}
