From 59f1f0fc05a2e3c9cb70ff69b86eca60994b00ed Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Tue, 27 Feb 2018 16:44:43 +0100 Subject: [PATCH] Temporary Vortex --- src/ImageSharp.Drawing/Paths/ShapeRegion.cs | 2 +- src/ImageSharp/Common/Extensions/SimdUtils.cs | 4 ++-- src/ImageSharp/Common/Helpers/ParallelFor.cs | 6 +++--- .../Jpeg/Common/Decoder/JpegComponentPostProcessor.cs | 2 +- .../Formats/Jpeg/Common/Decoder/JpegImagePostProcessor.cs | 2 +- .../Jpeg/GolangPort/Components/Decoder/InputProcessor.cs | 2 +- .../Jpeg/GolangPort/Components/Decoder/OrigHuffmanTree.cs | 2 +- src/ImageSharp/Memory/Buffer2D{T}.cs | 2 +- .../Processing/Processors/Transforms/ResizeProcessor.cs | 2 +- .../ReferenceImplementations.LLM_FloatingPoint_DCT.cs | 2 +- .../ImageSharp.Tests/TestUtilities/TestImageExtensions.cs | 8 ++++---- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/ImageSharp.Drawing/Paths/ShapeRegion.cs b/src/ImageSharp.Drawing/Paths/ShapeRegion.cs index 072a38cf86..cc27f7fbb8 100644 --- a/src/ImageSharp.Drawing/Paths/ShapeRegion.cs +++ b/src/ImageSharp.Drawing/Paths/ShapeRegion.cs @@ -47,7 +47,7 @@ namespace SixLabors.ImageSharp.Drawing var start = new PointF(this.Bounds.Left - 1, y); var end = new PointF(this.Bounds.Right + 1, y); - // TODO: This is a temporal workaround because of the lack of Span API-s on IPath. We should use MemoryManager.Allocate() here! + // TODO: This is a temporary workaround because of the lack of Span API-s on IPath. We should use MemoryManager.Allocate() here! PointF[] innerBuffer = new PointF[buffer.Length]; int count = this.Shape.FindIntersections(start, end, innerBuffer, 0); diff --git a/src/ImageSharp/Common/Extensions/SimdUtils.cs b/src/ImageSharp/Common/Extensions/SimdUtils.cs index 0188bc03cf..7f46b7a847 100644 --- a/src/ImageSharp/Common/Extensions/SimdUtils.cs +++ b/src/ImageSharp/Common/Extensions/SimdUtils.cs @@ -83,7 +83,7 @@ namespace SixLabors.ImageSharp Vector magick = new Vector(32768.0f); Vector scale = new Vector(255f) / new Vector(256f); - // need to copy to a temporal struct, because + // need to copy to a temporary struct, because // SimdUtils.Octet.OfUInt32 temp = Unsafe.As, SimdUtils.Octet.OfUInt32>(ref x) // does not work. TODO: This might be a CoreClr bug, need to ask/report var temp = default(Octet.OfUInt32); @@ -124,7 +124,7 @@ namespace SixLabors.ImageSharp Vector magick = new Vector(32768.0f); Vector scale = new Vector(255f) / new Vector(256f); - // need to copy to a temporal struct, because + // need to copy to a temporary struct, because // SimdUtils.Octet.OfUInt32 temp = Unsafe.As, SimdUtils.Octet.OfUInt32>(ref x) // does not work. TODO: This might be a CoreClr bug, need to ask/report var temp = default(Octet.OfUInt32); diff --git a/src/ImageSharp/Common/Helpers/ParallelFor.cs b/src/ImageSharp/Common/Helpers/ParallelFor.cs index 9a30b0b508..da91259051 100644 --- a/src/ImageSharp/Common/Helpers/ParallelFor.cs +++ b/src/ImageSharp/Common/Helpers/ParallelFor.cs @@ -18,8 +18,8 @@ namespace SixLabors.ImageSharp } /// - /// Helper method to execute Parallel.For with temporal worker buffer in an optimized way. - /// The buffer will be only instantiated for each worker Task, the contents are not cleaned automatically. + /// Helper method to execute Parallel.For with temporary worker buffer shared between executing tasks. + /// The buffer is not guaranteed to be clean! /// /// The value type of the buffer /// The start index, inclusive. @@ -27,7 +27,7 @@ namespace SixLabors.ImageSharp /// The used for getting the and /// The length of the requested parallel buffer /// The delegate that is invoked once per iteration. - public static void WithTemporalBuffer( + public static void WithTemporaryBuffer( int fromInclusive, int toExclusive, Configuration configuration, diff --git a/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegComponentPostProcessor.cs b/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegComponentPostProcessor.cs index ea9e52ae1b..1be637b6df 100644 --- a/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegComponentPostProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegComponentPostProcessor.cs @@ -45,7 +45,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Common.Decoder public IJpegComponent Component { get; } /// - /// Gets the temporal working buffer of color values. + /// Gets the temporary working buffer of color values. /// public Buffer2D ColorBuffer { get; } diff --git a/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegImagePostProcessor.cs b/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegImagePostProcessor.cs index aa1c216a75..2adf3e02d0 100644 --- a/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegImagePostProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/Common/Decoder/JpegImagePostProcessor.cs @@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Common.Decoder public int NumberOfPostProcessorSteps { get; } /// - /// Gets the size of the temporal buffers we need to allocate into . + /// Gets the size of the temporary buffers we need to allocate into . /// public Size PostProcessorBufferSize { get; } diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs index e7c58f2346..3bef32551f 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/InputProcessor.cs @@ -46,7 +46,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder public Stream InputStream { get; } /// - /// Gets the temporal buffer, same instance as + /// Gets the temporary buffer, same instance as /// public byte[] Temp { get; } diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigHuffmanTree.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigHuffmanTree.cs index 85273c69ed..dbc7bb0f7f 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigHuffmanTree.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OrigHuffmanTree.cs @@ -107,7 +107,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder /// Internal part of the DHT processor, whatever does it mean /// /// The decoder instance - /// The temporal buffer that holds the data that has been read from the Jpeg stream + /// The temporary buffer that holds the data that has been read from the Jpeg stream /// Remaining bits public void ProcessDefineHuffmanTablesMarkerLoop( ref InputProcessor inputProcessor, diff --git a/src/ImageSharp/Memory/Buffer2D{T}.cs b/src/ImageSharp/Memory/Buffer2D{T}.cs index 7f9fb59c4c..dc992368c9 100644 --- a/src/ImageSharp/Memory/Buffer2D{T}.cs +++ b/src/ImageSharp/Memory/Buffer2D{T}.cs @@ -72,7 +72,7 @@ namespace SixLabors.ImageSharp.Memory /// /// Swap the contents (, , ) of the two buffers. - /// Useful to transfer the contents of a temporal to a persistent + /// Useful to transfer the contents of a temporary to a persistent /// /// The first buffer /// The second buffer diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index 169496a982..2c18dc29b2 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -128,7 +128,7 @@ namespace SixLabors.ImageSharp.Processing.Processors { firstPassPixels.Buffer.Clear(); - ParallelFor.WithTemporalBuffer( + ParallelFor.WithTemporaryBuffer( 0, sourceRectangle.Bottom, configuration, diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs index 37d42eb72f..e18323f848 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs @@ -131,7 +131,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg.Utils /// /// Original: https://github.com/norishigefukushima/dct_simd/blob/master/dct/dct8x8_simd.cpp#L239 - /// Applyies IDCT transformation on "s" copying transformed values to "d", using temporal block "temp" + /// Applyies IDCT transformation on "s" copying transformed values to "d", using temporary block "temp" /// /// /// diff --git a/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs b/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs index e9dc09989c..6014e25334 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs @@ -254,7 +254,7 @@ namespace SixLabors.ImageSharp.Tests testOutputDetails, appendPixelTypeToFileName); - var temporalFrameImages = new List>(); + var temporaryFrameImages = new List>(); IImageDecoder decoder = TestEnvironment.GetReferenceDecoder(frameFiles[0]); @@ -266,14 +266,14 @@ namespace SixLabors.ImageSharp.Tests } var tempImage = Image.Load(path, decoder); - temporalFrameImages.Add(tempImage); + temporaryFrameImages.Add(tempImage); } - Image firstTemp = temporalFrameImages[0]; + Image firstTemp = temporaryFrameImages[0]; var result = new Image(firstTemp.Width, firstTemp.Height); - foreach (Image fi in temporalFrameImages) + foreach (Image fi in temporaryFrameImages) { result.Frames.AddFrame(fi.Frames.RootFrame); fi.Dispose();