BaseFilter IFilterVisitor <ISwfStreamReader, BaseFilter> .Visit(GradientGlowFilter filter, ISwfStreamReader reader) { var count = reader.ReadByte(); for (var i = 0; i < count; i++) { var record = new GradientRecordRGBA(); record.Color = reader.ReadRGBA(); filter.GradientColors.Add(record); } for (var i = 0; i < count; i++) { filter.GradientColors[i].Ratio = reader.ReadByte(); } filter.BlurX = reader.ReadFixed(); filter.BlurY = reader.ReadFixed(); filter.Angle = reader.ReadFixed(); filter.Distance = reader.ReadFixed(); filter.Strength = reader.ReadFixedPoint8(); filter.InnerGlow = reader.ReadBit(); filter.Knockout = reader.ReadBit(); filter.CompositeSource = reader.ReadBit(); filter.OnTop = reader.ReadBit(); filter.Passes = reader.ReadUnsignedBits(4); return(filter); }
object IFilterVisitor <ISwfStreamWriter, object> .Visit(GradientGlowFilter filter, ISwfStreamWriter writer) { writer.WriteByte((byte)filter.GradientColors.Count); foreach (var record in filter.GradientColors) { writer.WriteRGBA(record.Color); } foreach (var record in filter.GradientColors) { writer.WriteByte(record.Ratio); } writer.WriteFixed(filter.BlurX); writer.WriteFixed(filter.BlurY); writer.WriteFixed(filter.Angle); writer.WriteFixed(filter.Distance); writer.WriteFixedPoint8(filter.Strength); writer.WriteBit(filter.InnerGlow); writer.WriteBit(filter.Knockout); writer.WriteBit(filter.CompositeSource); writer.WriteBit(filter.OnTop); writer.WriteUnsignedBits(filter.Passes, 4); return(null); }