mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-06 03:16:26 +02:00
Move solution and projects to src
This commit is contained in:
parent
cd124bda58
commit
cee7121058
3466 changed files with 55 additions and 55 deletions
26
src/Ryujinx.Graphics.Nvdec/Image/SurfaceCommon.cs
Normal file
26
src/Ryujinx.Graphics.Nvdec/Image/SurfaceCommon.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using Ryujinx.Graphics.Texture;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.Image
|
||||
{
|
||||
static class SurfaceCommon
|
||||
{
|
||||
public static int GetBlockLinearSize(int width, int height, int bytesPerPixel)
|
||||
{
|
||||
return SizeCalculator.GetBlockLinearTextureSize(width, height, 1, 1, 1, 1, 1, bytesPerPixel, 2, 1, 1).TotalSize;
|
||||
}
|
||||
|
||||
public static void Copy(ISurface src, ISurface dst)
|
||||
{
|
||||
src.YPlane.AsSpan().CopyTo(dst.YPlane.AsSpan());
|
||||
src.UPlane.AsSpan().CopyTo(dst.UPlane.AsSpan());
|
||||
src.VPlane.AsSpan().CopyTo(dst.VPlane.AsSpan());
|
||||
}
|
||||
|
||||
public unsafe static Span<byte> AsSpan(this Plane plane)
|
||||
{
|
||||
return new Span<byte>((void*)plane.Pointer, plane.Length);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue