/// <summary> /// Reads the contents of a <see cref="Texture2D{T}"/> instance and writes them into a target <see cref="ReadBackTexture2D{T}"/> instance. /// </summary> /// <typeparam name="T">The type of items stored on the texture.</typeparam> /// <param name="texture">The input <see cref="Texture2D{T}"/> instance to read data from.</param> /// <param name="destination">The target <see cref="ReadBackTexture2D{T}"/> instance to write data to.</param> /// <param name="x">The horizontal offset in the source texture.</param> /// <param name="y">The vertical offset in the source texture.</param> /// <param name="width">The width of the memory area to copy.</param> /// <param name="height">The height of the memory area to copy.</param> public static void CopyTo <T>(this Texture2D <T> texture, ReadBackTexture2D <T> destination, int x, int y, int width, int height) where T : unmanaged { texture.CopyTo(destination, 0, 0, x, y, width, height); }
/// <summary> /// Reads the contents of a <see cref="Texture2D{T}"/> instance and writes them into a target <see cref="ReadBackTexture2D{T}"/> instance. /// </summary> /// <typeparam name="T">The type of items stored on the texture.</typeparam> /// <param name="texture">The input <see cref="Texture2D{T}"/> instance to read data from.</param> /// <param name="destination">The target <see cref="ReadBackTexture2D{T}"/> instance to write data to.</param> public static void CopyTo <T>(this Texture2D <T> texture, ReadBackTexture2D <T> destination) where T : unmanaged { texture.CopyTo(destination, 0, 0, 0, 0, texture.Width, texture.Height); }