mirror of
https://github.com/DarthAffe/ScreenCapture.NET.git
synced 2025-12-12 13:28:35 +00:00
commit
fb4876e2f6
@ -1,6 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net7.0-windows;net6.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
@ -28,9 +29,9 @@
|
||||
<PackageReleaseNotes>
|
||||
</PackageReleaseNotes>
|
||||
|
||||
<Version>2.0.0</Version>
|
||||
<AssemblyVersion>2.0.0</AssemblyVersion>
|
||||
<FileVersion>2.0.0</FileVersion>
|
||||
<Version>2.0.2</Version>
|
||||
<AssemblyVersion>2.0.2</AssemblyVersion>
|
||||
<FileVersion>2.0.2</FileVersion>
|
||||
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net7.0-windows;net6.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
@ -28,9 +29,9 @@
|
||||
<PackageReleaseNotes>
|
||||
</PackageReleaseNotes>
|
||||
|
||||
<Version>2.0.0</Version>
|
||||
<AssemblyVersion>2.0.0</AssemblyVersion>
|
||||
<FileVersion>2.0.0</FileVersion>
|
||||
<Version>2.0.2</Version>
|
||||
<AssemblyVersion>2.0.2</AssemblyVersion>
|
||||
<FileVersion>2.0.2</FileVersion>
|
||||
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@ -29,9 +29,9 @@
|
||||
<PackageReleaseNotes>
|
||||
</PackageReleaseNotes>
|
||||
|
||||
<Version>2.0.0</Version>
|
||||
<AssemblyVersion>2.0.0</AssemblyVersion>
|
||||
<FileVersion>2.0.0</FileVersion>
|
||||
<Version>2.0.2</Version>
|
||||
<AssemblyVersion>2.0.2</AssemblyVersion>
|
||||
<FileVersion>2.0.2</FileVersion>
|
||||
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@ -20,12 +20,21 @@ public sealed class CaptureZone<TColor> : ICaptureZone
|
||||
/// <inheritdoc />
|
||||
public Display Display { get; }
|
||||
|
||||
#if NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat ColorFormat
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => TColor.ColorFormat;
|
||||
}
|
||||
#else
|
||||
/// <inheritdoc />
|
||||
public ColorFormat ColorFormat
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => default(TColor).Net6ColorFormat;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <inheritdoc />
|
||||
public int X { get; internal set; }
|
||||
@ -95,7 +104,7 @@ public sealed class CaptureZone<TColor> : ICaptureZone
|
||||
/// <inheritdoc />
|
||||
public bool IsUpdateRequested { get; private set; }
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
|
||||
@ -17,6 +17,11 @@ public readonly struct ColorABGR : IColor
|
||||
/// <inheritdoc />
|
||||
public static ColorFormat ColorFormat => ColorFormat.ABGR;
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat Net6ColorFormat => ColorFormat;
|
||||
#endif
|
||||
|
||||
private readonly byte _a;
|
||||
private readonly byte _b;
|
||||
private readonly byte _g;
|
||||
|
||||
@ -17,6 +17,11 @@ public readonly struct ColorARGB : IColor
|
||||
/// <inheritdoc />
|
||||
public static ColorFormat ColorFormat => ColorFormat.ARGB;
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat Net6ColorFormat => ColorFormat;
|
||||
#endif
|
||||
|
||||
private readonly byte _a;
|
||||
private readonly byte _r;
|
||||
private readonly byte _g;
|
||||
|
||||
@ -17,6 +17,11 @@ public readonly struct ColorBGR : IColor
|
||||
/// <inheritdoc />
|
||||
public static ColorFormat ColorFormat => ColorFormat.BGR;
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat Net6ColorFormat => ColorFormat;
|
||||
#endif
|
||||
|
||||
private readonly byte _b;
|
||||
private readonly byte _g;
|
||||
private readonly byte _r;
|
||||
|
||||
@ -17,6 +17,11 @@ public readonly struct ColorBGRA : IColor
|
||||
/// <inheritdoc />
|
||||
public static ColorFormat ColorFormat => ColorFormat.BGRA;
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat Net6ColorFormat => ColorFormat;
|
||||
#endif
|
||||
|
||||
private readonly byte _b;
|
||||
private readonly byte _g;
|
||||
private readonly byte _r;
|
||||
@ -36,7 +41,7 @@ public readonly struct ColorBGRA : IColor
|
||||
public byte A => _a;
|
||||
// ReSharper restore ConvertToAutoPropertyWhenPossible
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
|
||||
@ -17,6 +17,11 @@ public readonly struct ColorRGB : IColor
|
||||
/// <inheritdoc />
|
||||
public static ColorFormat ColorFormat => ColorFormat.RGB;
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat Net6ColorFormat => ColorFormat;
|
||||
#endif
|
||||
|
||||
private readonly byte _r;
|
||||
private readonly byte _g;
|
||||
private readonly byte _b;
|
||||
|
||||
@ -17,6 +17,11 @@ public readonly struct ColorRGBA : IColor
|
||||
/// <inheritdoc />
|
||||
public static ColorFormat ColorFormat => ColorFormat.RGBA;
|
||||
|
||||
#if !NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat Net6ColorFormat => ColorFormat;
|
||||
#endif
|
||||
|
||||
private readonly byte _r;
|
||||
private readonly byte _g;
|
||||
private readonly byte _b;
|
||||
|
||||
@ -27,8 +27,12 @@ public interface IColor
|
||||
/// </summary>
|
||||
byte A { get; }
|
||||
|
||||
#if NET7_0_OR_GREATER
|
||||
/// <summary>
|
||||
/// Gets the color-format of this color.
|
||||
/// </summary>
|
||||
public static virtual ColorFormat ColorFormat => throw new NotSupportedException();
|
||||
#else
|
||||
public ColorFormat Net6ColorFormat { get; }
|
||||
#endif
|
||||
}
|
||||
@ -18,8 +18,21 @@ public sealed class Image<TColor> : IImage
|
||||
private readonly int _y;
|
||||
private readonly int _stride;
|
||||
|
||||
#if NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public ColorFormat ColorFormat => TColor.ColorFormat;
|
||||
public ColorFormat ColorFormat
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => TColor.ColorFormat;
|
||||
}
|
||||
#else
|
||||
/// <inheritdoc />
|
||||
public ColorFormat ColorFormat
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => default(TColor).Net6ColorFormat;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <inheritdoc />
|
||||
public int Width { get; }
|
||||
@ -28,7 +41,7 @@ public sealed class Image<TColor> : IImage
|
||||
public int Height { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public int SizeInBytes => Width * Height * TColor.ColorFormat.BytesPerPixel;
|
||||
public int SizeInBytes => Width * Height * ColorFormat.BytesPerPixel;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -96,7 +109,7 @@ public sealed class Image<TColor> : IImage
|
||||
if (destination == null) throw new ArgumentNullException(nameof(destination));
|
||||
if (destination.Length < SizeInBytes) throw new ArgumentException("The destination is too small to fit this image.", nameof(destination));
|
||||
|
||||
int targetStride = Width * TColor.ColorFormat.BytesPerPixel;
|
||||
int targetStride = Width * ColorFormat.BytesPerPixel;
|
||||
IImage.IImageRows rows = Rows;
|
||||
Span<byte> target = destination;
|
||||
foreach (IImage.IImageRow row in rows)
|
||||
@ -211,8 +224,13 @@ public sealed class Image<TColor> : IImage
|
||||
/// <inheritdoc />
|
||||
public int Length => _length;
|
||||
|
||||
#if NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public int SizeInBytes => Length * TColor.ColorFormat.BytesPerPixel;
|
||||
#else
|
||||
/// <inheritdoc />
|
||||
public int SizeInBytes => Length * default(TColor).Net6ColorFormat.BytesPerPixel;
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
||||
@ -349,8 +367,13 @@ public sealed class Image<TColor> : IImage
|
||||
/// <inheritdoc />
|
||||
public int Length => _length;
|
||||
|
||||
#if NET7_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
public int SizeInBytes => Length * TColor.ColorFormat.BytesPerPixel;
|
||||
#else
|
||||
/// <inheritdoc />
|
||||
public int SizeInBytes => Length * default(TColor).Net6ColorFormat.BytesPerPixel;
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@ -26,12 +26,12 @@
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
|
||||
<PackageReleaseNotes>
|
||||
Reworked most of the data handling and splitted capture-logic into separate packages.
|
||||
Fixed issues with .NET 6
|
||||
</PackageReleaseNotes>
|
||||
|
||||
<Version>2.0.1</Version>
|
||||
<AssemblyVersion>2.0.1</AssemblyVersion>
|
||||
<FileVersion>2.0.1</FileVersion>
|
||||
<Version>2.0.2</Version>
|
||||
<AssemblyVersion>2.0.2</AssemblyVersion>
|
||||
<FileVersion>2.0.2</FileVersion>
|
||||
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user