Browse Source

cleanup & undo WIP project setup

pull/781/head
Anton Firszov 8 years ago
parent
commit
2742e1923c
  1. 3
      src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
  2. 3
      src/ImageSharp/ImageSharp.csproj
  3. 6
      src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeKernelMap.PeriodicKernelMap.cs
  4. 2
      src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeKernelMap.cs
  5. 3
      tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj
  6. 3
      tests/ImageSharp.Tests/ImageSharp.Tests.csproj
  7. 6
      tests/ImageSharp.Tests/Processing/Processors/Transforms/KernelMapTests.ReferenceKernelMap.cs
  8. 9
      tests/ImageSharp.Tests/Processing/Processors/Transforms/KernelMapTests.cs

3
src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

@ -5,8 +5,7 @@
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
<Authors>SixLabors and contributors</Authors>
<!--<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>-->
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
<LangVersion>7.3</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

3
src/ImageSharp/ImageSharp.csproj

@ -5,8 +5,7 @@
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
<Authors>Six Labors and contributors</Authors>
<!--<TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1;net472</TargetFrameworks>-->
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1;net472</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>SixLabors.ImageSharp</AssemblyName>

6
src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeKernelMap.MosaicKernelMap.cs → src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeKernelMap.PeriodicKernelMap.cs

@ -8,20 +8,20 @@ using SixLabors.Memory;
namespace SixLabors.ImageSharp.Processing.Processors.Transforms
{
/// <content>
/// Contains <see cref="MosaicKernelMap"/>
/// Contains <see cref="PeriodicKernelMap"/>
/// </content>
internal partial class ResizeKernelMap
{
/// <summary>
/// Memory-optimized <see cref="ResizeKernelMap"/> where repeating rows are stored only once.
/// </summary>
private sealed class MosaicKernelMap : ResizeKernelMap
private sealed class PeriodicKernelMap : ResizeKernelMap
{
private readonly int period;
private readonly int cornerInterval;
public MosaicKernelMap(
public PeriodicKernelMap(
MemoryAllocator memoryAllocator,
IResampler sampler,
int sourceLength,

2
src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeKernelMap.cs

@ -118,7 +118,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
bool useMosaic = 2 * (cornerInterval + period) < destinationSize;
ResizeKernelMap result = useMosaic
? new MosaicKernelMap(
? new PeriodicKernelMap(
memoryAllocator,
sampler,
sourceSize,

3
tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>-->
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<RootNamespace>SixLabors.ImageSharp.Benchmarks</RootNamespace>

3
tests/ImageSharp.Tests/ImageSharp.Tests.csproj

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--<TargetFrameworks>net462;net472;netcoreapp2.1</TargetFrameworks>-->
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>net462;net472;netcoreapp2.1</TargetFrameworks>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<DebugType Condition="$(codecov) != ''">full</DebugType>

6
tests/ImageSharp.Tests/Processing/Processors/Transforms/KernelMapTests.ReferenceKernelMap.cs

@ -33,7 +33,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
scale = 1F;
}
float radius = MathF.Ceiling(scale * sampler.Radius);
float radius = (float)Math.Ceiling(scale * sampler.Radius);
var result = new List<ReferenceKernel>();
@ -42,13 +42,13 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
float center = ((i + .5F) * ratio) - .5F;
// Keep inside bounds.
int left = (int)MathF.Ceiling(center - radius);
int left = (int)Math.Ceiling(center - radius);
if (left < 0)
{
left = 0;
}
int right = (int)MathF.Floor(center + radius);
int right = (int)Math.Floor(center + radius);
if (right > sourceSize - 1)
{
right = sourceSize - 1;

9
tests/ImageSharp.Tests/Processing/Processors/Transforms/KernelMapTests.cs

@ -1,12 +1,11 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Text;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Transforms;
using SixLabors.Primitives;
using Xunit;
using Xunit.Abstractions;

Loading…
Cancel
Save