diff --git a/src/ImageSharp/Image/IImageProcessor.cs b/src/ImageSharp/Image/IImageProcessor.cs index c06868eafb..ab8295fabf 100644 --- a/src/ImageSharp/Image/IImageProcessor.cs +++ b/src/ImageSharp/Image/IImageProcessor.cs @@ -13,12 +13,6 @@ namespace SixLabors.ImageSharp.Processing public interface IImageProcessor where TPixel : struct, IPixel { - /// - /// Gets or sets a value indicating whether to compress - /// or expand individual pixel colors the value on processing. - /// - bool Compand { get; set; } - /// /// Applies the process to the specified portion of the specified . /// diff --git a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs index 258b98bb23..a1fa3c9cba 100644 --- a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs @@ -15,9 +15,6 @@ namespace SixLabors.ImageSharp.Processing internal abstract class CloningImageProcessor : ICloningImageProcessor where TPixel : struct, IPixel { - /// - public virtual bool Compand { get; set; } = false; - /// public Image CloneAndApply(Image source, Rectangle sourceRectangle) { diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs index d8b6ab9514..9f81273433 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs index 1366a8fe1b..91e5c7f68f 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .618F, M12 = .163F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs index d1925e04df..0d6578852c 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .299F, M12 = .299F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs index 964921d262..c4bb41ceb3 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.8F, M12 = 0.258F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs index f35d25a287..598af12ff0 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.625F, M12 = 0.7F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs index 4c43ad0e21..4e32cb5298 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.817F, M12 = 0.333F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs index 3a18ed91e2..d49b4a2cc0 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.567F, M12 = 0.558F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs index 0c337af2d0..d34f22343c 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.967F, M21 = 0.33F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs index 76c9f98e74..453ac99a72 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.95F, M21 = 0.05F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs index 619127ea70..e93305cca1 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs @@ -13,14 +13,14 @@ namespace SixLabors.ImageSharp.Processing.Processors /// The color matrix filter. Inherit from this class to perform operation involving color matrices. /// /// The pixel format. - internal abstract class ColorMatrixProcessor : ImageProcessor, IColorMatrixFilter + internal abstract class ColorMatrixProcessor : ImageProcessor, IColorMatrixProcessor where TPixel : struct, IPixel { /// public abstract Matrix4x4 Matrix { get; } /// - public override bool Compand { get; set; } = true; + public virtual bool Compand { get; set; } = true; /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) @@ -50,31 +50,28 @@ namespace SixLabors.ImageSharp.Processing.Processors Matrix4x4 matrix = this.Matrix; bool compand = this.Compand; - using (PixelAccessor sourcePixels = source.Lock()) - { - Parallel.For( - minY, - maxY, - source.Configuration.ParallelOptions, - y => - { - Span row = source.GetRowSpan(y - startY); + Parallel.For( + minY, + maxY, + source.Configuration.ParallelOptions, + y => + { + Span row = source.GetRowSpan(y - startY); - for (int x = minX; x < maxX; x++) - { - ref TPixel pixel = ref row[x - startX]; - var vector = pixel.ToVector4(); + for (int x = minX; x < maxX; x++) + { + ref TPixel pixel = ref row[x - startX]; + var vector = pixel.ToVector4(); - if (compand) - { - vector = vector.Expand(); - } + if (compand) + { + vector = vector.Expand(); + } - vector = Vector4.Transform(vector, matrix); - pixel.PackFromVector4(compand ? vector.Compress() : vector); - } - }); - } + vector = Vector4.Transform(vector, matrix); + pixel.PackFromVector4(compand ? vector.Compress() : vector); + } + }); } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs index a7033cfc95..35dfe41a82 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -16,7 +15,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .299F, M12 = .299F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs index db7077620a..6bb460ee67 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -16,7 +15,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .2126F, M12 = .2126F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs index a222f195e9..9a40bfca89 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -46,7 +45,7 @@ namespace SixLabors.ImageSharp.Processing.Processors // The matrix is set up to preserve the luminance of the image. // See http://graficaobscura.com/matrix/index.html // Number are taken from https://msdn.microsoft.com/en-us/library/jj192162(v=vs.85).aspx - Matrix4x4 matrix4X4 = new Matrix4x4() + var matrix4X4 = new Matrix4x4 { M11 = lumR + (cosradians * oneMinusLumR) - (sinradians * lumR), M12 = lumR - (cosradians * lumR) - (sinradians * 0.143F), diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixProcessor.cs similarity index 70% rename from src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs rename to src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixProcessor.cs index d7785045fb..84e7461b56 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -12,12 +11,17 @@ namespace SixLabors.ImageSharp.Processing.Processors /// alter the image pixels. /// /// The pixel format. - internal interface IColorMatrixFilter : IImageProcessor + internal interface IColorMatrixProcessor : IImageProcessor where TPixel : struct, IPixel { /// /// Gets the used to alter the image. /// Matrix4x4 Matrix { get; } + + /// + /// Gets or sets a value indicating whether to compress or expand individual pixel color values on processing. + /// + bool Compand { get; set; } } } diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs index e2ab32a70a..4277e1fc2e 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.6997023F, M22 = 0.4609577F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs index 7ce96fa355..dcb5955c00 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; @@ -16,7 +15,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { private static readonly TPixel VeryDarkGreen = ColorBuilder.FromRGBA(0, 10, 0, 255); - private GraphicsOptions options; + private readonly GraphicsOptions options; /// /// Initializes a new instance of the class. @@ -28,7 +27,7 @@ namespace SixLabors.ImageSharp.Processing.Processors } /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 1.5F, M22 = 1.45F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs index 96fb084cfd..928a641a00 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; @@ -15,9 +14,9 @@ namespace SixLabors.ImageSharp.Processing.Processors internal class PolaroidProcessor : ColorMatrixProcessor where TPixel : struct, IPixel { - private static TPixel veryDarkOrange = ColorBuilder.FromRGB(102, 34, 0); - private static TPixel lightOrange = ColorBuilder.FromRGBA(255, 153, 102, 178); - private GraphicsOptions options; + private static readonly TPixel VeryDarkOrange = ColorBuilder.FromRGB(102, 34, 0); + private static readonly TPixel LightOrange = ColorBuilder.FromRGBA(255, 153, 102, 178); + private readonly GraphicsOptions options; /// /// Initializes a new instance of the class. @@ -29,7 +28,7 @@ namespace SixLabors.ImageSharp.Processing.Processors } /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 1.538F, M12 = -0.062F, @@ -49,8 +48,8 @@ namespace SixLabors.ImageSharp.Processing.Processors /// protected override void AfterApply(ImageBase source, Rectangle sourceRectangle) { - new VignetteProcessor(veryDarkOrange, this.options).Apply(source, sourceRectangle); - new GlowProcessor(lightOrange, source.Width / 4F, this.options).Apply(source, sourceRectangle); + new VignetteProcessor(VeryDarkOrange, this.options).Apply(source, sourceRectangle); + new GlowProcessor(LightOrange, source.Width / 4F, this.options).Apply(source, sourceRectangle); } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs index 38788d9f9e..1f01bc85dc 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -39,7 +38,7 @@ namespace SixLabors.ImageSharp.Processing.Processors float saturationComplementG = 0.6094f * saturationComplement; float saturationComplementB = 0.0820f * saturationComplement; - Matrix4x4 matrix4X4 = new Matrix4x4 + var matrix4X4 = new Matrix4x4 { M11 = saturationComplementR + saturationFactor, M12 = saturationComplementR, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs index 610b3d5f1c..d959ebf521 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Processing/Processors/ImageProcessor.cs b/src/ImageSharp/Processing/Processors/ImageProcessor.cs index 9b8b4010e8..1a4d52d3ed 100644 --- a/src/ImageSharp/Processing/Processors/ImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ImageProcessor.cs @@ -15,9 +15,6 @@ namespace SixLabors.ImageSharp.Processing internal abstract class ImageProcessor : IImageProcessor where TPixel : struct, IPixel { - /// - public virtual bool Compand { get; set; } = false; - /// public void Apply(Image source, Rectangle sourceRectangle) { diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index bfd86567b5..4560da6e75 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -42,6 +42,11 @@ namespace SixLabors.ImageSharp.Processing.Processors { } + /// + /// Gets or sets a value indicating whether to compress or expand individual pixel color values on processing. + /// + public bool Compand { get; set; } + /// protected override Image CreateDestination(Image source, Rectangle sourceRectangle) {