Пример #1
0
 /// <summary>
 /// Converts a <see cref="IShape"/> to bit array.
 /// Can only convert Polygon shapes (throws NotSupportedException otherwise)
 /// The array is build up of ( 32 + 64 x Coordinates ) bits.
 /// </summary>
 /// <example>
 /// Given a triangle (total 224 bits)
 /// bit     |   Description
 ///   0- 31     RGBA triangle 1 (4x byte)
 ///  32- 95     Coordinate 1 triangle 1 (tuple of 2x int)
 ///  96-159     Coordinate 2 triangle 1 (tuple of 2x int)
 /// 160-223     Coordinate 3 triangle 1 (tuple of 2x int)
 /// </example>
 /// <param name="shape">The shape to convert to bit array</param>
 /// <returns>Bit array representing the shape</returns>
 public static bool[] AsBitArray(this IShape shape)
 {
     return(shape.AsByteArray().AsBitArray());
 }