AlphaBitmapData
Inheritance: ISwfSerializer
        /// <summary>
        /// see <see cref="SwfDotNet.IO.Tags.BaseTag">base class</see>
        /// </summary>
        public override void ReadData(byte version, BufferedBinaryReader binaryReader)
        {
            RecordHeader rh = new RecordHeader();
            rh.ReadData(binaryReader);

            int beforePos = (int)binaryReader.BaseStream.Position;
            int toReaded = (int)rh.TagLength - 7;

            _characterId = binaryReader.ReadUInt16();
            _bitmapFormat = binaryReader.ReadByte();
            _bitmapWidth = binaryReader.ReadUInt16();
            _bitmapHeight = binaryReader.ReadUInt16();
            _bitmapColorTableSize = 0;

            if (_bitmapFormat == 3)
            {
                _bitmapColorTableSize = binaryReader.ReadByte();
                toReaded--;
            }

            int imageSize = _bitmapWidth * _bitmapHeight;

            if (_bitmapFormat == 3)
            {
                int uncompressedSize = imageSize + ((_bitmapColorTableSize + 1) * 4);
                byte[] uncompressed = new byte[uncompressedSize];
                byte[] compressed = binaryReader.ReadBytes(toReaded);
                Inflater zipInflator = 	new Inflater();
                zipInflator.SetInput(compressed);
                zipInflator.Inflate(uncompressed, 0, uncompressedSize);

                _alphaColorMapData = new AlphaColorMapData();
                _alphaColorMapData.ColorTableRgb = new RGBA[_bitmapColorTableSize + 1];
                int offset = 0;
                for (int i = 0; i < _bitmapColorTableSize + 1; i++, offset += 4)
                {
                    byte red = uncompressed[offset];
                    byte green = uncompressed[offset + 1];
                    byte blue = uncompressed[offset + 2];
                    byte alpha = uncompressed[offset + 3];
                    _alphaColorMapData.ColorTableRgb[i] = new RGBA(red, green, blue, alpha);
                }
                _alphaColorMapData.ColorMapPixelData = new byte[uncompressedSize - offset];
                for (int i = 0; i < uncompressedSize - offset; i++, offset++)
                    _alphaColorMapData.ColorMapPixelData[i] = uncompressed[offset];
            }
            else if (_bitmapFormat == 4 || _bitmapFormat == 5)
            {
                int uncompressedSize = imageSize * 4;
                byte[] uncompressed = new byte[uncompressedSize];
                byte[] compressed = binaryReader.ReadBytes(toReaded);
                Inflater zipInflator = 	new Inflater();
                zipInflator.SetInput(compressed);
                zipInflator.Inflate(uncompressed, 0, uncompressedSize);

                _alphaBitmapData = new AlphaBitmapData();
                _alphaBitmapData.BitmapPixelData = new RGBA[imageSize];
                for (int i = 0, j = 0; i < imageSize; i++, j += 4)
                {
                    byte red = uncompressed[j];
                    byte green = uncompressed[j + 1];
                    byte blue = uncompressed[j + 2];
                    byte alpha = uncompressed[j + 3];
                    _alphaBitmapData.BitmapPixelData[i] = new RGBA(red, green, blue, alpha);
                }
            }
        }
        /// <summary>
        /// Creates a new <see cref="DefineBitsLossLess2Tag"/> instance.
        /// </summary>
        /// <param name="characterId">id for this character</param>
        /// <param name="bitmapFormat">Format of compressed data</param>
        /// <param name="bitmapWidth">Width of bitmap image</param>
        /// <param name="bitmapHeight">Height of bitmap image</param>
        /// <param name="bitmapColorTableSize">actual number of colors in the color table</param>
        /// <param name="zlibBitmapData">zlib compressed bitmap data</param>
        public DefineBitsLossLess2Tag(ushort characterId, byte bitmapFormat, ushort bitmapWidth,
			ushort bitmapHeight, ushort bitmapColorTableSize, AlphaBitmapData zlibBitmapData)
        {
            _characterId = characterId;
            _bitmapFormat = bitmapFormat;
            _bitmapWidth = bitmapWidth;
            _bitmapHeight = bitmapHeight;
            _bitmapColorTableSize = bitmapColorTableSize;
            _alphaBitmapData = zlibBitmapData;
            _tagCode = (int)TagCodeEnum.DefineBitsLossLess2;
        }