gpt4 book ai didi

android - 如何禁用 z bar for android 平台中未使用的符号?

转载 作者:行者123 更新时间:2023-11-29 21:03:58 26 4
gpt4 key购买 nike

我已经将 zbar scanner for android 集成到我的应用程序中,我只使用该应用程序扫描二维码,所以现在我想通过禁用未使用的符号(如 PDF417 CODE39 等)来优化阅读器,我应该在哪里更改?而且我一直想知道文件 Symbol.java 中数字的含义,例如“QRCODE = 64” Thx :)这些是一些核心文件:

配置.java

public class Config
{

public static final int ENABLE = 0;
public static final int ADD_CHECK = 1;
public static final int EMIT_CHECK = 2;
public static final int ASCII = 3;
public static final int MIN_LEN = 32;
public static final int MAX_LEN = 33;
public static final int UNCERTAINTY = 64;
public static final int POSITION = 128;
public static final int X_DENSITY = 400;
public static final int Y_DENSITY = 400;

}

符号.java

public class Symbol
{

public static final int NONE = 0;
public static final int PARTIAL = 1;
public static final int EAN8 = 8;
public static final int UPCE = 9;
public static final int ISBN10 = 10;
public static final int UPCA = 12;
public static final int EAN13 = 13;
public static final int ISBN13 = 14;
public static final int I25 = 25;
public static final int DATABAR = 34;
public static final int DATABAR_EXP = 35;
public static final int CODABAR = 38;
public static final int CODE39 = 39;
public static final int PDF417 = 57;
public static final int QRCODE = 64;
public static final int CODE93 = 93;
public static final int CODE128 = 128;
private long peer;
private int type;

private static native void init();

Symbol(long l)
{
peer = l;
}

protected void finalize()
{
destroy();
}

public synchronized void destroy()
{
if (peer != 0L)
{
destroy(peer);
peer = 0L;
}
}

private native void destroy(long l);

public int getType()
{
if (type == 0)
type = getType(peer);
return type;
}

private native int getType(long l);

public native int getConfigMask();

public native int getModifierMask();

public native String getData();

public native byte[] getDataBytes();

public native int getQuality();

public native int getCount();

public int[] getBounds()
{
int i = getLocationSize(peer);
if (i <= 0)
return null;
int ai[] = new int[4];
int j = 0x7fffffff;
int k = 0x80000000;
int l = 0x7fffffff;
int i1 = 0x80000000;
for (int j1 = 0; j1 < i; j1++)
{
int k1 = getLocationX(peer, j1);
if (j > k1)
j = k1;
if (k < k1)
k = k1;
int l1 = getLocationY(peer, j1);
if (l > l1)
l = l1;
if (i1 < l1)
i1 = l1;
}

ai[0] = j;
ai[1] = l;
ai[2] = k - j;
ai[3] = i1 - l;
return ai;
}

private native int getLocationSize(long l);

private native int getLocationX(long l, int i);

private native int getLocationY(long l, int i);

public int[] getLocationPoint(int i)
{
int ai[] = new int[2];
ai[0] = getLocationX(peer, i);
ai[1] = getLocationY(peer, i);
return ai;
}

public native int getOrientation();

public SymbolSet getComponents()
{
return new SymbolSet(getComponents(peer));
}

private native long getComponents(long l);

native long next();

static
{
System.loadLibrary("zbarjni");
init();
}
}

修改器.java

public class Modifier
{

public static final int GS1 = 0;
public static final int AIM = 1;

public Modifier()
{
}
}

符号集.java

public class SymbolSet extends AbstractCollection
{

private long peer;

private static native void init();

SymbolSet(long l)
{
peer = l;
}

protected void finalize()
{
destroy();
}

public synchronized void destroy()
{
if (peer != 0L)
{
destroy(peer);
peer = 0L;
}
}

private native void destroy(long l);

public Iterator iterator()
{
long l = firstSymbol(peer);
if (l == 0L)
return new SymbolIterator(null);
else
return new SymbolIterator(new Symbol(l));
}

public native int size();

private native long firstSymbol(long l);

static
{
System.loadLibrary("zbarjni");
init();
}
}

最佳答案

像这样:

scanner = new ImageScanner();
// disable all symbologies first
scanner.setConfig(0, Config.ENABLE, 0);
// only enable QRCODE
scanner.setConfig(Symbol.QRCODE, Config.ENABLE, 1);

使用 setConfig 有三个参数都是 int 的。第一个是您想要影响的符号,使用 Symbol 静态属性或对所有符号使用 0。第二个是您要使用 Config 静态属性设置的设置。三是设定值。

关于android - 如何禁用 z bar for android 平台中未使用的符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25095933/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com