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

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

?? pdf417_dec.c

?? PDF417編碼的算法的源程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
#include <ctype.h>
#include <stdio.h>
#include <math.h>
#include <pgm.h>
#include "bitcodes.h"

typedef unsigned int UInt32;

#define MAX_SQUARES 5000
#define MAX_LINE_PIXEL  17000   // a line all the way thru symbol
#define MAX_MOD_PIXEL   1700   // a line thru one modules worth = 17 bars
#define MAX_X_PIXEL 17000
#define MAX_Y_PIXEL 5000
#define OUT_MAX_X_PIXEL 6000
#define OUT_MAX_Y_PIXEL 2000
#define MAX_XPIXEL_MODULE  900    // number of x pixels in a 17 wide module
#define MAX_YPIXEL_MODULE 300    // number of y pixels in a 17 wide module
#define MAX_SYMBOL_ROWS  100  // standard limits it to 90
#define MAX_SYMBOL_COLS  330  // min 3 rows 929/3 = 310 
#define MAX_LINES_X 300
#define MAX_LINES_Y 300
#define MAX_TOT_LR   5000
#define MAX_BARS  2000
#define MAX_PB 1500
#define MAX_MOD_BARS 5     // at most 5 bars in a module ( actually 4 )
#define MAX_LINE_SCANS 120
#define TRUE 1
#define FALSE 0

// scan defines

 #define MAX_BYTE_INDEX 1024
 #define MAX_CODE 2500

 #define ALPHA 0
 #define LOWER 1
 #define MIXED 2
 #define PUNCT 3
 #define PUNCT_SH 4

 #define MAX_ROW 91
 #define MAX_COL 512
 #define NULLCHAR '\0'

 #define MAX_RAW_CODES 1500
 #define MIN_ROW_HEIGHT  4
 #define MIN_COL_WIDTH   4
 #define EDGE_THRESHOLD  10

 #define MAX_PIXEL_Y 2048
 #define MAX_PIXEL_X 2048


 #define NN 1024
 #define PRIM 1
 #define GPRIME 929
 #define KK 32
 #define A0 928
 #define Ldec 1

#define sgn(x) ((x<0)?-1:((x>0)?1:0)) /* macro to return the sign of a
                                         number */
void  write_pgm_outpix_final( int num_cols, int num_rows);
void write_pgm_outmod(char *namestrin,  int num_cols, int num_rows);
void write_pgm_outcol(char *namestrin,  int num_cols, int num_rows);
void write_pgm_out( int num_cols, int num_rows);
void write_pgm_outpix( int num_cols, int num_rows);

FILE *wr_data_file;
FILE *infile1, *outfile1,*infile;

int fail;
char inargstr[120];

char pgm_infile_str[120];

int write_mods;      // flags to control writing of pgm outputs
int write_final_pix;  // write the symbol after unslanting 
int write_leftcol;    // write the left column of the symbol
int write_cols;       // write the individual columns
int write_outpix;        // write the symbol before unslanting 
int write_data;         // write the bitcodes for each row, and col

int box_x_incr;   // size of box used to find the symbol
int box_y_incr;   // inside the white space that should surround it

int slope_array[100];
int fig_flag;

int tot_lr[MAX_TOT_LR];      // used by get_columns_start
int tot_lr_in[MAX_TOT_LR];    // 1st derivative of tot_lr

int begin_left_col;   // beginning pixel of left column
int begin_right_bars;  // beginning pixel of right bars

int min_box_x;
int min_box_y;
int max_box_x;
int max_box_y;

int bytes_per_pix;      // bytes per pixel

int col_begin_x[400];     // beginning x value of each column

float onewidthf;
int onewidth;
float onewf;
int num_sym_cols;

int anal_mod_index;     // successful index for analyze module
int rule_mod_index;     // successful index for rule_checker
int slide_mod_index;
int xline_mod_index;

int symbol_data[MAX_SYMBOL_ROWS][MAX_SYMBOL_COLS]; 
             //  put the codes for rows and columns here

int bestfig;
int pixel_out_xlen;   // size of the pix_out in x direction
int pixel_out_ylen;   // size of the pix_out in y direction

int dir;
int slope;
int pix_slope;       // final correction slope
float pix_slopef;

int best_normal_x;
int best_normal_y;
int best_normal_dir;
int best_onewidth;
int best_begin_left_col;
int best_begin_right_bars;
int best_num_sym_cols;
int best_pix_slope;
int best_normal_slope;
int best_pixel_out_xlen;
int best_pixel_out_ylen;
float best_onewf;

int left_highy;     // highest y value in pix_out at middle of left fat bar
int right_highy;    // highest y value in pix_out at middle of right fat bar
int left_highx;
int right_highx;
int y_begin;       // this is the estimated center of the top row

int scan_upleft_x;   // these are the beginning points of places to scan from
int scan_upleft_y;

int scan_cenleft_x;
int scan_cenleft_y;

int scan_lowleft_x;
int scan_lowleft_y;
int out_cnt;

int save_line_cnt;  // should not be more than 36

int dark_sqindex;      // indexs all the dark squares in the original image
int dark_threshold;    // average grey value of a dark square
int line_threshold;    
int lpixel;
int pixel_cnt;    
int post_pixel_cnt;
int mod_pixel_cnt;

    
int symbol_height;    // pixel count height of symbol at left wide bar

int number_of_rows;   // number of rows in pixel map
int number_of_cols;  // number of columns in pixel map
int row_height_avg;   // avg of row_height high and low estimate
int best_row_height;  // best estimate of row height
int best_col_width_avg;  // best estimate of avg column width

int pix_col_yline[MAX_LINES_Y];  // y co-ordinant of lines in column data
int pix_col_xline[MAX_LINES_X];  // x co-ordinant of lines in column data
int pix_col_ydiffs[MAX_LINES_Y];
int vert_line_cnt;

void draw_normal(int nx, int ny, int nslope, int ndir, int ylen);

void line_fast_norm(int x1, int y1, int x2, int y2);

void find_height(int nx, int ny, int nslope, int ndir, int ylen);

void final_pix(int xlen, int ylen );

void find_left_edge(int nx, int ny, int nslope, int ndir, int ylen, int xlen);

void get_a_column(int indexin, int startx, int onewid);

struct pixelod
{
  int greyval;
} pix_in[MAX_X_PIXEL * MAX_Y_PIXEL];

struct pixeluu
{
  int greyval;
} pix_module[MAX_XPIXEL_MODULE][MAX_YPIXEL_MODULE];

struct pixeltt
{
  int greyval;
} pix_cols[OUT_MAX_X_PIXEL][OUT_MAX_Y_PIXEL];

struct pixelzz
{
  int greyval;
} pix_out[OUT_MAX_X_PIXEL][OUT_MAX_Y_PIXEL];

struct pixelqq
{
  int greyval;
} pix_final[OUT_MAX_X_PIXEL][OUT_MAX_Y_PIXEL];
 
struct pixeldo 
{
  int greyval;
} pixel_array[MAX_X_PIXEL][MAX_Y_PIXEL];

struct darksqstuff
{
  int xloc;
  int yloc;
} dark_squares[MAX_SQUARES];

// codes from bit analysis go here

struct pb_stuff
{
  int rowval;
  int colval;
  int codeval;
} pb_array[MAX_PB];

int bar_cnt;   // count of bars
int pb_index;
int mod_bar_cnt;   // count of bars in a particular module

int b_box_xlen;
int b_box_ylen;
int b_box_maxx;
int b_box_maxy;
int b_box_minx;
int b_box_miny;
float max_theta;	/* Maximum theta range */
int barwidth;

struct barstuff
{
  int beginx;
  int beginy;
  int endx;
  int endy;
  int space_width;  // width of space before bar
  int width;
  int lpixel; 
}  bar_array[MAX_BARS];

struct mbarstuff
{
  int beginx;
  int beginy;
  int endx;
  int endy;
  int space_width;  // width of space before bar
  int width;
  int lpixel; 
}  mod_bar_array[MAX_MOD_BARS];

 int mod_bit_array[40];

struct linesavestuff
{
  int pixelcnt;
  int slope;
  int dir;
  int beginx;
  int beginy;
  int has_8111;   // begin 
  int has_7111;   // end
  int endlpixel;
  int endwidth;    // width of 7 wide end bar
  int beginwidth;   // width of begin 8 wide bar
  int barcnt;
  int bars_found;
  int normal_val;          // find the number of pixels hit by normal
  int line_vals[MAX_LINE_PIXEL];
  int line_x[MAX_LINE_PIXEL];
  int line_y[MAX_LINE_PIXEL];
  struct barstuff tbar[8];
  int fig;
} save_line_data[MAX_LINE_SCANS];

gray **greydata;

int norm_fdark_ind;   // number of pixels before first dark in norm
                      // line between one of the left start bars

int norm_line_data[MAX_LINE_PIXEL];
int normal_x[MAX_LINE_PIXEL];
int normal_y[MAX_LINE_PIXEL];

int post_line_data[MAX_LINE_PIXEL];
int post_x[MAX_LINE_PIXEL];
int post_y[MAX_LINE_PIXEL];

int line_data[MAX_LINE_PIXEL];
int mod_line_data[MAX_MOD_PIXEL];
int temp_data[MAX_LINE_PIXEL];

int line_x[MAX_LINE_PIXEL];
int line_y[MAX_LINE_PIXEL];

int mod_line_x[MAX_MOD_PIXEL];

int est_bar_height;   // estimate of bar height found from diffy
int bar_height;       // best estimate bar height found from hieght of symbol
                      // divided by number rows

// scan global variables

 int pixel_dark( int inx, int iny);
 int Alpha_to[1024];
 int Index_of[1024];
 int powers_of_3[1024];
 int log_of_3[1024];
 int verbose_out;
 int use_image;   // set true if getting bit image from file

 typedef struct raw_code_type {
    int code;
    int row;
    int col;
  } raw_codes_type;

 raw_codes_type raw_codes[MAX_RAW_CODES];
 int total_codes;
 int top_left_corn_x;
 int top_left_corn_y;

 
 int x_width;            // pixel width of scan in x direction
 int y_height;          // pixel height of scan in y direction
 int row_last_code;     // last code in row
 int col_count;
 int pixel_x;
 int pixel_y;
 int expected_cols;
 int col_width;
 float fcol_width;
 int row_height;
 int barcode_height;
 int barcode_width;
 int code_index;
 int code_index_t;      // code_index using t array
 int scan_code_array[128][40];
 int top_data_corner;
 int left_data_corner;
 int left_edge;
 int right_edge;
 int top_edge;
 int bottom_edge;
 int end_bar_found;
 int x_center;
 int y_center;
 int row_rem;
 int synd_array[512];
 int rows_cols[MAX_ROW][MAX_COL];
 int number_of_codes;
 int rows_from_raw;
 int columns_from_raw;
 int byte_compress_mode;
 int text_compress_mode;
 int numeric_compress_mode;
 int code_array[MAX_CODE];
 int code_array_size;
 int byte_array[MAX_BYTE_INDEX];
 struct b913_stuff
  { 
   char str913[20];
  }  byte_913_str[MAX_BYTE_INDEX];

 char punct_chars[32];
 char mixed_chars[32];
 int codes_bc[20];
 int codes_nc[20];
 int codeindex;
 int code;
 int number_check_words;
 int end_found;
 int raw_row_col [90] [100];
 char powers_of_900[16][50];   
 char powers_of_900h[10][50];
 char powers_of_900h_x10[10][50];
 char powers_of_900h_x100[10][50];
 char result[256];
 int data[1024];
 int erase_loc[MAX_RAW_CODES];  // where are the erasures?
 int erase_count;

 

void init_slopes()
{
  slope_array[0] = 0;
  slope_array[1] = 2;
  slope_array[2] = 4;
  slope_array[3] = 6;
  slope_array[4] = 10;
  slope_array[5] = 12;
  slope_array[6] = 14;
  slope_array[7] = 16;
  slope_array[8] = 18;
  slope_array[9] = 20;
  slope_array[10] = 23 ;
  slope_array[11] = 26;
  slope_array[12] = 29;
  slope_array[13] = 32;
  slope_array[14] = 36;
  slope_array[15] = 40;
  slope_array[16] = 44;
  slope_array[17] = 48;
  slope_array[19] = 52;
  slope_array[20] = 56;
  // slope_array[12] = 214;
  // slope_array[13] = 274;
  // slope_array[14] = 373;
}

// find all the squares in the image that are darker than a certain
//  thresshold.  Put the center x,y location of these squares in the 
//  array dark_squares

void find_dark_squares(int x_left, int y_top, int x_size, int y_size)
{

  int ii;
  int jj;
  int debug;
 
  int x_center;
  int y_center;
  int y_tot;
  int xy_tot;
  int y_avg;
  int xy_avg;

  debug = 0;  
  if ( debug )
    {
     printf("In find dark sq , in x,y = %d %d \n",  x_left, y_top);
    }

  xy_tot = 0;
  for(ii = x_left; ii < x_left + x_size; ii += 1)
    {

      y_tot = 0;
      for ( jj = y_top; jj > y_top - y_size; jj -=1 )
        {
          y_tot = y_tot +  pixel_array[ii][jj].greyval;
     
        }
       if ( y_size > 0.0)
	{
         y_avg = y_tot / y_size;
        }
       else
	 {
	   printf("\n y_size not positive = %f \n", y_size);
           exit(0);
         }
       xy_tot = xy_tot + y_avg;
    }

  if ( x_size > 0 )
    {
     xy_avg = xy_tot / x_size;
    }
  else
    {
      printf("\n x_size not positive = %f \n", x_size);
      exit(0);
    }
  

  if ( debug) { printf("xy_avg = %d \n", xy_avg); }

  if ( xy_avg > dark_threshold)
    {
      x_center = x_left + (( x_size) / 2);
      y_center = y_top - ((y_size) / 2);

      if ( dark_sqindex < MAX_SQUARES)
	{
         dark_squares[dark_sqindex].xloc = x_center;
         dark_squares[dark_sqindex].yloc = y_center;
         dark_sqindex += 1;
         if (debug)
	   {
            printf("Found a darks square at = %d %d \n", x_center, y_center );
           }
        }
      else
        {
	  printf("Error: Number of dark boxes too big = %d \n",
		 dark_sqindex);
        }
    }
}

// draw horizontal and vertical lines
//

void draw_pixel_line(int width, int beginx, int beginy, int endx, int endy )
{
  int ii,jj;


  if (( beginx - endx )  == 0)  // vertical
    {
      if ( endy > beginy )          
        {
	  for ( ii = beginy; ii < endy; ii += 1)
	    {
	      for ( jj = 0; jj < width; jj += 1)
                {
		  if (( ii + jj < MAX_Y_PIXEL) && ( beginx < MAX_X_PIXEL))
		    {
		     pixel_array[beginx][ii+jj].greyval = 510;
                    }
                }
            } 
        }
      else
        {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品77777竹菊影视小说| 成人av先锋影音| 久久成人精品无人区| 国产精一区二区三区| 日本韩国欧美一区二区三区| 2014亚洲片线观看视频免费| 亚洲精品菠萝久久久久久久| 精品中文字幕一区二区| 欧美亚洲一区二区在线| 久久精品视频网| 日韩在线卡一卡二| 色噜噜狠狠成人网p站| 久久一留热品黄| 日本不卡一二三区黄网| 不卡高清视频专区| 久久久久国产精品麻豆ai换脸 | av成人老司机| 日韩美女视频在线| 亚洲午夜精品网| 99久久精品国产观看| 国产日韩欧美综合一区| 开心九九激情九九欧美日韩精美视频电影 | 国产喷白浆一区二区三区| 日本午夜精品一区二区三区电影| 91同城在线观看| 国产欧美综合色| 国产精品69久久久久水密桃| 日韩欧美的一区| 日韩高清不卡一区| 777a∨成人精品桃花网| 亚洲国产wwwccc36天堂| 欧洲色大大久久| 一区二区三区中文字幕在线观看| 成人av免费在线观看| 久久精品一区四区| 丁香婷婷深情五月亚洲| 久久久久久久久久久久久久久99| 美女性感视频久久| 欧美一区中文字幕| 免费观看久久久4p| 日韩亚洲欧美中文三级| 日韩av在线播放中文字幕| 欧美精品一卡两卡| 久久国产三级精品| 精品国产百合女同互慰| 久久国产日韩欧美精品| 久久久久九九视频| 成人免费视频app| 中文字幕一区二区日韩精品绯色| 99精品视频在线免费观看| 亚洲日本在线视频观看| 一本大道久久a久久精品综合| 亚洲黄网站在线观看| 欧美日韩国产免费| 精品在线播放免费| 国产日韩精品一区| 91久久精品网| 免费高清不卡av| 国产精品美女久久福利网站| 91在线一区二区三区| 亚洲精品国产成人久久av盗摄| 欧美无人高清视频在线观看| 蜜桃精品视频在线| 国产精品美女久久久久久久久| 色婷婷一区二区三区四区| 日韩av午夜在线观看| 久久―日本道色综合久久| 91在线视频免费91| 日产欧产美韩系列久久99| 久久美女高清视频| 色综合久久中文字幕综合网| 亚洲成国产人片在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 成人小视频免费观看| 一区二区高清视频在线观看| 欧美一级淫片007| 成人av电影免费在线播放| 亚洲午夜成aⅴ人片| 亚洲精品在线免费播放| 在线观看一区二区视频| 国产一区二区女| 亚洲综合在线第一页| 久久亚洲捆绑美女| 欧美日韩在线观看一区二区 | av在线不卡免费看| 日韩av一区二| 一区二区视频在线| 久久九九久精品国产免费直播| 色视频成人在线观看免| 国产乱妇无码大片在线观看| 亚洲成a人片在线观看中文| 欧美极品aⅴ影院| 日韩视频123| 欧美性大战久久久久久久蜜臀| 国产98色在线|日韩| 美腿丝袜亚洲一区| 天堂成人免费av电影一区| 中文字幕亚洲综合久久菠萝蜜| 精品日韩一区二区三区免费视频| 91国偷自产一区二区开放时间 | 亚洲福利视频一区二区| 欧美激情一区二区三区不卡| 欧美一级高清片| 欧美日韩一区二区在线视频| a级高清视频欧美日韩| 国产精品自在在线| 美女一区二区视频| 免费成人在线视频观看| 亚洲第一av色| 亚洲成人av电影在线| 亚洲精品国产品国语在线app| 国产精品女上位| 国产清纯白嫩初高生在线观看91 | 在线亚洲一区二区| www.久久久久久久久| 东方aⅴ免费观看久久av| 国产精品亚洲视频| 国产福利91精品一区| 国产成人av影院| 国产精品一区二区久激情瑜伽| 极品瑜伽女神91| 国产乱子伦视频一区二区三区| 激情欧美一区二区| 经典三级在线一区| 国产精品18久久久久久久久久久久| 国产在线看一区| 国产传媒欧美日韩成人| 高清不卡一二三区| 91香蕉视频污在线| 日本韩国一区二区三区视频| 欧美优质美女网站| 51久久夜色精品国产麻豆| 日韩一区二区免费电影| 欧美一区二区三区在线电影| 欧美一区二区三区在线看| www国产精品av| 国产婷婷色一区二区三区在线| 亚洲国产成人午夜在线一区| 亚洲女同女同女同女同女同69| 亚洲一线二线三线视频| 日韩中文字幕91| 国产在线视频不卡二| 99久久精品国产导航| 欧美喷水一区二区| 日韩欧美色电影| 国产精品久久久久久久久动漫 | 中文字幕日本乱码精品影院| 亚洲激情在线播放| 爽好久久久欧美精品| 国产另类ts人妖一区二区| 成人在线视频首页| 色素色在线综合| 欧美zozo另类异族| 亚洲视频网在线直播| 欧美aaaaa成人免费观看视频| 国产一区二区在线影院| 色悠悠亚洲一区二区| 欧美一级二级在线观看| 国产精品另类一区| 日韩国产高清在线| 91婷婷韩国欧美一区二区| 日韩欧美一级二级| 亚洲黄色免费网站| 国产自产v一区二区三区c| 欧美系列日韩一区| 国产日韩欧美不卡在线| 偷拍自拍另类欧美| 成人黄色av网站在线| 91精品国产综合久久精品图片| 亚洲国产精品国自产拍av| 婷婷中文字幕综合| 99热精品一区二区| 26uuu色噜噜精品一区二区| 亚洲国产精品精华液网站| 国产suv精品一区二区三区| 在线综合亚洲欧美在线视频| 国产精品久久夜| 久久精品二区亚洲w码| 色婷婷狠狠综合| 欧美激情一区二区三区| 麻豆一区二区三| 欧美午夜精品久久久久久超碰| 中文字幕在线一区免费| 精品一区二区三区免费播放| 欧美视频一区二| 亚洲欧美色一区| 成人免费视频视频| 久久综合狠狠综合久久综合88 | 欧美精选在线播放| 亚洲激情图片一区| 91美女福利视频| 亚洲国产高清在线| 粉嫩一区二区三区性色av| 久久综合成人精品亚洲另类欧美| 青草av.久久免费一区| 欧美三片在线视频观看| 亚洲激情图片小说视频| 色吊一区二区三区| 亚洲伦理在线精品| 91免费小视频|