本文整理汇总了C#中Free.Ports.LibTiff.TIFF.tif_setupdecode方法的典型用法代码示例。如果您正苦于以下问题:C# TIFF.tif_setupdecode方法的具体用法?C# TIFF.tif_setupdecode怎么用?C# TIFF.tif_setupdecode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Free.Ports.LibTiff.TIFF
的用法示例。
在下文中一共展示了TIFF.tif_setupdecode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TIFFStartTile
// Set state to appear as if a
// tile has just been read in.
static bool TIFFStartTile(TIFF tif, uint tile)
{
TIFFDirectory td=tif.tif_dir;
if((tif.tif_flags&TIF_FLAGS.TIFF_CODERSETUP)==0)
{
if(!tif.tif_setupdecode(tif)) return false;
tif.tif_flags|=TIF_FLAGS.TIFF_CODERSETUP;
}
tif.tif_curtile=tile;
tif.tif_row=(tile%TIFFhowmany(td.td_imagewidth, td.td_tilewidth))*td.td_tilelength;
tif.tif_col=(tile%TIFFhowmany(td.td_imagelength, td.td_tilelength))*td.td_tilewidth;
if((tif.tif_flags&TIF_FLAGS.TIFF_NOREADRAW)==TIF_FLAGS.TIFF_NOREADRAW)
{
tif.tif_rawdata=null; // ?????
tif.tif_rawcp=0;
tif.tif_rawcc=0;
}
else
{
tif.tif_rawcp=0; //was tif.tif_rawdata;
tif.tif_rawcc=td.td_stripbytecount[tile];
}
return tif.tif_predecode(tif, (ushort)(tile/td.td_stripsperimage));
}
示例2: LZWPreDecode
// Setup state for decoding a strip.
static bool LZWPreDecode(TIFF tif, ushort sampleNumber)
{
LZWCodecState sp=tif.tif_data as LZWCodecState;
#if DEBUG
if(sp==null) throw new Exception("sp==null");
#endif
if(sp.dec_codetab==null)
{
tif.tif_setupdecode(tif);
}
// Check for old bit-reversed codes.
if(tif.tif_rawdata[0]==0&&(tif.tif_rawdata[1]&0x1)!=0)
{
#if LZW_COMPAT
if(sp.dec_decode==null)
{
TIFFWarningExt(tif.tif_clientdata, tif.tif_name, "Old-style LZW codes, convert file");
// Override default decoding methods with
// ones that deal with the old coding.
// Otherwise the predictor versions set
// above will call the compatibility routines
// through the dec_decode method.
tif.tif_decoderow=LZWDecodeCompat;
tif.tif_decodestrip=LZWDecodeCompat;
tif.tif_decodetile=LZWDecodeCompat;
// If doing horizontal differencing, must
// re-setup the predictor logic since we
// switched the basic decoder methods...
tif.tif_setupdecode(tif);
sp.dec_decode=LZWDecodeCompat;
}
sp.maxcode=(ushort)MAXCODE(BITS_MIN);
#else // !LZW_COMPAT
if(sp.dec_decode==null)
{
TIFFErrorExt(tif.tif_clientdata, tif.tif_name, "Old-style LZW codes not supported");
sp.dec_decode=LZWDecode;
}
return false;
#endif // !LZW_COMPAT
}
else
{
sp.maxcode=(ushort)(MAXCODE(BITS_MIN)-1);
sp.dec_decode=LZWDecode;
}
sp.nbits=BITS_MIN;
sp.nextbits=0;
sp.nextdata=0;
sp.dec_restart=0;
sp.dec_nbitsmask=MAXCODE(BITS_MIN);
#if LZW_CHECKEOS
sp.dec_bitsleft=(int)(tif.tif_rawcc<<3);
#endif
sp.dec_free_entp=CODE_FIRST;
// Zero entries that are not yet filled in. We do
// this to guard against bogus input data that causes
// us to index into undefined entries. If you can
// come up with a way to safely bounds-check input codes
// while decoding then you can remove this operation.
for(int i=sp.dec_free_entp; i<CSIZE; i++)
{
sp.dec_codetab[i].firstchar=0;
sp.dec_codetab[i].length=0;
sp.dec_codetab[i].value=0;
sp.dec_codetab[i].next=-1;
}
sp.dec_oldcodep=-1;
sp.dec_maxcodep=sp.dec_nbitsmask-1;
return true;
}
示例3: TIFFStartStrip
// Set state to appear as if a
// strip has just been read in.
static bool TIFFStartStrip(TIFF tif, uint strip)
{
TIFFDirectory td=tif.tif_dir;
if((tif.tif_flags&TIF_FLAGS.TIFF_CODERSETUP)==0)
{
if(!tif.tif_setupdecode(tif)) return false;
tif.tif_flags|=TIF_FLAGS.TIFF_CODERSETUP;
}
tif.tif_curstrip=strip;
tif.tif_row=(strip%td.td_stripsperimage)*td.td_rowsperstrip;
if((tif.tif_flags&TIF_FLAGS.TIFF_NOREADRAW)==TIF_FLAGS.TIFF_NOREADRAW)
{
tif.tif_rawdata=null; // ?????
tif.tif_rawcp=0;
tif.tif_rawcc=0;
}
else
{
tif.tif_rawcp=0; //was tif.tif_rawdata;
tif.tif_rawcc=td.td_stripbytecount[strip];
}
return tif.tif_predecode(tif, (ushort)(strip/td.td_stripsperimage));
}
示例4: ZIPPreDecode
// Setup state for decoding a strip.
static bool ZIPPreDecode(TIFF tif, ushort sampleNumber)
{
ZIPState sp=tif.tif_data as ZIPState;
#if DEBUG
if(sp==null) throw new Exception("sp==null");
#endif
if((sp.state&ZSTATE.INIT_DECODE)!=ZSTATE.INIT_DECODE)
tif.tif_setupdecode(tif);
sp.stream.in_buf=tif.tif_rawdata;
sp.stream.next_in=0;
sp.stream.avail_in=tif.tif_rawcc;
return zlib.inflateReset(sp.stream)==zlib.Z_OK;
}