Exemplo n.º 1
0
        private void horDiff16(byte[] buffer, int offset, int count)
        {
            short[] wBuffer = Tiff.ByteArrayToShorts(buffer, offset, count);
            int     wOffset = 0;

            int wCount = count / 2;

            if (wCount > m_stride)
            {
                wCount  -= m_stride;
                wOffset += wCount - 1;
                do
                {
                    for (int i = m_stride; i > 0; i--)
                    {
                        wBuffer[wOffset + m_stride] -= wBuffer[wOffset];
                        wOffset--;
                    }

                    wCount -= m_stride;
                }while (wCount > 0);
            }

            Tiff.ShortsToByteArray(wBuffer, 0, count / 2, buffer, offset);
        }
Exemplo n.º 2
0
        private void swabHorAcc16(byte[] buffer, int offset, int count)
        {
            short[] wBuffer = Tiff.ByteArrayToShorts(buffer, offset, count);
            int     wOffset = 0;

            int wCount = count / 2;

            if (wCount > m_stride)
            {
                Tiff.SwabArrayOfShort(wBuffer, wCount);
                wCount -= m_stride;
                do
                {
                    for (int i = m_stride; i > 0; i--)
                    {
                        wBuffer[wOffset + m_stride] += wBuffer[wOffset];
                        wOffset++;
                    }

                    wCount -= m_stride;
                }while (wCount > 0);
            }

            Tiff.ShortsToByteArray(wBuffer, 0, count / 2, buffer, offset);
        }