Esempio n. 1
0
        protected override IColor[] DecodeBlock(IList <byte> block, int position)
        {
            var bl = new IColor[8 * 4];
            var s  = new VectorReader(block, position, Endianness.Big);

            for (var j = 0; j < 4; ++j)
            {
                for (var i = 0; i < 8; ++i)
                {
                    var intensity = s.ReadU8();
                    bl[j * 8 + i] = ColorImpl.FromIntensityByte(intensity);
                }
            }

            return(bl);
        }
Esempio n. 2
0
        protected override IColor[] DecodeBlock(IList <byte> block, int position)
        {
            var bl = new IColor[8 * 8];
            var s  = new VectorReader(block, position, Endianness.Big);

            for (var j = 0; j < 8; ++j)
            {
                for (var i = 0; i < 4; ++i)
                {
                    var pixes = s.ReadU8();

                    var intensity1 = ColorUtil.ExtractScaled(pixes, 4, 4, 17);
                    var intensity2 = ColorUtil.ExtractScaled(pixes, 0, 4, 17);

                    bl[j * 8 + 2 * i]     = ColorImpl.FromIntensityByte(intensity1);
                    bl[j * 8 + 2 * i + 1] = ColorImpl.FromIntensityByte(intensity2);
                }
            }

            return(bl);
        }