Browse Source

Update T4 templates

pull/482/head
Jason Nelson 8 years ago
parent
commit
7c69caa8ed
  1. 2
      src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs
  2. 13
      src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.tt
  3. 2
      src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.cs
  4. 12
      src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt

2
src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs

@ -7,7 +7,7 @@ namespace SixLabors.ImageSharp.PixelFormats
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
public partial class PixelOperations<TPixel>
{

13
src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.tt

@ -4,9 +4,11 @@
#>
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="$(NuGetPackageRoot)/system.memory/4.5.0-preview1-26216-02/lib/netstandard2.0/System.Memory.dll" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Runtime.InteropServices" #>
<#@ output extension=".cs" #>
<#
void GenerateToDestFormatMethods(string pixelType)
@ -24,8 +26,8 @@
{
GuardSpans(sourcePixels, nameof(sourcePixels), dest, nameof(dest), count);
ref TPixel sourceBaseRef = ref sourcePixels.DangerousGetPinnableReference();
ref <#=pixelType#> destBaseRef = ref dest.DangerousGetPinnableReference();
ref TPixel sourceBaseRef = ref MemoryMarshal.GetReference(sourcePixels);
ref <#=pixelType#> destBaseRef = ref MemoryMarshal.GetReference(dest);
for (int i = 0; i < count; i++)
{
@ -64,8 +66,8 @@
{
GuardSpans(source, nameof(source), destPixels, nameof(destPixels), count);
ref <#=pixelType#> sourceRef = ref source.DangerousGetPinnableReference();
ref TPixel destRef = ref destPixels.DangerousGetPinnableReference();
ref <#=pixelType#> sourceRef = ref MemoryMarshal.GetReference(source);
ref TPixel destRef = ref MemoryMarshal.GetReference(destPixels);
Rgba32 rgba = new Rgba32(0, 0, 0, 255);
@ -101,7 +103,8 @@ namespace SixLabors.ImageSharp.PixelFormats
{
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
public partial class PixelOperations<TPixel>
{
<#

2
src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.cs

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.PixelFormats;
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>

12
src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt

@ -18,8 +18,8 @@
{
GuardSpans(source, nameof(source), destPixels, nameof(destPixels), count);
ref <#=pixelType#> sourceRef = ref source.DangerousGetPinnableReference();
ref Rgba32 destRef = ref destPixels.DangerousGetPinnableReference();
ref <#=pixelType#> sourceRef = ref MemoryMarshal.GetReference(source);
ref Rgba32 destRef = ref MemoryMarshal.GetReference(destPixels);
for (int i = 0; i < count; i++)
{
@ -40,8 +40,8 @@
{
GuardSpans(sourcePixels, nameof(sourcePixels), dest, nameof(dest), count);
ref Rgba32 sourceRef = ref sourcePixels.DangerousGetPinnableReference();
ref <#=pixelType#> destRef = ref dest.DangerousGetPinnableReference();
ref Rgba32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
ref <#=pixelType#> destRef = ref MemoryMarshal.GetReference(dest);
for (int i = 0; i < count; i++)
{
@ -61,9 +61,9 @@ namespace SixLabors.ImageSharp
{
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.PixelFormats;
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>

Loading…
Cancel
Save