Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit a1ad26a

Browse files
author
AndrewSt
committed
[DXGI] FormatHelper public static method's convert to extensons
1 parent 6b09ebb commit a1ad26a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

Source/SharpDX.DXGI/FormatHelper.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static class FormatHelper
3737
/// </summary>
3838
/// <param name="format">The DXGI format.</param>
3939
/// <returns>size of in bytes</returns>
40-
public static int SizeOfInBytes(Format format)
40+
public static int SizeOfInBytes(this Format format)
4141
{
4242
var sizeInBits = SizeOfInBits(format);
4343
return sizeInBits >> 3;
@@ -48,7 +48,7 @@ public static int SizeOfInBytes(Format format)
4848
/// </summary>
4949
/// <param name="format">The DXGI format.</param>
5050
/// <returns>size of in bits</returns>
51-
public static int SizeOfInBits(Format format)
51+
public static int SizeOfInBits(this Format format)
5252
{
5353
return sizeOfInBits[(int) format];
5454
}
@@ -58,39 +58,39 @@ public static int SizeOfInBits(Format format)
5858
/// </summary>
5959
/// <param name="format">A format to validate</param>
6060
/// <returns>True if the <see cref="Format"/> is valid.</returns>
61-
public static bool IsValid( Format format )
61+
public static bool IsValid(this Format format)
6262
{
6363
return ( (int)(format) >= 1 && (int)(format) <= 115 );
6464
}
6565

6666
/// <summary>
6767
/// Returns true if the <see cref="Format"/> is a compressed format.
6868
/// </summary>
69-
/// <param name="fmt">The format to check for compressed.</param>
69+
/// <param name="format">The format to check for compressed.</param>
7070
/// <returns>True if the <see cref="Format"/> is a compressed format</returns>
71-
public static bool IsCompressed(Format fmt)
71+
public static bool IsCompressed(this Format format)
7272
{
73-
return compressedFormats[(int) fmt];
73+
return compressedFormats[(int) format];
7474
}
7575

7676
/// <summary>
7777
/// Determines whether the specified <see cref="Format"/> is packed.
7878
/// </summary>
79-
/// <param name="fmt">The DXGI Format.</param>
79+
/// <param name="format">The DXGI Format.</param>
8080
/// <returns><c>true</c> if the specified <see cref="Format"/> is packed; otherwise, <c>false</c>.</returns>
81-
public static bool IsPacked( Format fmt )
81+
public static bool IsPacked(this Format format )
8282
{
83-
return ((fmt == Format.R8G8_B8G8_UNorm) || (fmt == Format.G8R8_G8B8_UNorm));
83+
return ((format == Format.R8G8_B8G8_UNorm) || (format == Format.G8R8_G8B8_UNorm));
8484
}
8585

8686
/// <summary>
8787
/// Determines whether the specified <see cref="Format"/> is video.
8888
/// </summary>
89-
/// <param name="fmt">The <see cref="Format"/>.</param>
89+
/// <param name="format">The <see cref="Format"/>.</param>
9090
/// <returns><c>true</c> if the specified <see cref="Format"/> is video; otherwise, <c>false</c>.</returns>
91-
public static bool IsVideo( Format fmt )
91+
public static bool IsVideo(this Format format )
9292
{
93-
switch ( fmt )
93+
switch ( format )
9494
{
9595
case Format.AYUV:
9696
case Format.Y410:
@@ -121,32 +121,32 @@ public static bool IsVideo( Format fmt )
121121
/// <summary>
122122
/// Determines whether the specified <see cref="Format"/> is a SRGB format.
123123
/// </summary>
124-
/// <param name="fmt">The <see cref="Format"/>.</param>
124+
/// <param name="format">The <see cref="Format"/>.</param>
125125
/// <returns><c>true</c> if the specified <see cref="Format"/> is a SRGB format; otherwise, <c>false</c>.</returns>
126-
public static bool IsSRgb( Format fmt )
126+
public static bool IsSRgb(this Format format )
127127
{
128-
return srgbFormats[(int) fmt];
128+
return srgbFormats[(int) format];
129129
}
130130

131131
/// <summary>
132132
/// Determines whether the specified <see cref="Format"/> is typeless.
133133
/// </summary>
134-
/// <param name="fmt">The <see cref="Format"/>.</param>
134+
/// <param name="format">The <see cref="Format"/>.</param>
135135
/// <returns><c>true</c> if the specified <see cref="Format"/> is typeless; otherwise, <c>false</c>.</returns>
136-
public static bool IsTypeless( Format fmt )
136+
public static bool IsTypeless(this Format format )
137137
{
138-
return typelessFormats[(int) fmt];
138+
return typelessFormats[(int) format];
139139
}
140140

141141
/// <summary>
142142
/// Computes the scanline count (number of scanlines).
143143
/// </summary>
144-
/// <param name="fmt">The <see cref="Format"/>.</param>
144+
/// <param name="format">The <see cref="Format"/>.</param>
145145
/// <param name="height">The height.</param>
146146
/// <returns>The scanline count.</returns>
147-
public static int ComputeScanlineCount(Format fmt, int height)
147+
public static int ComputeScanlineCount(this Format format, int height)
148148
{
149-
switch (fmt)
149+
switch (format)
150150
{
151151
case Format.BC1_Typeless:
152152
case Format.BC1_UNorm:

0 commit comments

Comments
 (0)