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) != ''">$(packageversion)</VersionPrefix>
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix> <VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
<Authors>SixLabors and contributors</Authors> <Authors>SixLabors and contributors</Authors>
<!--<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>--> <TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion> <LangVersion>7.3</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>

3
src/ImageSharp/ImageSharp.csproj

@ -5,8 +5,7 @@
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix> <VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix> <VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
<Authors>Six Labors and contributors</Authors> <Authors>Six Labors and contributors</Authors>
<!--<TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1;net472</TargetFrameworks>--> <TargetFrameworks>netstandard1.3;netstandard2.0;netcoreapp2.1;net472</TargetFrameworks>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>SixLabors.ImageSharp</AssemblyName> <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 namespace SixLabors.ImageSharp.Processing.Processors.Transforms
{ {
/// <content> /// <content>
/// Contains <see cref="MosaicKernelMap"/> /// Contains <see cref="PeriodicKernelMap"/>
/// </content> /// </content>
internal partial class ResizeKernelMap internal partial class ResizeKernelMap
{ {
/// <summary> /// <summary>
/// Memory-optimized <see cref="ResizeKernelMap"/> where repeating rows are stored only once. /// Memory-optimized <see cref="ResizeKernelMap"/> where repeating rows are stored only once.
/// </summary> /// </summary>
private sealed class MosaicKernelMap : ResizeKernelMap private sealed class PeriodicKernelMap : ResizeKernelMap
{ {
private readonly int period; private readonly int period;
private readonly int cornerInterval; private readonly int cornerInterval;
public MosaicKernelMap( public PeriodicKernelMap(
MemoryAllocator memoryAllocator, MemoryAllocator memoryAllocator,
IResampler sampler, IResampler sampler,
int sourceLength, 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; bool useMosaic = 2 * (cornerInterval + period) < destinationSize;
ResizeKernelMap result = useMosaic ResizeKernelMap result = useMosaic
? new MosaicKernelMap( ? new PeriodicKernelMap(
memoryAllocator, memoryAllocator,
sampler, sampler,
sourceSize, sourceSize,

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

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

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

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<!--<TargetFrameworks>net462;net472;netcoreapp2.1</TargetFrameworks>--> <TargetFrameworks>net462;net472;netcoreapp2.1</TargetFrameworks>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<DebugType Condition="$(codecov) != ''">full</DebugType> <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; scale = 1F;
} }
float radius = MathF.Ceiling(scale * sampler.Radius); float radius = (float)Math.Ceiling(scale * sampler.Radius);
var result = new List<ReferenceKernel>(); var result = new List<ReferenceKernel>();
@ -42,13 +42,13 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
float center = ((i + .5F) * ratio) - .5F; float center = ((i + .5F) * ratio) - .5F;
// Keep inside bounds. // Keep inside bounds.
int left = (int)MathF.Ceiling(center - radius); int left = (int)Math.Ceiling(center - radius);
if (left < 0) if (left < 0)
{ {
left = 0; left = 0;
} }
int right = (int)MathF.Floor(center + radius); int right = (int)Math.Floor(center + radius);
if (right > sourceSize - 1) if (right > sourceSize - 1)
{ {
right = sourceSize - 1; right = sourceSize - 1;

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

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

Loading…
Cancel
Save