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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? iec16022ecc200.c

?? IEC16022 bar code generation library and RS encode
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
// IEC16022 bar code generation library
// This software is provided under the terms of the GPL v2 or later.
// This software is provided free of charge with a full "Money back" guarantee.
// Use entirely at your own risk. We accept no liability. If you don't like that - don't use it.

// Adrian Kennard, Andrews & Arnold Ltd
// with help from Cliff Hones on the RS coding
//
// $Log: iec16022ecc200.c,v $
// Revision 1.8  2004/09/12 10:35:25  cvs
// Minor fixes to auto encoding, and more precise placement of text on stamp output.
//
// Revision 1.7  2004/09/11 11:16:20  cvs
// Fixed binary format encoding, and added output file to indicia
//
// Revision 1.6  2004/09/10 16:10:30  cvs
// Correction of declaration ordering
//
// Revision 1.5  2004/09/09 12:35:48  cvs
// Interleaved (large) codes now working as well.
// Fixed bugs in the auto encoding (was selecting EDIFACT wrongly)
//
// Revision 1.4  2004/09/09 07:45:09  cvs
// Added change history to source files
// Added "info" type to IEC16022
// Added exact size checking shortcodes on encoding generation for iec16022
//


#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <popt.h>
#include <malloc.h>
#include "reedsol.h"
#include "iec16022ecc200.h"

static struct ecc200matrix_s
{
   int H,
     W;
   int FH,
     FW;
   int bytes;
   int datablock,
     rsblock;
}
ecc200matrix[] =
{
   10, 10, 10, 10, 3, 3, 5,     //
      12, 12, 12, 12, 5, 5, 7,  //
      8, 18, 8, 18, 5, 5, 7,    //
      14, 14, 14, 14, 8, 8, 10, //
      8, 32, 8, 16, 10, 10, 11, //
      16, 16, 16, 16, 12, 12, 12,       //
      12, 26, 12, 26, 16, 16, 14,       //
      18, 18, 18, 18, 18, 18, 14,       //
      20, 20, 20, 20, 22, 22, 18,       //
      12, 36, 12, 18, 22, 22, 18,       //
      22, 22, 22, 22, 30, 30, 20,       //
      16, 36, 16, 18, 32, 32, 24,       //
      24, 24, 24, 24, 36, 36, 24,       //
      26, 26, 26, 26, 44, 44, 28,       //
      16, 48, 16, 24, 49, 49, 28,       //
      32, 32, 16, 16, 62, 62, 36,       //
      36, 36, 18, 18, 86, 86, 42,       //
      40, 40, 20, 20, 114, 114, 48,     //
      44, 44, 22, 22, 144, 144, 56,     //
      48, 48, 24, 24, 174, 174, 68,     //
      52, 52, 26, 26, 204, 102, 42,     //
      64, 64, 16, 16, 280, 140, 56,     //
      72, 72, 18, 18, 368, 92, 36,      //
      80, 80, 20, 20, 456, 114, 48,     //
      88, 88, 22, 22, 576, 144, 56,     //
      96, 96, 24, 24, 696, 174, 68,     //
      104, 104, 26, 26, 816, 136, 56,   //
      120, 120, 20, 20, 1050, 175, 68,  //
      132, 132, 22, 22, 1304, 163, 62,  //
      144, 144, 24, 24, 1558, 156, 62,  // 156*4+155*2
      0                         // terminate
};

 // simple checked response malloc
static void *
safemalloc (int n)
{
   void *p = malloc (n);
   if (!p)
   {
      fprintf (stderr, "Malloc(%d) failed\n", n);
      exit (1);
   }
   return p;
}

// Annex M placement alorithm low level
static void
ecc200placementbit (int *array, int NR, int NC, int r, int c, int p, char b)
{
   if (r < 0)
   {
      r += NR;
      c += 4 - ((NR + 4) % 8);
   }
   if (c < 0)
   {
      c += NC;
      r += 4 - ((NC + 4) % 8);
   }
   array[r * NC + c] = (p << 3) + b;
}

static void
ecc200placementblock (int *array, int NR, int NC, int r, int c, int p)
{
   ecc200placementbit (array, NR, NC, r - 2, c - 2, p, 7);
   ecc200placementbit (array, NR, NC, r - 2, c - 1, p, 6);
   ecc200placementbit (array, NR, NC, r - 1, c - 2, p, 5);
   ecc200placementbit (array, NR, NC, r - 1, c - 1, p, 4);
   ecc200placementbit (array, NR, NC, r - 1, c - 0, p, 3);
   ecc200placementbit (array, NR, NC, r - 0, c - 2, p, 2);
   ecc200placementbit (array, NR, NC, r - 0, c - 1, p, 1);
   ecc200placementbit (array, NR, NC, r - 0, c - 0, p, 0);
}

static void
ecc200placementcornerA (int *array, int NR, int NC, int p)
{
   ecc200placementbit (array, NR, NC, NR - 1, 0, p, 7);
   ecc200placementbit (array, NR, NC, NR - 1, 1, p, 6);
   ecc200placementbit (array, NR, NC, NR - 1, 2, p, 5);
   ecc200placementbit (array, NR, NC, 0, NC - 2, p, 4);
   ecc200placementbit (array, NR, NC, 0, NC - 1, p, 3);
   ecc200placementbit (array, NR, NC, 1, NC - 1, p, 2);
   ecc200placementbit (array, NR, NC, 2, NC - 1, p, 1);
   ecc200placementbit (array, NR, NC, 3, NC - 1, p, 0);
}

static void
ecc200placementcornerB (int *array, int NR, int NC, int p)
{
   ecc200placementbit (array, NR, NC, NR - 3, 0, p, 7);
   ecc200placementbit (array, NR, NC, NR - 2, 0, p, 6);
   ecc200placementbit (array, NR, NC, NR - 1, 0, p, 5);
   ecc200placementbit (array, NR, NC, 0, NC - 4, p, 4);
   ecc200placementbit (array, NR, NC, 0, NC - 3, p, 3);
   ecc200placementbit (array, NR, NC, 0, NC - 2, p, 2);
   ecc200placementbit (array, NR, NC, 0, NC - 1, p, 1);
   ecc200placementbit (array, NR, NC, 1, NC - 1, p, 0);
}

static void
ecc200placementcornerC (int *array, int NR, int NC, int p)
{
   ecc200placementbit (array, NR, NC, NR - 3, 0, p, 7);
   ecc200placementbit (array, NR, NC, NR - 2, 0, p, 6);
   ecc200placementbit (array, NR, NC, NR - 1, 0, p, 5);
   ecc200placementbit (array, NR, NC, 0, NC - 2, p, 4);
   ecc200placementbit (array, NR, NC, 0, NC - 1, p, 3);
   ecc200placementbit (array, NR, NC, 1, NC - 1, p, 2);
   ecc200placementbit (array, NR, NC, 2, NC - 1, p, 1);
   ecc200placementbit (array, NR, NC, 3, NC - 1, p, 0);
}

static void
ecc200placementcornerD (int *array, int NR, int NC, int p)
{
   ecc200placementbit (array, NR, NC, NR - 1, 0, p, 7);
   ecc200placementbit (array, NR, NC, NR - 1, NC - 1, p, 6);
   ecc200placementbit (array, NR, NC, 0, NC - 3, p, 5);
   ecc200placementbit (array, NR, NC, 0, NC - 2, p, 4);
   ecc200placementbit (array, NR, NC, 0, NC - 1, p, 3);
   ecc200placementbit (array, NR, NC, 1, NC - 3, p, 2);
   ecc200placementbit (array, NR, NC, 1, NC - 2, p, 1);
   ecc200placementbit (array, NR, NC, 1, NC - 1, p, 0);
}

// Annex M placement alorithm main function
static void
ecc200placement (int *array, int NR, int NC)
{
   int r,
     c,
     p;
   // invalidate
   for (r = 0; r < NR; r++)
      for (c = 0; c < NC; c++)
         array[r * NC + c] = 0;
   // start
   p = 1;
   r = 4;
   c = 0;
   do
   {
      // check corner
      if (r == NR && !c)
         ecc200placementcornerA (array, NR, NC, p++);
      if (r == NR - 2 && !c && NC % 4)
         ecc200placementcornerB (array, NR, NC, p++);
      if (r == NR - 2 && !c && (NC % 8) == 4)
         ecc200placementcornerC (array, NR, NC, p++);
      if (r == NR + 4 && c == 2 && !(NC % 8))
         ecc200placementcornerD (array, NR, NC, p++);
      // up/right
      do
      {
         if (r < NR && c >= 0 && !array[r * NC + c])
            ecc200placementblock (array, NR, NC, r, c, p++);
         r -= 2;
         c += 2;
      }
      while (r >= 0 && c < NC);
      r++;
      c += 3;
      // down/left
      do
      {
         if (r >= 0 && c < NC && !array[r * NC + c])
            ecc200placementblock (array, NR, NC, r, c, p++);
         r += 2;
         c -= 2;
      }
      while (r < NR && c >= 0);
      r += 3;
      c++;
   }
   while (r < NR || c < NC);
   // unfilled corner
   if (!array[NR * NC - 1])
      array[NR * NC - 1] = array[NR * NC - NC - 2] = 1;
}

// calculate and append ecc code, and if necessary interleave
static void
ecc200 (unsigned char *binary, int bytes, int datablock, int rsblock)
{
   int blocks = (bytes + 2) / datablock,
      b;
   rs_init_gf (0x12d);
   rs_init_code (rsblock, 1);
   for (b = 0; b < blocks; b++)
   {
      unsigned char buf[256],
        ecc[256];
      int n,
        p = 0;
      for (n = b; n < bytes; n += blocks)
         buf[p++] = binary[n];
      rs_encode (p, buf, ecc);
      p = rsblock - 1;          // comes back reversed
      for (n = b; n < rsblock * blocks; n += blocks)
         binary[bytes + n] = ecc[p--];
   }
}

// perform encoding for ecc200, source s len sl, to target t len tl, using optional encoding control string e
// return 1 if OK, 0 if failed. Does all necessary padding to tl
char
ecc200encode (unsigned char *t, int tl, unsigned char *s, int sl, char *encoding, int *lenp)
{
   char enc = 'a';              // start in ASCII encoding mode
   int tp = 0,
      sp = 0;
   if (strlen (encoding) < sl)
   {
      fprintf (stderr, "Encoding string too short\n");
      return 0;
   }
   // do the encoding
   while (sp < sl && tp < tl)
   {
      char newenc = enc;        // suggest new encoding
      if (tl - tp <= 1 && (enc == 'c' || enc == 't') || tl - tp <= 2 && enc == 'x')
         enc = 'a';             // auto revert to ASCII
      newenc = tolower (encoding[sp]);
      switch (newenc)
      {                         // encode character
      case 'c':                // C40
      case 't':                // Text
      case 'x':                // X12
         {
            char out[6],
              p = 0;
            const char *e,
             *s2 = "!\"#$%&'()*+,-./:;<=>?@[\\]_",
               *s3 = 0;
            if (newenc == 'c')
            {
               e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
               s3 = "`abcdefghijklmnopqrstuvwxyz{|}~\177";
            }
            if (newenc == 't')
            {
               e = " 0123456789abcdefghijklmnopqrstuvwxyz";
               s3 = "`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\177";
            }
            if (newenc == 'x')
               e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\r*>";
            do
            {
               unsigned char c = s[sp++];
               char *w;
               if (c & 0x80)
               {
                  if (newenc == 'x')
                  {
                     fprintf (stderr, "Cannot encode char 0x%02X in X12\n", c);
                     return 0;
                  }
                  c &= 0x7f;
                  out[p++] = 1;
                  out[p++] = 30;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美写真视频网站| 美日韩一区二区| 欧美成人精品福利| 不卡一区中文字幕| 国产很黄免费观看久久| 日韩av一区二区三区| 亚洲最大的成人av| 最新不卡av在线| 国产精品福利av | www.久久久久久久久| 精品一区二区三区在线视频| 午夜精品国产更新| 亚洲国产视频在线| 亚洲一区二区欧美| 亚洲图片自拍偷拍| 亚洲小少妇裸体bbw| 亚洲精品乱码久久久久久黑人| 亚洲国产精品传媒在线观看| 日本不卡一区二区| 日本女优在线视频一区二区| 爽好久久久欧美精品| 日本伊人色综合网| 国产一区二区三区蝌蚪| 国产成人在线网站| 亚洲精品在线观看网站| 欧美日韩不卡一区二区| 亚洲精品一区在线观看| 国产精品久久久99| 图片区小说区区亚洲影院| 男人的天堂久久精品| 国产成人啪免费观看软件| 99久久免费精品| 91精品国产高清一区二区三区 | 91丨porny丨中文| 91精品国模一区二区三区| 国产午夜精品一区二区三区视频| 中文字幕视频一区二区三区久| 亚洲综合丁香婷婷六月香| 久久超碰97中文字幕| 成人ar影院免费观看视频| 欧美丝袜丝交足nylons图片| 欧美一区二区三区四区五区 | 一区二区在线观看免费| 一本久道久久综合中文字幕| 日韩午夜激情视频| 亚洲一级二级三级| 福利一区在线观看| 欧美一卡2卡3卡4卡| 亚洲免费高清视频在线| 黑人精品欧美一区二区蜜桃| 欧洲精品中文字幕| 亚洲欧美在线aaa| 国产成人一区在线| 久久青草国产手机看片福利盒子 | 成人看片黄a免费看在线| 精品欧美一区二区在线观看| 91视频com| 久久久不卡网国产精品一区| 免费人成精品欧美精品| 3d动漫精品啪啪1区2区免费| 一区二区视频在线| 92精品国产成人观看免费| 国产精品三级av| 国产iv一区二区三区| 国产亚洲欧美色| 91视频com| 久久精品一区二区三区不卡| 美女一区二区三区| 日韩手机在线导航| 看电影不卡的网站| 日韩欧美一区二区免费| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美一区二区视频观看视频 | 亚洲国产精品精华液2区45| 波多野结衣一区二区三区| 国产精品国模大尺度视频| 成人av先锋影音| 亚洲蜜桃精久久久久久久| 欧美日韩三级视频| 精品写真视频在线观看| 中文幕一区二区三区久久蜜桃| 成人国产电影网| 亚洲成人精品一区| 久久一二三国产| 欧洲精品视频在线观看| 久久精品国产99国产| 国产精品网曝门| 欧美精品1区2区3区| 国产宾馆实践打屁股91| 亚洲综合自拍偷拍| 欧美精品一区二区三区在线| 成人av网站免费| 日本视频一区二区三区| 一区精品在线播放| 精品成人免费观看| 欧美精选一区二区| 91丨九色丨蝌蚪富婆spa| 久久9热精品视频| 亚洲成人手机在线| 国产精品久久夜| 91精品国产综合久久久蜜臀图片| 成人app在线| 懂色av一区二区三区蜜臀| 成人午夜视频福利| 麻豆国产一区二区| 青青草国产精品97视觉盛宴| 亚洲精品亚洲人成人网| 国产精品色婷婷久久58| 国产视频在线观看一区二区三区| 日韩一区二区三区视频| 欧美亚洲日本国产| 欧美羞羞免费网站| 欧洲激情一区二区| 欧美午夜视频网站| 欧美另类变人与禽xxxxx| 欧美少妇bbb| 欧美日本国产视频| 在线播放91灌醉迷j高跟美女| 91小视频免费看| 在线视频一区二区免费| 欧美影视一区二区三区| 欧美在线一区二区三区| 欧美视频自拍偷拍| 91精品国产品国语在线不卡| 欧美三级韩国三级日本三斤| 欧美日韩免费一区二区三区视频| 在线亚洲一区二区| 欧美日韩国产精品成人| 久久免费偷拍视频| 欧美国产禁国产网站cc| 国产精品欧美综合在线| 一个色妞综合视频在线观看| 无吗不卡中文字幕| 国产乱码一区二区三区| 成人av午夜影院| 欧美色视频一区| 精品福利一区二区三区| 中文字幕一区二区三区视频| 日韩中文欧美在线| hitomi一区二区三区精品| 日韩一区二区视频在线观看| 亚洲国产高清在线| 日韩不卡免费视频| 99久久99久久免费精品蜜臀| 欧美日韩免费高清一区色橹橹| 日韩欧美国产综合一区| 亚洲欧美一区二区三区国产精品| 日日骚欧美日韩| 一本色道久久加勒比精品| 久久综合五月天婷婷伊人| 亚洲一区二区黄色| av不卡在线观看| 午夜精品视频一区| 91亚洲精品久久久蜜桃网站| 2020国产精品| 美洲天堂一区二卡三卡四卡视频 | 欧美性色欧美a在线播放| 久久久99精品久久| 男女激情视频一区| 91超碰这里只有精品国产| 一区二区成人在线视频| 色一情一乱一乱一91av| 中文字幕一区二区不卡| 国产美女娇喘av呻吟久久| 制服丝袜亚洲网站| 日产国产欧美视频一区精品 | 亚洲综合色在线| 欧美在线观看视频一区二区| 亚洲免费在线播放| 欧美日韩一区小说| 视频一区二区三区入口| 日韩欧美资源站| 极品少妇一区二区| 国产精品久99| 欧美日韩精品一二三区| 午夜电影久久久| 精品国产麻豆免费人成网站| 国产精品91一区二区| 国产精品色婷婷久久58| 在线视频你懂得一区二区三区| 亚洲伊人伊色伊影伊综合网| 欧美精品 国产精品| 久久机这里只有精品| 国产精品的网站| 欧美日韩国产一区二区三区地区| 免费日韩伦理电影| 国产婷婷色一区二区三区四区| 99久久久无码国产精品| 偷拍一区二区三区| 久久亚洲春色中文字幕久久久| 成人精品国产福利| 天堂在线一区二区| 国产精品久久三区| 日韩免费观看高清完整版| 国产a久久麻豆| 无码av免费一区二区三区试看| 国产日韩v精品一区二区| 欧美日韩免费观看一区三区| 成人免费视频一区二区| 五月激情六月综合|