Compare commits

..
1 Commits
Author SHA1 Message Date
Jeremy Pritts cab5cabc4e update package info, add net 5 target, and bump version 2022-02-11 20:44:02 -05:00
15 changed files with 35 additions and 25 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using System.Drawing.Imaging;
using System.IO;
using TextureDecoder.Astc;
using AssetRipper.TextureDecoder.Astc;
namespace AstcTest
{
+1 -1
View File
@@ -2,7 +2,7 @@ using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using TextureDecoder.Atc;
using AssetRipper.TextureDecoder.Atc;
namespace AtcTest
{
+1 -1
View File
@@ -2,7 +2,7 @@ using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using TextureDecoder.Dxt;
using AssetRipper.TextureDecoder.Dxt;
namespace DxtTest
{
+1 -1
View File
@@ -2,7 +2,7 @@ using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using TextureDecoder.Etc;
using AssetRipper.TextureDecoder.Etc;
namespace EtcTest
{
+1 -1
View File
@@ -2,7 +2,7 @@ using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using TextureDecoder.Pvrtc;
using AssetRipper.TextureDecoder.Pvrtc;
namespace PvrtcTest
{
+1 -1
View File
@@ -2,7 +2,7 @@ using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using TextureDecoder.Rgb;
using AssetRipper.TextureDecoder.Rgb;
namespace RgbTest
{
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;
namespace TextureDecoder.Astc
namespace AssetRipper.TextureDecoder.Astc
{
/// <summary>
///
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using System.Runtime.CompilerServices;
namespace TextureDecoder.Atc
namespace AssetRipper.TextureDecoder.Atc
{
/// <summary>
///
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using System.Runtime.CompilerServices;
namespace TextureDecoder.Dxt
namespace AssetRipper.TextureDecoder.Dxt
{
/// <summary>
///
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;
namespace TextureDecoder.Etc
namespace AssetRipper.TextureDecoder.Etc
{
/// <summary>
///
+1 -1
View File
@@ -4,7 +4,7 @@
using System;
using System.Runtime.CompilerServices;
namespace TextureDecoder.Pvrtc
namespace AssetRipper.TextureDecoder.Pvrtc
{
/// <summary>
///
+17 -8
View File
@@ -1,7 +1,10 @@
using System;
using System.Runtime.CompilerServices;
#if NET5_0_OR_GREATER
using System.Buffers.Binary;
#endif
namespace TextureDecoder.Rgb
namespace AssetRipper.TextureDecoder.Rgb
{
/// <summary>
///
@@ -696,21 +699,26 @@ namespace TextureDecoder.Rgb
private static float ToHalf(byte[] input, int offset)
{
#if NET6_0_OR_GREATER
return (float)System.Buffers.Binary.BinaryPrimitives.ReadHalfLittleEndian(input.AsSpan(offset, 2));
#elif NET5_0_OR_GREATER
if(BitConverter.IsLittleEndian)
return (float)BitConverter.ToHalf(input, offset);
else
return (float)BitConverter.ToHalf(new byte[] { input[offset + 1], input[offset] });
return (float)BinaryPrimitives.ReadHalfLittleEndian(input.AsSpan(offset, 2));
#elif NET5_0
return (float)ToHalf(BinaryPrimitives.ReadUInt16LittleEndian(input.AsSpan(offset, 2)));
#else
return (float)Half.ToHalf(input, offset);
#endif
}
#if NET5_0
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static unsafe Half ToHalf(ushort bits)
{
return *((Half*)&bits);
}
#endif
private static float ToSingle(byte[] input, int offset)
{
#if NET5_0_OR_GREATER
return System.Buffers.Binary.BinaryPrimitives.ReadSingleLittleEndian(input.AsSpan(offset, 4));
return BinaryPrimitives.ReadSingleLittleEndian(input.AsSpan(offset, 4));
#else
if (BitConverter.IsLittleEndian)
return BitConverter.ToSingle(input, offset);
@@ -730,5 +738,6 @@ namespace TextureDecoder.Rgb
{
return byte.MaxValue < x ? byte.MaxValue : (x > byte.MinValue ? (byte)x : byte.MinValue);
}
}
}
+5 -4
View File
@@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net5.0;net6.0</TargetFrameworks>
<LangVersion>Latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RootNamespace>AssetRipper.TextureDecoder</RootNamespace>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>
<Version>1.0.2.0</Version>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<PackageId>TextureDecoder</PackageId>
<Version>1.1.0.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<PackageId>AssetRipper.TextureDecoder</PackageId>
<PackageTags>C# Texture</PackageTags>
<RepositoryUrl>https://github.com/AssetRipper/TextureDecoder</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;
namespace TextureDecoder.Yuy2
namespace AssetRipper.TextureDecoder.Yuy2
{
/// <summary>
///
+1 -1
View File
@@ -2,7 +2,7 @@ using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using TextureDecoder.Yuy2;
using AssetRipper.TextureDecoder.Yuy2;
namespace Yuy2Test
{