From 80fecd1f58e59dd2f5ac774f19c71c6a0e231d4b Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 13 Jul 2016 21:41:39 +1000 Subject: [PATCH] Use default(T) Former-commit-id: b6028bf2565e2e25395e0658332e351df870277b Former-commit-id: cfdbc86934bc83757056a87600580cbd81743b53 Former-commit-id: ac78e9ca21eccb3830d5ba12ca573a9f54aae995 --- src/ImageProcessorCore/Formats/Bmp/BmpDecoderCore.cs | 8 ++++---- src/ImageProcessorCore/ImageProcessor.cs | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ImageProcessorCore/Formats/Bmp/BmpDecoderCore.cs b/src/ImageProcessorCore/Formats/Bmp/BmpDecoderCore.cs index 391654f219..03bbe6396d 100644 --- a/src/ImageProcessorCore/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageProcessorCore/Formats/Bmp/BmpDecoderCore.cs @@ -239,7 +239,7 @@ namespace ImageProcessorCore.Formats int arrayOffset = (row * width) + (colOffset + shift); // Stored in b-> g-> r-> a order. - T packed = new T(); + T packed = default(T); packed.PackBytes(colors[colorIndex], colors[colorIndex + 1], colors[colorIndex + 2], 255); imageData[arrayOffset] = packed; } @@ -289,7 +289,7 @@ namespace ImageProcessorCore.Formats int arrayOffset = ((row * width) + x); // Stored in b-> g-> r-> a order. - T packed = new T(); + T packed = default(T); packed.PackBytes(b, g, r, 255); imageData[arrayOffset] = packed; } @@ -328,7 +328,7 @@ namespace ImageProcessorCore.Formats // We divide by 255 as we will store the colors in our floating point format. // Stored in b-> g-> r-> a order. - T packed = new T(); + T packed = default(T); packed.PackBytes(data[offset], data[offset + 1], data[offset + 2], 255); imageData[arrayOffset] = packed; } @@ -366,7 +366,7 @@ namespace ImageProcessorCore.Formats int arrayOffset = ((row * width) + x); // Stored in b-> g-> r-> a order. - T packed = new T(); + T packed = default(T); packed.PackBytes(data[offset], data[offset + 1], data[offset + 2], data[offset + 3]); imageData[arrayOffset] = packed; } diff --git a/src/ImageProcessorCore/ImageProcessor.cs b/src/ImageProcessorCore/ImageProcessor.cs index 7569435c0b..84c5647c4c 100644 --- a/src/ImageProcessorCore/ImageProcessor.cs +++ b/src/ImageProcessorCore/ImageProcessor.cs @@ -88,6 +88,8 @@ namespace ImageProcessorCore.Processors /// /// This method is called before the process is applied to prepare the processor. /// + /// The pixel format. + /// The packed format. long, float. /// Target image to apply the process to. /// The source image. Cannot be null. /// @@ -104,10 +106,11 @@ namespace ImageProcessorCore.Processors } /// - /// Applies the process to the specified portion of the specified at the specified location + /// Applies the process to the specified portion of the specified at the specified location /// and with the specified size. /// - /// The type of pixels contained within the image. + /// The pixel format. + /// The packed format. long, float. /// Target image to apply the process to. /// The source image. Cannot be null. /// @@ -130,7 +133,8 @@ namespace ImageProcessorCore.Processors /// /// This method is called after the process is applied to prepare the processor. /// - /// The type of pixels contained within the image. + /// The pixel format. + /// The packed format. long, float. /// Target image to apply the process to. /// The source image. Cannot be null. ///