亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pdf417module.java

?? 這是個國外JAVA愛好者寫的條形碼生成器
?? JAVA
字號:
/***********************************************************************************************************************
Copyright (c) 2003, International Barcode Consortium
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of
      conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of
      conditions and the following disclaimer in the documentation and/or other materials
      provided with the distribution.
    * Neither the name of the International Barcode Consortium nor the names of any contributors may be used to endorse
      or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************************************************************/

package net.sourceforge.barbecue.twod.pdf417;

import net.sourceforge.barbecue.Module;
import net.sourceforge.barbecue.output.Output;
import net.sourceforge.barbecue.output.OutputException;

/**
 * Specific module implementation that draws an entire PDF417 barcode
 * as one barbecue module. This is not an ideal implementation, but was
 * the best way of integrating the PDF417 code short of re-writing it.
 *
 * <p/>Contributed by Alex Ferrer <alex@ftconsult.com>
 *
 * @author Alex Ferrer
 * @author <a href="mailto:opensource@ianbourke.com">Ian Bourke</a>
 *
 * @todo Do we really want to fix the DATACOLS to 12?
 */
public class PDF417Module extends Module {
	private static final int DATACOLS = 12;

	private final String data;
	private int[] out;
	private int outlen;
	private int outrows;
	private int col = 0;
	private int xp;
	private int yp;
	private int startX;
	private int wsize = 0;
	private int barWidth;

	/**
	 * Constructs the PDF417 barcode with the specified data.
	 * @param data The data to encode
	 */
	public PDF417Module(String data) {
		super(new int[0]);
		this.data = data;
	}

	/**
	 * Returns the barcode width;
	 * @return The barcode width
	 */
	private int getBarcodeWidth() {
		return wsize - startX;
	}

	/**
	 * Returns the barcode height.
	 * @return The barcode height
	 */
	int getBarcodeHeight() {
		return yp;
	}

	/**
	 * Draw the barcode to the specified outputter, at the specified origin.
	 * @param outputter The outputter
	 * @param x The X component of the origin
	 * @param y The Y component of the origin
	 * @param barWidth
	 * @param barHeight
	 * @return The total width drawn
	 */
	protected int draw(Output outputter, int x, int y, int barWidth, int barHeight) throws OutputException {
		this.xp = (int) x;
		this.startX = (int) x;
		this.yp = (int) y;
		this.barWidth = (int) barWidth;
		createCodewords(data.toCharArray(), data.length());
		createBits(out, outlen, outrows);
		encode(out, outrows, outputter);

		return getBarcodeWidth();
	}

	/**
	 * I have no idea what this does.
	 * @param data The barcode data
	 * @param length The length of the data
	 * @param ecLength The length of the EC (2)
	 */
	private void generateEC(int[] data, int length, int ecLength) {
		int b0 = 0;
		int b1 = 0;
		int g0 = 27;
		int g1 = 917;  /* (x-3)(x-9) = x^2+917x+27 mod 929 */

		/* Initialize */
		data[length] = 0;
		data[length + 1] = 0;

		/* We only know ecLength == 2 for now */
		if (ecLength != 2) {
			return;
		}

		/* Load up with data */
		for (int i = 0; i < length; ++i) {
			int wrap = (b1 + data[i]) % 929;

			if (wrap != 0) {
				wrap = 929 - wrap;
			}

			b1 = (b0 + g1 * wrap) % 929;
			b0 = (0 + g0 * wrap) % 929;
		}

		/* Read off the info */
		if (b0 != 0) {
			b0 = 929 - b0;
		}

		if (b1 != 0) {
			b1 = 929 - b1;
		}

		data[length] = b1;
		data[length + 1] = b0;
	}

	private void outbit(int bit, Output params) throws OutputException {
		params.drawBar(xp, yp, 1, 1, bit == 1);

		xp = xp + barWidth;
		if (col++ == wsize - 1) {
			col = 0;
			yp = yp + 1;
			xp = startX;
		}
	}

	private void createCodewords(char[] data, int len) {
		int ecLength = 2; /* Number of codewords for error correction */
		/* Check args */

		if (DATACOLS < 1 || DATACOLS > 30) {
			return;
		}
		/* Calculate the length of the eventual sequence */
		outlen = 2 + (len / 6) * 5 + (len % 6) + ecLength;

		/* Pad to an integer number of rows, at least 3 */
		outrows = outlen / DATACOLS;
		if ((outlen % DATACOLS) != 0) {
			++outrows;
		}
		if (outrows < 3) {
			outrows = 3;
		}
		if (outrows > 90) {
			return;
		}
		outlen = outrows * DATACOLS;
		/* We don't do multipart symbols (Macro PDF 417) */
		if (outlen > 928) {
			return;
		}

		/* The first two codewords are the length and the BC mode latch
		   The mode latch is 924 if len is a multiple of 6, 901 otherwise */
		out = new int[outlen];              // dimension the array
		out[0] = 2 + (len / 6) * 5 + (len % 6);   // 1st value s size of sequence
		if (len % 6 != 0) {
			out[1] = 901;  					// if len not a multiple of 6
		} else {
			out[1] = 924;                    // if len *is* a multiple of 6
		}

		/* Map blocks of 6 bytes to block of 5 codewords */
		int inp = 0;
		int outp = 2;
		while (inp + 5 < len) {
			/* Treat the 6 bytes as a big-endian base 256 number */
			long codeval = 0;
			for (int i = 0; i < 6; ++i) {
				codeval <<= 8;
				codeval += data[inp++];
			}
			/* Convert the number to base 900 */
			for (int i = 0; i < 5; i++) {
				out[outp + 4 - i] = new Long(codeval % 900).intValue();
				codeval /= 900;
			}
			outp += 5;
		}

		/* Finish up the data */
		while (inp < len) {
			out[outp++] = data[inp++];
		}

		/* Do padding */
		while (outp < outlen - ecLength) {
			out[outp++] = 900;
		}

		generateEC(out, outp, ecLength);
	}

	private void createBits(int[] codes, int codelen, int datarows) {
		int row, inp, outp;
		if (DATACOLS < 1 || DATACOLS > 30
		 				 || datarows < 3 || datarows > 90
		 				 || codelen != DATACOLS * datarows) {
			return;
		}
		/* Each row has start, left, data, right, stop */
		int outlen = datarows * (DATACOLS + 4);
		int[] out = new int[outlen];
		outp = 0;
		inp = 0;

		for (row = 0; row < datarows; ++row) {
			/* Do each row */
			int v = DATACOLS - 1;
			int w = row % 3;
			int x = row / 3;
			int y = datarows / 3;
			int z = 0 * 3 + datarows % 3;  /* The 0 is the error correction level */
			out[outp++] = PDF417Data.PDF417_START;
			switch (w) {
				case 0:
					out[outp++] = PDF417Data.PDF417_BITS[w][30 * x + y];
					break;
				case 1:
					out[outp++] = PDF417Data.PDF417_BITS[w][30 * x + z];
					break;
				case 2:
					out[outp++] = PDF417Data.PDF417_BITS[w][30 * x + v];
					break;
			}
			for (int i = 0; i < DATACOLS; ++i) {
				out[outp++] = PDF417Data.PDF417_BITS[w][codes[inp++]];
			}
			switch (w) {
				case 0:
					out[outp++] = PDF417Data.PDF417_BITS[w][30 * x + v];
					break;
				case 1:
					out[outp++] = PDF417Data.PDF417_BITS[w][30 * x + y];
					break;
				case 2:
					out[outp++] = PDF417Data.PDF417_BITS[w][30 * x + z];
					break;
			}
			out[outp++] = PDF417Data.PDF417_STOP;
		}
		this.out = out;
		this.outlen = outlen;
	}

	private void encode(int[] data, int datarows, Output params) throws OutputException {
		int bitpattern;
		int row_height = 7;
		int npix = 2;
		wsize = ((DATACOLS + 4) * 17 + barWidth + 4) * npix;

		/* Top quiet zone */
		for (int i = 0; i < 2 * npix; i++) {
			for (int j = 0; j < ((DATACOLS + 4) * 17 + 1 + 4) * npix; j++) {
				outbit(0, params);
			}
		}

		for (int i = 0; i < datarows; i++) {
			for (int k = 0; k < row_height; k++) {

				/* Left quiet zone */
				for (int pixn = 0; pixn < 2 * npix; pixn++) {
					outbit(0, params);
				}

				for (int j = 0; j < (DATACOLS + 4); j++) {
					bitpattern = data[(DATACOLS + 4) * i + j];

					for (int bitm = 16; bitm >= 0; bitm--) {
						for (int pixn = 0; pixn < npix; pixn++) {

							if ((bitpattern & (1 << bitm)) != 0) {
								outbit(1, params);
							} else {
								outbit(0, params);
							}
						}
					}
				}

				for (int pixn = 0; pixn < npix; pixn++) {
					outbit(1, params);
				}

				/* Right quiet zone */
				for (int pixn = 0; pixn < 2 * npix; pixn++) {
					outbit(0, params);
				}
			}
		}

		/* Bottom quiet zone */
		for (int i = 0; i < 2 * npix; ++i) {
			for (int j = 0; j < ((DATACOLS + 4) * 17 + 1 + 4) * npix; ++j) {
				outbit(0, params);
			}
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合一区二区| 色吧成人激情小说| av一区二区不卡| 欧美另类久久久品| 中文乱码免费一区二区| 日本亚洲欧美天堂免费| 在线视频你懂得一区二区三区| 26uuu欧美| 美脚の诱脚舐め脚责91 | 亚洲综合视频网| 国产一区二区在线视频| 欧美精品自拍偷拍动漫精品| 尤物av一区二区| 99精品国产一区二区三区不卡| 久久综合久久综合久久| 久久www免费人成看片高清| 色婷婷av一区| 亚洲精品国产无天堂网2021| 99视频在线精品| 中文字幕日韩一区| a在线播放不卡| 国产精品高潮呻吟| 99r精品视频| 中文字幕一区二区三区四区不卡| 国产成人av一区二区| 国产午夜亚洲精品理论片色戒| 精品一区二区日韩| 精品国产一区二区在线观看| 精品视频全国免费看| 欧美成人vr18sexvr| 蜜桃av一区二区三区电影| 欧美老肥妇做.爰bbww视频| 亚洲午夜久久久久久久久久久 | 亚洲一区二区免费视频| heyzo一本久久综合| 国产精品毛片大码女人| 91麻豆自制传媒国产之光| 成人欧美一区二区三区小说 | 亚洲尤物在线视频观看| 日本黄色一区二区| 亚洲不卡在线观看| 制服.丝袜.亚洲.中文.综合| 久久超碰97中文字幕| 久久综合五月天婷婷伊人| 国产成人在线视频免费播放| 国产日产欧美一区二区视频| 播五月开心婷婷综合| 亚洲三级在线播放| 欧美日韩亚洲综合在线| 美女脱光内衣内裤视频久久网站| 2020国产成人综合网| 色综合咪咪久久| 日韩精品五月天| 久久久久97国产精华液好用吗| 成人福利视频在线看| 亚洲一区二区三区在线看| 日韩一区二区三| 成人动漫精品一区二区| 亚洲一区电影777| 久久影视一区二区| 色婷婷亚洲综合| 久久国产精品第一页| 综合色中文字幕| 制服丝袜av成人在线看| 成人的网站免费观看| 日韩高清一区在线| 国产免费成人在线视频| 欧美日韩一级二级三级| 国产精品综合视频| 亚洲影视在线播放| 久久精品网站免费观看| 欧美日韩精品三区| 成人av免费在线观看| 天天av天天翘天天综合网 | 亚洲色图色小说| 99精品国产热久久91蜜凸| 日韩精品成人一区二区三区| 久久精品日韩一区二区三区| 在线欧美日韩国产| 国产乱码一区二区三区| 亚洲成人精品一区| 日本一区二区三区在线不卡| 欧美丰满一区二区免费视频| www.99精品| 国产福利一区二区三区视频在线 | 91麻豆精品国产| 91老司机福利 在线| 国产精品影视天天线| 日韩av电影天堂| 一区二区成人在线视频| 中文字幕精品综合| 久久亚洲综合色| 欧美一区二区精美| 欧美日韩不卡在线| 在线免费av一区| 精品久久久久久久久久久久久久久| 色哟哟精品一区| 粉嫩绯色av一区二区在线观看| 麻豆精品视频在线| 午夜精品福利一区二区三区av| 日韩一区在线看| 国产精品国产三级国产aⅴ中文| 久久久久国产精品厨房| 欧美成人性福生活免费看| 7878成人国产在线观看| 精品视频一区 二区 三区| 欧美这里有精品| 一本一道久久a久久精品| 91免费版在线| 色94色欧美sute亚洲线路一ni | 国产毛片精品视频| 免费看欧美女人艹b| 日韩av不卡在线观看| 午夜精品久久久久影视| 五月婷婷色综合| 日韩成人av影视| 久久精品99国产国产精| 国产综合色视频| 国产伦精品一区二区三区免费| 国精产品一区一区三区mba视频| 美女视频黄 久久| 国产揄拍国内精品对白| 国产不卡视频在线播放| 91在线看国产| 精品视频一区 二区 三区| 91精品国产综合久久久蜜臀图片| 日韩午夜在线影院| 久久尤物电影视频在线观看| 中文字幕第一区综合| 亚洲精品午夜久久久| 亚洲午夜久久久久久久久久久| 奇米四色…亚洲| 国产成人精品免费在线| 99久久99久久久精品齐齐| 欧美午夜宅男影院| 欧美成人猛片aaaaaaa| 国产精品丝袜一区| 亚洲一区中文在线| 国内精品免费在线观看| 成人h精品动漫一区二区三区| 色呦呦网站一区| 日韩欧美激情四射| 国产精品免费人成网站| 无码av免费一区二区三区试看| 精品伊人久久久久7777人| 91日韩一区二区三区| 91精品国产91久久综合桃花| 欧美极品aⅴ影院| 免费高清在线视频一区·| 成人免费av在线| 在线日韩国产精品| 欧美变态口味重另类| 亚洲情趣在线观看| 免费在线看成人av| 91久久久免费一区二区| 欧美电视剧免费全集观看| 亚洲免费伊人电影| 国内成+人亚洲+欧美+综合在线| 99re视频这里只有精品| 日韩午夜激情电影| 一区二区三区成人在线视频| 久久97超碰色| 欧美日韩久久一区二区| 中文字幕欧美激情一区| 美女免费视频一区二区| 在线观看91视频| 国产精品二区一区二区aⅴ污介绍| 亚洲福利一二三区| av午夜一区麻豆| 久久精品综合网| 免费成人av资源网| 欧美精品99久久久**| 亚洲免费三区一区二区| 国产99精品在线观看| 精品噜噜噜噜久久久久久久久试看| 亚洲高清免费视频| 久久久久亚洲综合| 免费观看一级欧美片| 欧美性猛片xxxx免费看久爱| 国产人成亚洲第一网站在线播放| 日本不卡一二三| 在线观看免费亚洲| 亚洲精品乱码久久久久久黑人| 成人av网址在线观看| 久久精品一区二区| 国产一区欧美二区| 亚洲精品在线免费播放| 久久精品国产99久久6| 日韩免费高清视频| 欧美aaaaa成人免费观看视频| 欧美日韩中文另类| 亚洲二区在线观看| 欧美日韩电影在线| 日韩二区三区在线观看| 91麻豆精品国产综合久久久久久| 午夜伊人狠狠久久| 91精品国产欧美日韩| 另类调教123区| 久久先锋影音av| 国产精品白丝jk黑袜喷水|