本文整理汇总了C#中BitMiracle.LibTiff.Classic.Tiff.VStripSize方法的典型用法代码示例。如果您正苦于以下问题:C# Tiff.VStripSize方法的具体用法?C# Tiff.VStripSize怎么用?C# Tiff.VStripSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitMiracle.LibTiff.Classic.Tiff
的用法示例。
在下文中一共展示了Tiff.VStripSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: writeBufferToSeparateStrips
static bool writeBufferToSeparateStrips(Tiff outImage, byte[] buf, int imagelength, int imagewidth, short spp)
{
byte[] obuf = new byte[outImage.StripSize()];
FieldValue[] result = outImage.GetFieldDefaulted(TiffTag.ROWSPERSTRIP);
int rowsperstrip = result[0].ToInt();
int rowsize = imagewidth * spp;
int strip = 0;
for (short s = 0; s < spp; s++)
{
for (int row = 0; row < imagelength; row += rowsperstrip)
{
int nrows = (row + rowsperstrip > imagelength) ? imagelength - row : rowsperstrip;
int stripsize = outImage.VStripSize(nrows);
cpContigBufToSeparateBuf(obuf, buf, row * rowsize + s, nrows, imagewidth, 0, 0, spp, 1);
if (outImage.WriteEncodedStrip(strip++, obuf, stripsize) < 0)
{
Tiff.Error(outImage.FileName(), "Error, can't write strip {0}", strip - 1);
return false;
}
}
}
return true;
}
示例2: cpDecodedStrips
/*
* Strip -> strip for change in encoding.
*/
bool cpDecodedStrips(Tiff inImage, Tiff outImage, int imagelength, int imagewidth, short spp)
{
int stripsize = inImage.StripSize();
byte[] buf = new byte[stripsize];
int ns = inImage.NumberOfStrips();
int row = 0;
for (int s = 0; s < ns; s++)
{
int cc = (row + m_rowsperstrip > imagelength) ? inImage.VStripSize(imagelength - row) : stripsize;
if (inImage.ReadEncodedStrip(s, buf, 0, cc) < 0 && !m_ignore)
{
Tiff.Error(inImage.FileName(), "Error, can't read strip {0}", s);
return false;
}
if (outImage.WriteEncodedStrip(s, buf, cc) < 0)
{
Tiff.Error(outImage.FileName(), "Error, can't write strip {0}", s);
return false;
}
row += m_rowsperstrip;
}
return true;
}
示例3: writeBufferToContigStrips
static bool writeBufferToContigStrips(Tiff outImage, byte[] buffer, int imagelength, int imagewidth, short spp)
{
FieldValue[] result = outImage.GetFieldDefaulted(TiffTag.ROWSPERSTRIP);
int rowsperstrip = result[0].ToInt();
int strip = 0;
int offset = 0;
for (int row = 0; row < imagelength; row += rowsperstrip)
{
int nrows = (row + rowsperstrip > imagelength) ? imagelength - row : rowsperstrip;
int stripsize = outImage.VStripSize(nrows);
if (outImage.WriteEncodedStrip(strip++, buffer, offset, stripsize) < 0)
{
Tiff.Error(outImage.FileName(), "Error, can't write strip {0}", strip - 1);
return false;
}
offset += stripsize;
}
return true;
}