com.google.zxing.BarcodeFormat# values ( ) 源码实例Demo

下面列出了com.google.zxing.BarcodeFormat# values ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。


ParcelableResultDecorator(Parcel in) {
    try {
        int numBits = in.readInt();
        long timestamp = in.readLong();
        String text = in.readString();
        BarcodeFormat barcodeFormat = BarcodeFormat.values()[in.readInt()];

        byte[] rawBytes = new byte[in.readInt()];
        in.readByteArray(rawBytes);

        ResultPoint[] resultPoints = new ResultPoint[in.readInt()];
        for(int i = 0; i < resultPoints.length; i++) {
            resultPoints[i] = new ResultPoint(in.readFloat(), in.readFloat());
        }

        this.result = new Result(text, rawBytes, numBits, resultPoints, barcodeFormat, timestamp);
    } catch (Exception e) {
        // result will be null if reading fails
    }
}
 

public void setDecodeFormats(List<String> decode) {
    decodeFormats=new Vector<BarcodeFormat>();
    for(BarcodeFormat format : BarcodeFormat.values()){
        if(decode.contains(format.toString())){
            decodeFormats.add(format);
        }
    }

}
 

@Ignore protected HistoryItem(Parcel in) {
    _id = in.readInt();
    image = Converters.decodeImage(in.readString());
    text = in.readString();
    rawBytes = in.createByteArray();
    numBits = in.readInt();
    timestamp = in.readLong();
    format = BarcodeFormat.values()[in.readInt()];

    resultPoints = new ResultPoint[in.readInt()];
    for(int i = 0; i < resultPoints.length; i++) {
        resultPoints[i] = new ResultPoint(in.readFloat(), in.readFloat());
    }
}