Exemple #1
0
 /// <summary>
 /// Retrieves the main rendering buffer's pixel data from video memory in the Rgba8 format.
 /// As a storage array type, either byte or <see cref="ColorRgba"/> is recommended.
 /// </summary>
 /// <param name="target">The target buffer to store transferred pixel data in.</param>
 /// <param name="dataLayout">The desired color layout of the specified buffer.</param>
 /// <param name="dataElementType">The desired color element type of the specified buffer.</param>
 /// <param name="x">The x position of the rectangular area to read.</param>
 /// <param name="y">The y position of the rectangular area to read.</param>
 /// <param name="width">The width of the rectangular area to read. Defaults to the rendering targets width.</param>
 /// <param name="height">The height of the rectangular area to read. Defaults to the rendering targets height.</param>
 public static void GetOutputPixelData <T>(
     this IGraphicsBackend backend,
     T[] target,
     ColorDataLayout dataLayout,
     ColorDataElementType dataElementType,
     int x, int y,
     int width, int height) where T : struct
 {
     using (PinnedArrayHandle pinned = new PinnedArrayHandle(target))
     {
         backend.GetOutputPixelData(
             pinned.Address,
             dataLayout,
             dataElementType,
             x, y,
             width,
             height);
     }
 }