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

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

?? tif_fax3.h

?? 一款最完整的工業組態軟源代碼
?? H
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: tif_fax3.h,v 1.4 2004/10/16 15:34:33 drolon Exp $ */

/*
 * Copyright (c) 1990-1997 Sam Leffler
 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 *
 * Permission to use, copy, modify, distribute, and sell this software and 
 * its documentation for any purpose is hereby granted without fee, provided
 * that (i) the above copyright notices and this permission notice appear in
 * all copies of the software and related documentation, and (ii) the names of
 * Sam Leffler and Silicon Graphics may not be used in any advertising or
 * publicity relating to the software without the specific, prior written
 * permission of Sam Leffler and Silicon Graphics.
 * 
 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
 * 
 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
 * OF THIS SOFTWARE.
 */

#ifndef _FAX3_
#define	_FAX3_
/*
 * TIFF Library.
 *
 * CCITT Group 3 (T.4) and Group 4 (T.6) Decompression Support.
 *
 * Decoder support is derived, with permission, from the code
 * in Frank Cringle's viewfax program;
 *      Copyright (C) 1990, 1995  Frank D. Cringle.
 */
#include "tiff.h"

/*
 * To override the default routine used to image decoded
 * spans one can use the pseduo tag TIFFTAG_FAXFILLFUNC.
 * The routine must have the type signature given below;
 * for example:
 *
 * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
 *
 * where buf is place to set the bits, runs is the array of b&w run
 * lengths (white then black), erun is the last run in the array, and
 * lastx is the width of the row in pixels.  Fill routines can assume
 * the run array has room for at least lastx runs and can overwrite
 * data in the run array as needed (e.g. to append zero runs to bring
 * the count up to a nice multiple).
 */
typedef	void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);

/*
 * The default run filler; made external for other decoders.
 */
#if defined(__cplusplus)
extern "C" {
#endif
extern	void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
#if defined(__cplusplus)
}
#endif


/* finite state machine codes */
#define S_Null		0
#define S_Pass		1
#define S_Horiz		2
#define S_V0		3
#define S_VR		4
#define S_VL		5
#define S_Ext		6
#define S_TermW		7
#define S_TermB		8
#define S_MakeUpW	9
#define S_MakeUpB	10
#define S_MakeUp	11
#define S_EOL		12

typedef struct {		/* state table entry */
	unsigned char State;	/* see above */
	unsigned char Width;	/* width of code in bits */
	uint32	Param;		/* unsigned 32-bit run length in bits */
} TIFFFaxTabEnt;

extern	const TIFFFaxTabEnt TIFFFaxMainTable[];
extern	const TIFFFaxTabEnt TIFFFaxWhiteTable[];
extern	const TIFFFaxTabEnt TIFFFaxBlackTable[];

/*
 * The following macros define the majority of the G3/G4 decoder
 * algorithm using the state tables defined elsewhere.  To build
 * a decoder you need some setup code and some glue code. Note
 * that you may also need/want to change the way the NeedBits*
 * macros get input data if, for example, you know the data to be
 * decoded is properly aligned and oriented (doing so before running
 * the decoder can be a big performance win).
 *
 * Consult the decoder in the TIFF library for an idea of what you
 * need to define and setup to make use of these definitions.
 *
 * NB: to enable a debugging version of these macros define FAX3_DEBUG
 *     before including this file.  Trace output goes to stdout.
 */

#ifndef EndOfData
#define EndOfData()	(cp >= ep)
#endif
/*
 * Need <=8 or <=16 bits of input data.  Unlike viewfax we
 * cannot use/assume a word-aligned, properly bit swizzled
 * input data set because data may come from an arbitrarily
 * aligned, read-only source such as a memory-mapped file.
 * Note also that the viewfax decoder does not check for
 * running off the end of the input data buffer.  This is
 * possible for G3-encoded data because it prescans the input
 * data to count EOL markers, but can cause problems for G4
 * data.  In any event, we don't prescan and must watch for
 * running out of data since we can't permit the library to
 * scan past the end of the input data buffer.
 *
 * Finally, note that we must handle remaindered data at the end
 * of a strip specially.  The coder asks for a fixed number of
 * bits when scanning for the next code.  This may be more bits
 * than are actually present in the data stream.  If we appear
 * to run out of data but still have some number of valid bits
 * remaining then we makeup the requested amount with zeros and
 * return successfully.  If the returned data is incorrect then
 * we should be called again and get a premature EOF error;
 * otherwise we should get the right answer.
 */
#ifndef NeedBits8
#define NeedBits8(n,eoflab) do {					\
    if (BitsAvail < (n)) {						\
	if (EndOfData()) {						\
	    if (BitsAvail == 0)			/* no valid bits */	\
		goto eoflab;						\
	    BitsAvail = (n);			/* pad with zeros */	\
	} else {							\
	    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;		\
	    BitsAvail += 8;						\
	}								\
    }									\
} while (0)
#endif
#ifndef NeedBits16
#define NeedBits16(n,eoflab) do {					\
    if (BitsAvail < (n)) {						\
	if (EndOfData()) {						\
	    if (BitsAvail == 0)			/* no valid bits */	\
		goto eoflab;						\
	    BitsAvail = (n);			/* pad with zeros */	\
	} else {							\
	    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;		\
	    if ((BitsAvail += 8) < (n)) {				\
		if (EndOfData()) {					\
		    /* NB: we know BitsAvail is non-zero here */	\
		    BitsAvail = (n);		/* pad with zeros */	\
		} else {						\
		    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;	\
		    BitsAvail += 8;					\
		}							\
	    }								\
	}								\
    }									\
} while (0)
#endif
#define GetBits(n)	(BitAcc & ((1<<(n))-1))
#define ClrBits(n) do {							\
    BitsAvail -= (n);							\
    BitAcc >>= (n);							\
} while (0)

#ifdef FAX3_DEBUG
static const char* StateNames[] = {
    "Null   ",
    "Pass   ",
    "Horiz  ",
    "V0     ",
    "VR     ",
    "VL     ",
    "Ext    ",
    "TermW  ",
    "TermB  ",
    "MakeUpW",
    "MakeUpB",
    "MakeUp ",
    "EOL    ",
};
#define DEBUG_SHOW putchar(BitAcc & (1 << t) ? '1' : '0')
#define LOOKUP8(wid,tab,eoflab) do {					\
    int t;								\
    NeedBits8(wid,eoflab);						\
    TabEnt = tab + GetBits(wid);					\
    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,		\
	   StateNames[TabEnt->State], TabEnt->Param);			\
    for (t = 0; t < TabEnt->Width; t++)					\
	DEBUG_SHOW;							\
    putchar('\n');							\
    fflush(stdout);							\
    ClrBits(TabEnt->Width);						\
} while (0)
#define LOOKUP16(wid,tab,eoflab) do {					\
    int t;								\
    NeedBits16(wid,eoflab);						\
    TabEnt = tab + GetBits(wid);					\
    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,		\
	   StateNames[TabEnt->State], TabEnt->Param);			\
    for (t = 0; t < TabEnt->Width; t++)					\
	DEBUG_SHOW;							\
    putchar('\n');							\
    fflush(stdout);							\
    ClrBits(TabEnt->Width);						\
} while (0)

#define SETVAL(x) do {							\
    *pa++ = RunLength + (x);						\
    printf("SETVAL: %d\t%d\n", RunLength + (x), a0);			\
    a0 += x;								\
    RunLength = 0;							\
} while (0)
#else
#define LOOKUP8(wid,tab,eoflab) do {					\
    NeedBits8(wid,eoflab);						\
    TabEnt = tab + GetBits(wid);					\
    ClrBits(TabEnt->Width);						\
} while (0)
#define LOOKUP16(wid,tab,eoflab) do {					\
    NeedBits16(wid,eoflab);						\
    TabEnt = tab + GetBits(wid);					\
    ClrBits(TabEnt->Width);						\
} while (0)

/*
 * Append a run to the run length array for the
 * current row and reset decoding state.
 */
#define SETVAL(x) do {							\
    *pa++ = RunLength + (x);						\
    a0 += (x);								\
    RunLength = 0;							\
} while (0)
#endif

/*
 * Synchronize input decoding at the start of each
 * row by scanning for an EOL (if appropriate) and
 * skipping any trash data that might be present
 * after a decoding error.  Note that the decoding
 * done elsewhere that recognizes an EOL only consumes
 * 11 consecutive zero bits.  This means that if EOLcnt
 * is non-zero then we still need to scan for the final flag
 * bit that is part of the EOL code.
 */
#define	SYNC_EOL(eoflab) do {						\
    if (EOLcnt == 0) {							\
	for (;;) {							\
	    NeedBits16(11,eoflab);					\
	    if (GetBits(11) == 0)					\

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线资源| 欧洲一区二区av| 欧美日韩精品电影| 人人精品人人爱| 欧美激情一区二区三区四区| 成人禁用看黄a在线| 久久精品理论片| 亚洲成在人线在线播放| 亚洲特级片在线| 在线亚洲欧美专区二区| 麻豆成人av在线| 日本一二三不卡| 美女在线观看视频一区二区| 欧美性生活大片视频| 麻豆久久一区二区| 五月婷婷综合在线| 2023国产精品| 亚洲精品美国一| 久久99久久久欧美国产| 99re视频精品| 欧美大片日本大片免费观看| 亚洲人成影院在线观看| 免费欧美在线视频| 91福利国产成人精品照片| 欧美一区二区播放| 中文字幕在线不卡视频| 麻豆精品新av中文字幕| 91在线视频播放| 久久蜜桃av一区二区天堂| 亚洲成人av中文| voyeur盗摄精品| 久久久影视传媒| 亚洲mv在线观看| 99久久国产免费看| 久久欧美一区二区| 性做久久久久久免费观看| 精品久久久久久久久久久久久久久| 国产欧美日韩三区| 麻豆国产精品777777在线| 在线观看亚洲专区| 欧美综合天天夜夜久久| 欧美经典三级视频一区二区三区| 三级久久三级久久| 色婷婷国产精品| 欧美国产一区在线| 国产乱码字幕精品高清av| 欧美日本在线看| 亚洲午夜激情网页| 在线亚洲+欧美+日本专区| 国产精品久久久久久亚洲毛片 | 美女尤物国产一区| 在线看不卡av| 亚洲男人天堂av| 91在线视频官网| 综合久久一区二区三区| 国产福利91精品一区| 精品日韩在线观看| 美国精品在线观看| 欧美一二三区在线| 日韩主播视频在线| 欧美日韩精品三区| 亚洲444eee在线观看| 欧美日韩中文精品| 亚洲综合男人的天堂| 色又黄又爽网站www久久| 亚洲欧洲精品天堂一级| 成人免费视频视频在线观看免费| 国产欧美一区二区精品秋霞影院| 国产一区二区主播在线| 精品国产三级a在线观看| 久久福利资源站| 日韩欧美123| 国产揄拍国内精品对白| 久久综合狠狠综合久久综合88 | 久久亚洲精品国产精品紫薇| 免费美女久久99| 精品日韩在线一区| 国产精品亚洲午夜一区二区三区| 久久女同互慰一区二区三区| 国产精品影音先锋| 国产精品网友自拍| 99视频一区二区三区| 亚洲天堂久久久久久久| 91福利视频在线| 日韩精品五月天| 精品乱人伦小说| 成人手机在线视频| 亚洲伦理在线精品| 欧美图区在线视频| 美女性感视频久久| 国产三区在线成人av| 成人动漫在线一区| 一区二区三区免费在线观看| 欧美精品久久99久久在免费线| 日韩精品亚洲一区二区三区免费| 精品久久一区二区三区| 成人永久免费视频| 亚洲午夜激情av| 26uuu精品一区二区三区四区在线| 国产 欧美在线| 亚洲激情图片小说视频| 欧美精品粉嫩高潮一区二区| 老鸭窝一区二区久久精品| 国产欧美精品区一区二区三区 | 亚洲一区二区视频在线观看| 3d成人h动漫网站入口| 国产综合成人久久大片91| 亚洲国产精品t66y| 欧美网站大全在线观看| 韩国成人在线视频| 亚洲三级视频在线观看| 91精品国产综合久久婷婷香蕉| 国产中文字幕精品| 亚洲欧美激情视频在线观看一区二区三区 | 欧美日韩高清一区二区三区| 韩国女主播成人在线| 亚洲欧美激情一区二区| 日韩免费高清av| 91亚洲永久精品| 日韩中文字幕亚洲一区二区va在线 | 亚洲高清在线视频| 国产日韩精品一区二区三区在线| 在线观看日韩毛片| 国产精品一卡二卡| 亚洲成人久久影院| 久久久av毛片精品| 欧美日韩国产中文| 成人激情文学综合网| 午夜精品久久久久| 国产精品美日韩| 日韩视频在线观看一区二区| 波多野洁衣一区| 免费国产亚洲视频| 亚洲最大成人综合| 久久久久久久久久久久久夜| 欧美视频在线一区二区三区| 成人国产精品免费观看动漫| 日韩激情中文字幕| 一区二区三区欧美| 日韩vs国产vs欧美| 91视频观看视频| 91精品国产综合久久香蕉麻豆| 欧美一区二区三区公司| 麻豆免费看一区二区三区| 欧美一区二区三区四区久久| 99国产精品久久久久| 国产一区二区伦理片| 日韩精品久久久久久| 一区二区在线看| 国产精品乱码一区二区三区软件| 欧美变态口味重另类| 欧美视频在线一区| 91蜜桃网址入口| 成人av资源站| 国产成人在线免费观看| 蜜臀精品一区二区三区在线观看 | 成人黄色一级视频| 激情久久久久久久久久久久久久久久| 亚洲永久精品大片| 国产精品久久国产精麻豆99网站| 久久影院午夜论| 精品日韩一区二区| 日韩欧美一级二级| 日韩视频免费观看高清完整版 | 日本女人一区二区三区| 樱桃视频在线观看一区| 亚洲视频资源在线| 一区二区三区在线高清| 一区二区三区美女| 久久人人97超碰com| 精品久久久久久亚洲综合网| 欧美久久久久久蜜桃| 日本久久电影网| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 六月婷婷色综合| 日本欧美在线看| 日本中文一区二区三区| 视频一区视频二区中文| 亚洲不卡在线观看| 亚洲电影一区二区| 亚洲va韩国va欧美va| 亚洲成人免费看| 日韩电影在线免费| 日本一区中文字幕| 青草av.久久免费一区| 蜜桃视频一区二区| 激情综合色综合久久综合| 九一久久久久久| 国产黄人亚洲片| 成年人国产精品| 色婷婷av一区二区| 欧美三级日韩在线| 91麻豆精品国产| 精品免费一区二区三区| 久久女同精品一区二区| 国产人妖乱国产精品人妖| 亚洲天堂av老司机| 亚洲va韩国va欧美va精品| 免费观看久久久4p| 国产精品1区2区|