BitMiracle.LibTiff.Classic.Tiff.ComputeStrip C# (CSharp) Method

ComputeStrip() public method

Computes which strip contains the specified coordinates (row, plane).
A valid strip number is always returned; out-of-range coordinate values are clamped to the bounds of the image. The row parameter is always used in calculating a strip. The plane parameter is used only if data are organized in separate planes (TiffTag.PLANARCONFIG = PlanarConfig.SEPARATE).
public ComputeStrip ( int row, short plane ) : int
row int The row.
plane short The sample plane.
return int
        public int ComputeStrip(int row, short plane)
        {
            int strip = 0;
            if (m_dir.td_rowsperstrip != -1)
                strip = row / m_dir.td_rowsperstrip;

            if (m_dir.td_planarconfig == PlanarConfig.SEPARATE)
            {
                if (plane >= m_dir.td_samplesperpixel)
                {
                    ErrorExt(this, m_clientdata, m_name, "{0}: Sample out of range, max {1}", plane, m_dir.td_samplesperpixel);
                    return 0;
                }

                strip += plane * m_dir.td_stripsperimage;
            }

            return strip;
        }
Tiff