Beispiel #1
0
 static Filter ReadConcreteFilter(ConvolutionFilter filter, SwfStreamReader reader)
 {
     filter.MatrixX = reader.ReadByte();
     filter.MatrixY = reader.ReadByte();
     filter.Divisor = reader.ReadFloat32();
     filter.Bias    = reader.ReadFloat32();
     filter.Matrix  = new float[filter.MatrixX * filter.MatrixY];
     for (var i = 0; i < filter.Matrix.Length; ++i)
     {
         filter.Matrix[i] = reader.ReadFloat32();
     }
     filter.DefaultColor = SwfColor.Read(reader, true);
     reader.ReadUnsignedBits(6);             // reserved
     filter.Clamp         = reader.ReadBit();
     filter.PreserveAlpha = reader.ReadBit();
     return(filter);
 }
Beispiel #2
0
 static Filter ReadConcreteFilter(ColorMatrixFilter filter, SwfStreamReader reader)
 {
     filter.Matrix = new float[20];
     for (var i = 0; i < filter.Matrix.Length; ++i)
     {
         filter.Matrix[i] = reader.ReadFloat32();
     }
     return(filter);
 }