コード例 #1
0
        public void Fill16Swap(int i, int j, byte [] src_data, int offset, int count)
        {
            unsafe {
                ushort *rowpix;

                fixed(ushort *pixels = &data[0])
                {
                    fixed(byte *bytes = &src_data[offset])
                    {
                        ushort *src_pixels = (ushort *)bytes;

                        rowpix = pixels + i * rowstride + j;

                        for (int col = 0; col < count; col++)
                        {
                            rowpix [col] = BitConverter.Swap(src_pixels [col]);
                        }
                    }
                }
            }
        }