From a1ad26a77bc9af3220bd2764559729fb5b06ee02 Mon Sep 17 00:00:00 2001 From: AndrewSt Date: Mon, 6 Jun 2016 11:56:16 +0300 Subject: [PATCH] [DXGI] FormatHelper public static method's convert to extensons --- Source/SharpDX.DXGI/FormatHelper.cs | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Source/SharpDX.DXGI/FormatHelper.cs b/Source/SharpDX.DXGI/FormatHelper.cs index bf1e1b6de..8d74547b6 100644 --- a/Source/SharpDX.DXGI/FormatHelper.cs +++ b/Source/SharpDX.DXGI/FormatHelper.cs @@ -37,7 +37,7 @@ public static class FormatHelper /// /// The DXGI format. /// size of in bytes - public static int SizeOfInBytes(Format format) + public static int SizeOfInBytes(this Format format) { var sizeInBits = SizeOfInBits(format); return sizeInBits >> 3; @@ -48,7 +48,7 @@ public static int SizeOfInBytes(Format format) /// /// The DXGI format. /// size of in bits - public static int SizeOfInBits(Format format) + public static int SizeOfInBits(this Format format) { return sizeOfInBits[(int) format]; } @@ -58,7 +58,7 @@ public static int SizeOfInBits(Format format) /// /// A format to validate /// True if the is valid. - public static bool IsValid( Format format ) + public static bool IsValid(this Format format) { return ( (int)(format) >= 1 && (int)(format) <= 115 ); } @@ -66,31 +66,31 @@ public static bool IsValid( Format format ) /// /// Returns true if the is a compressed format. /// - /// The format to check for compressed. + /// The format to check for compressed. /// True if the is a compressed format - public static bool IsCompressed(Format fmt) + public static bool IsCompressed(this Format format) { - return compressedFormats[(int) fmt]; + return compressedFormats[(int) format]; } /// /// Determines whether the specified is packed. /// - /// The DXGI Format. + /// The DXGI Format. /// true if the specified is packed; otherwise, false. - public static bool IsPacked( Format fmt ) + public static bool IsPacked(this Format format ) { - return ((fmt == Format.R8G8_B8G8_UNorm) || (fmt == Format.G8R8_G8B8_UNorm)); + return ((format == Format.R8G8_B8G8_UNorm) || (format == Format.G8R8_G8B8_UNorm)); } /// /// Determines whether the specified is video. /// - /// The . + /// The . /// true if the specified is video; otherwise, false. - public static bool IsVideo( Format fmt ) + public static bool IsVideo(this Format format ) { - switch ( fmt ) + switch ( format ) { case Format.AYUV: case Format.Y410: @@ -121,32 +121,32 @@ public static bool IsVideo( Format fmt ) /// /// Determines whether the specified is a SRGB format. /// - /// The . + /// The . /// true if the specified is a SRGB format; otherwise, false. - public static bool IsSRgb( Format fmt ) + public static bool IsSRgb(this Format format ) { - return srgbFormats[(int) fmt]; + return srgbFormats[(int) format]; } /// /// Determines whether the specified is typeless. /// - /// The . + /// The . /// true if the specified is typeless; otherwise, false. - public static bool IsTypeless( Format fmt ) + public static bool IsTypeless(this Format format ) { - return typelessFormats[(int) fmt]; + return typelessFormats[(int) format]; } /// /// Computes the scanline count (number of scanlines). /// - /// The . + /// The . /// The height. /// The scanline count. - public static int ComputeScanlineCount(Format fmt, int height) + public static int ComputeScanlineCount(this Format format, int height) { - switch (fmt) + switch (format) { case Format.BC1_Typeless: case Format.BC1_UNorm: