Example #1
0
            public Reader(Stream file, EdtMetaData info)
            {
                byte[] packed = new byte[info.CompSize];
                file.Read(packed, 0, packed.Length);
                m_packed = new MemoryStream(packed, false);

                byte[] extra = new byte[info.ExtraSize];
                file.Read(extra, 0, extra.Length);
                m_extra  = new MemoryStream(extra, false);
                m_output = new byte[info.Width * info.Height * 3];

                int stride = (int)info.Width * 3;
                int offset = stride * -4;
                int i      = 0;

                while (offset != 0)
                {
                    int shift = offset - 9;
                    for (int j = 0; j < 7; ++j)
                    {
                        ShiftTable[i++] = shift;
                        shift          += 3;
                    }
                    offset += stride;
                }
                offset = -12;
                while (offset != 0)
                {
                    ShiftTable[i++] = offset;
                    offset         += 3;
                }
            }
Example #2
0
            public Reader(Stream file, EdtMetaData info)
            {
                byte[] packed = new byte[info.CompSize];
                file.Read (packed, 0, packed.Length);
                m_packed = new MemoryStream (packed, false);

                byte[] extra = new byte[info.ExtraSize];
                file.Read (extra, 0, extra.Length);
                m_extra = new MemoryStream (extra, false);
                m_output = new byte[info.Width*info.Height*3];

                int stride = (int)info.Width * 3;
                int offset = stride * -4;
                int i = 0;
                while (offset != 0)
                {
                    int shift = offset - 9;
                    for (int j = 0; j < 7; ++j)
                    {
                        ShiftTable[i++] = shift;
                        shift += 3;
                    }
                    offset += stride;
                }
                offset = -12;
                while (offset != 0)
                {
                    ShiftTable[i++] = offset;
                    offset += 3;
                }
            }