Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public bool BeginGlyph(RectangleF bounds, GlyphRendererParameters parameters)
subPixelOffset.X = MathF.Round(subPixelOffset.X * AccuracyMultiple) / AccuracyMultiple;
subPixelOffset.Y = MathF.Round(subPixelOffset.Y * AccuracyMultiple) / AccuracyMultiple;

// we have offset our rendering origion a little bit down to prevent edge cropping, move the draw origin up to compensate
// we have offset our rendering origin a little bit down to prevent edge cropping, move the draw origin up to compensate
this.currentRenderPosition = new Point(this.currentRenderPosition.X - this.offset, this.currentRenderPosition.Y - this.offset);
this.currentGlyphRenderParams = (parameters, subPixelOffset);

Expand All @@ -205,7 +205,7 @@ public bool BeginGlyph(RectangleF bounds, GlyphRendererParameters parameters)
// we check to see if we have a render cache and if we do then we render else
this.builder.Clear();

// ensure all glyphs render around [zero, zero] so offset negative root positions so when we draw the glyph we can offet it back
// ensure all glyphs render around [zero, zero] so offset negative root positions so when we draw the glyph we can offset it back
this.builder.SetOrigin(new PointF(-(int)bounds.X + this.offset, -(int)bounds.Y + this.offset));

this.rasterizationRequired = true;
Expand Down Expand Up @@ -244,7 +244,7 @@ public void EndGlyph()
{
GlyphRenderData renderData = default;

// has the glyoh been rendedered already????
// has the glyph been rendered already?
if (this.rasterizationRequired)
{
IPath path = this.builder.Build();
Expand Down Expand Up @@ -303,7 +303,7 @@ private Buffer2D<float> Render(IPath path)
float offset = 0.5f;
if (this.Options.Antialias)
{
offset = 0f; // we are antialising skip offsetting as real antalising should take care of offset.
offset = 0f; // we are antialiasing skip offsetting as real antialiasing should take care of offset.
subpixelCount = this.Options.AntialiasSubpixelDepth;
if (subpixelCount < 4)
{
Expand Down Expand Up @@ -443,4 +443,4 @@ public void Dispose()
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/ImageSharp/Advanced/AdvancedImageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static ref TPixel DangerousGetPinnableReferenceToPixelBuffer<TPixel>(this
/// <summary>
/// Returns a reference to the 0th element of the Pixel buffer,
/// allowing direct manipulation of pixel data through unsafe operations.
/// The pixel buffer is a contigous memory area containing Width*Height TPixel elements layed out in row-major order.
/// The pixel buffer is a contiguous memory area containing Width*Height TPixel elements laid out in row-major order.
/// </summary>
/// <typeparam name="TPixel">The Pixel format.</typeparam>
/// <param name="source">The source image</param>
Expand Down
6 changes: 3 additions & 3 deletions src/ImageSharp/Advanced/AotCompilerTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ private static void Seed<TPixel>()

/// <summary>
/// This method doesn't actually do anything but serves an important purpose...
/// If you are running ImageSharp on iOS and try to call SaveAsGif, it will throw an excepion:
/// If you are running ImageSharp on iOS and try to call SaveAsGif, it will throw an exception:
/// "Attempting to JIT compile method... OctreeFrameQuantizer.ConstructPalette... while running in aot-only mode."
/// The reason this happens is the SaveAsGif method makes haevy use of generics, which are too confusing for the AoT
/// The reason this happens is the SaveAsGif method makes heavy use of generics, which are too confusing for the AoT
/// compiler used on Xamarin.iOS. It spins up the JIT compiler to try and figure it out, but that is an illegal op on
/// iOS so it bombs out.
/// If you are getting the above error, you need to call this method, which will pre-seed the AoT compiler with the
Expand Down Expand Up @@ -185,4 +185,4 @@ private static void AotCompileResizeOperations<TPixel>()
genericResizeProcessor.AotCreateDestination(new Image<TPixel>(0, 0), default);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ColorSpaceConverter
/// <returns>The <see cref="CieLab"/></returns>
public CieLab ToCieLab(in CieLch color)
{
// Conversion (perserving white point)
// Conversion (preserving white point)
CieLab unadapted = CieLchToCieLabConverter.Convert(color);

return this.Adapt(unadapted);
Expand Down Expand Up @@ -446,4 +446,4 @@ public void Convert(ReadOnlySpan<YCbCr> source, Span<CieLab> destination)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void Convert(ReadOnlySpan<CieLch> source, Span<CieLuv> destination)
/// <returns>The <see cref="CieLab"/></returns>
public CieLuv ToCieLuv(in CieLchuv color)
{
// Conversion (perserving white point)
// Conversion (preserving white point)
CieLuv unadapted = CieLchuvToCieLuvConverter.Convert(color);

// Adaptation
Expand Down Expand Up @@ -438,4 +438,4 @@ public void Convert(ReadOnlySpan<YCbCr> source, Span<CieLuv> destination)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation
/// <summary>
/// Initializes a new instance of the <see cref="RgbPrimariesChromaticityCoordinates"/> struct.
/// </summary>
/// <param name="r">The chomaticity coordinates of the red channel.</param>
/// <param name="g">The chomaticity coordinates of the green channel.</param>
/// <param name="b">The chomaticity coordinates of the blue channel.</param>
/// <param name="r">The chromaticity coordinates of the red channel.</param>
/// <param name="g">The chromaticity coordinates of the green channel.</param>
/// <param name="b">The chromaticity coordinates of the blue channel.</param>
public RgbPrimariesChromaticityCoordinates(CieXyChromaticityCoordinates r, CieXyChromaticityCoordinates g, CieXyChromaticityCoordinates b)
{
this.R = r;
Expand All @@ -25,17 +25,17 @@ public RgbPrimariesChromaticityCoordinates(CieXyChromaticityCoordinates r, CieXy
}

/// <summary>
/// Gets the chomaticity coordinates of the red channel.
/// Gets the chromaticity coordinates of the red channel.
/// </summary>
public CieXyChromaticityCoordinates R { get; }

/// <summary>
/// Gets the chomaticity coordinates of the green channel.
/// Gets the chromaticity coordinates of the green channel.
/// </summary>
public CieXyChromaticityCoordinates G { get; }

/// <summary>
/// Gets the chomaticity coordinates of the blue channel.
/// Gets the chromaticity coordinates of the blue channel.
/// </summary>
public CieXyChromaticityCoordinates B { get; }

Expand Down Expand Up @@ -88,4 +88,4 @@ public bool Equals(RgbPrimariesChromaticityCoordinates other)
/// <inheritdoc />
public override int GetHashCode() => HashCode.Combine(this.R, this.G, this.B);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SixLabors.ImageSharp
{
/// <summary>
/// The exception that is thrown when the library tries to load
/// an image which has an unkown format.
/// an image which has an unknown format.
/// </summary>
public sealed class UnknownImageFormatException : ImageFormatException
{
Expand Down
4 changes: 2 additions & 2 deletions src/ImageSharp/Formats/Gif/GifEncoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ private void EncodeGlobal<TPixel>(Image<TPixel> image, IQuantizedFrame<TPixel> q
}
else
{
using (IFrameQuantizer<TPixel> palleteFrameQuantizer =
using (IFrameQuantizer<TPixel> paletteFrameQuantizer =
new PaletteFrameQuantizer<TPixel>(this.quantizer.Diffuser, quantized.Palette))
{
using (IQuantizedFrame<TPixel> paletteQuantized = palleteFrameQuantizer.QuantizeFrame(frame))
using (IQuantizedFrame<TPixel> paletteQuantized = paletteFrameQuantizer.QuantizeFrame(frame))
{
this.WriteImageData(paletteQuantized, stream);
}
Expand Down
10 changes: 5 additions & 5 deletions src/ImageSharp/Formats/Gif/LzwEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ private void ResetCodeTable()
/// Compress the packets to the stream.
/// </summary>
/// <param name="indexedPixels">The span of indexed pixels.</param>
/// <param name="intialBits">The initial bits.</param>
/// <param name="initialBits">The initial bits.</param>
/// <param name="stream">The stream to write to.</param>
private void Compress(ReadOnlySpan<byte> indexedPixels, int intialBits, Stream stream)
private void Compress(ReadOnlySpan<byte> indexedPixels, int initialBits, Stream stream)
{
int fcode;
int c;
Expand All @@ -260,14 +260,14 @@ private void Compress(ReadOnlySpan<byte> indexedPixels, int intialBits, Stream s
int hshift;

// Set up the globals: globalInitialBits - initial number of bits
this.globalInitialBits = intialBits;
this.globalInitialBits = initialBits;

// Set up the necessary values
this.clearFlag = false;
this.bitCount = this.globalInitialBits;
this.maxCode = GetMaxcode(this.bitCount);

this.clearCode = 1 << (intialBits - 1);
this.clearCode = 1 << (initialBits - 1);
this.eofCode = this.clearCode + 1;
this.freeEntry = this.clearCode + 2;

Expand Down Expand Up @@ -450,4 +450,4 @@ public void Dispose()
this.codeTable?.Dispose();
}
}
}
}
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/IImageFormatDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IImageFormatDetector
/// Detect mimetype
/// </summary>
/// <param name="header">The <see cref="T:byte[]"/> containing the file header.</param>
/// <returns>returns the mime type of detected othersie returns null</returns>
/// <returns>returns the mime type of detected otherwise returns null</returns>
IImageFormat DetectFormat(ReadOnlySpan<byte> header);
}
}
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void CopyTo(Span<float> dest)
}

/// <summary>
/// Convert salars to byte-s and copy to dest,
/// Convert scalars to byte-s and copy to dest,
/// </summary>
/// <param name="blockPtr">Pointer to block</param>
/// <param name="dest">Destination</param>
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/IO/IFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal interface IFileSystem
Stream OpenRead(string path);

/// <summary>
/// Creates or opens a file and returns it as a writeable stream as defined by the path.
/// Creates or opens a file and returns it as a writable stream as defined by the path.
/// </summary>
/// <param name="path">Path to the file to open.</param>
/// <returns>A stream representing the file to open.</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal enum IccStandardObserver : uint
/// <summary>
/// Unknown observer
/// </summary>
Unkown = 0,
Unknown = 0,

/// <summary>
/// CIE 1931 observer
Expand Down
4 changes: 2 additions & 2 deletions src/ImageSharp/PixelFormats/PixelConversionModifiers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace SixLabors.ImageSharp.PixelFormats
{
/// <summary>
/// Flags responsible to select additional operations which could be effitiently applied in
/// Flags responsible to select additional operations which could be efficiently applied in
/// <see cref="PixelOperations{TPixel}.ToVector4(SixLabors.ImageSharp.Configuration,System.ReadOnlySpan{TPixel},System.Span{System.Numerics.Vector4},SixLabors.ImageSharp.PixelFormats.PixelConversionModifiers)"/>
/// or
/// <see cref="PixelOperations{TPixel}.FromVector4Destructive(SixLabors.ImageSharp.Configuration,System.Span{System.Numerics.Vector4},System.Span{TPixel},SixLabors.ImageSharp.PixelFormats.PixelConversionModifiers)"/>
Expand Down Expand Up @@ -37,4 +37,4 @@ internal enum PixelConversionModifiers
/// </summary>
SRgbCompand = 1 << 2,
}
}
}
4 changes: 2 additions & 2 deletions src/ImageSharp/Processing/KnownFilterMatrices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using SixLabors.ImageSharp.Primitives;

// Many of these matrices are tranlated from Chromium project where
// Many of these matrices are translated from Chromium project where
// SkScalar[] is memory-mapped to a row-major matrix.
// The following translates to our column-major form:
//
Expand Down Expand Up @@ -461,4 +461,4 @@ public static ColorMatrix CreateSepiaFilter(float amount)
};
}
}
}
}
6 changes: 3 additions & 3 deletions src/ImageSharp/Processing/KnownResamplers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ public static class KnownResamplers

/// <summary>
/// Gets the Robidoux sampler. This algorithm developed by Nicolas Robidoux providing a very good equilibrium between
/// detail preservation (sharpness) and smoothness comprable to <see cref="MitchellNetravali"/>.
/// detail preservation (sharpness) and smoothness comparable to <see cref="MitchellNetravali"/>.
/// </summary>
public static IResampler Robidoux { get; } = new RobidouxResampler();

/// <summary>
/// Gets the Robidoux Sharp sampler. A sharpend form of the <see cref="Robidoux"/> sampler
/// Gets the Robidoux Sharp sampler. A sharpened form of the <see cref="Robidoux"/> sampler
/// </summary>
public static IResampler RobidouxSharp { get; } = new RobidouxSharpResampler();

Expand All @@ -91,7 +91,7 @@ public static class KnownResamplers
public static IResampler Triangle { get; } = new TriangleResampler();

/// <summary>
/// Gets the Welch sampler. A high speed algorthm that delivers very sharpened results.
/// Gets the Welch sampler. A high speed algorithm that delivers very sharpened results.
/// </summary>
public static IResampler Welch { get; } = new WelchResampler();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public BokehBlurProcessor(int radius, int components, float gamma, BokehBlurExec
public float Gamma { get; }

/// <summary>
/// Gets the exection mode to use when applying the effect.
/// Gets the execution mode to use when applying the effect.
/// </summary>
public BokehBlurExecutionMode ExecutionMode { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ public void CalculateLookupTables(ImageFrame<TPixel> source, HistogramEqualizati
int dyOffset = dy * sourceWidth;
for (int dx = x; dx < xlimit; dx++)
{
int luminace = GetLuminance(Unsafe.Add(ref sourceBase, dyOffset + dx), luminanceLevels);
histogram[luminace]++;
int luminance = GetLuminance(Unsafe.Add(ref sourceBase, dyOffset + dx), luminanceLevels);
histogram[luminance]++;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected override void OnFrameApply(
Rectangle sourceRectangle,
Configuration configuration)
{
// Handle tranforms that result in output identical to the original.
// Handle transforms that result in output identical to the original.
if (this.TransformMatrix.Equals(default) || this.TransformMatrix.Equals(Matrix3x2.Identity))
{
// The clone will be blank here copy all the pixel data over
Expand Down Expand Up @@ -133,4 +133,4 @@ protected override void OnFrameApply(
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected override void OnFrameApply(
{
Matrix4x4 transformMatrix = this.definition.TransformMatrix;

// Handle tranforms that result in output identical to the original.
// Handle transforms that result in output identical to the original.
if (transformMatrix.Equals(default) || transformMatrix.Equals(Matrix4x4.Identity))
{
// The clone will be blank here copy all the pixel data over
Expand Down
4 changes: 2 additions & 2 deletions tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void DrawSolidPolygonCore()
}

[Benchmark(Description = "ImageSharp Fill Polygon - cached shape")]
public void DrawSolidPolygonCoreCahced()
public void DrawSolidPolygonCoreCached()
{
using (var image = new Image<Rgba32>(800, 800))
{
Expand All @@ -83,4 +83,4 @@ public void DrawSolidPolygonCoreCahced()
}
}
}
}
}
6 changes: 3 additions & 3 deletions tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public Size FillRectangleSystemDrawing()
graphics.InterpolationMode = InterpolationMode.Default;
graphics.SmoothingMode = SmoothingMode.AntiAlias;
graphics.FillRectangle(System.Drawing.Brushes.HotPink, new Rectangle(10, 10, 190, 140));

return destination.Size;
}
}

[Benchmark(Description = "ImageSharp Fill Rectangle")]
public CoreSize FillRactangleCore()
public CoreSize FillRectangleCore()
{
using (var image = new Image<Rgba32>(800, 800))
{
Expand All @@ -57,4 +57,4 @@ public CoreSize FillPolygonCore()
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System;
Expand Down Expand Up @@ -55,9 +56,9 @@ public void WhenMemoryIsConsumed<TPixel>(TestImageProvider<TPixel> provider)
var targetBuffer = new TPixel[image0.Width * image0.Height];
image0.GetPixelSpan().CopyTo(targetBuffer);

var managerOfExeternalMemory = new TestMemoryManager<TPixel>(targetBuffer);
var managerOfExternalMemory = new TestMemoryManager<TPixel>(targetBuffer);

Memory<TPixel> externalMemory = managerOfExeternalMemory.Memory;
Memory<TPixel> externalMemory = managerOfExternalMemory.Memory;

using (var image1 = Image.WrapMemory(externalMemory, image0.Width, image0.Height))
{
Expand Down
Loading