# GraphicsFormatUtility

> This utility class contains helper functions that enable you to query properties of a TextureFormat, RenderTextureFormat, or GraphicsFormat. This class also includes format conversion and size calculation functions.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.Experimental.Rendering](/engine/6000.7/script-reference/unityengine/experimental/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public class GraphicsFormatUtility
```

## Static Methods

| Method                                                                                                                                       | Description                                                                                                                                                                                                                                                                                                                                                                         |
| -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ComputeMipChainSize](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/computemipchainsize.md)       | Computes the memory size in bytes for a chain of mipmaps.                                                                                                                                                                                                                                                                                                                           |
| [ComputeMipmapSize](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/computemipmapsize.md)           | Computes the memory size in bytes for a single mipmap.                                                                                                                                                                                                                                                                                                                              |
| [ConvertToAlphaFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/converttoalphaformat.md)     | Input a GraphicsFormat to return an equivalent GraphicsFormat that includes an alpha component.                                                                                                                                                                                                                                                                                     |
| [GetAlphaComponentCount](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getalphacomponentcount.md) | Returns the number of alpha components of the format.                                                                                                                                                                                                                                                                                                                               |
| [GetBlockHeight](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getblockheight.md)                 | Returns the height in texels of a texel block.                                                                                                                                                                                                                                                                                                                                      |
| [GetBlockSize](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getblocksize.md)                     | Returns the memory size in bytes of a texel block.                                                                                                                                                                                                                                                                                                                                  |
| [GetBlockWidth](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getblockwidth.md)                   | Returns the width in texels of a texel block.                                                                                                                                                                                                                                                                                                                                       |
| [GetColorComponentCount](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getcolorcomponentcount.md) | Returns the number of color components of the format.                                                                                                                                                                                                                                                                                                                               |
| [GetComponentCount](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getcomponentcount.md)           | Returns the number of components this format has.                                                                                                                                                                                                                                                                                                                                   |
| [GetDepthBits](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getdepthbits.md)                     | Returns the number of bits per pixel this format contains for depth.                                                                                                                                                                                                                                                                                                                |
| [GetDepthStencilFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getdepthstencilformat.md)   | Returns a supported depth stencil format that has 'depthBits' of bits for the depth component if a compatible format exists on the current platform.                                                                                                                                                                                                                                |
| [GetFormatString](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getformatstring.md)               | Returns a string that represents a format enum value.                                                                                                                                                                                                                                                                                                                               |
| [GetGraphicsFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getgraphicsformat.md)           | Translates RenderTextureFormat or TextureFormat into GraphicsFormat.                                                                                                                                                                                                                                                                                                                |
| [GetLinearFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getlinearformat.md)               | Returns the equivalent linear format of a GraphicsFormat. For example, this function returns kFormatR8G8B8A8\_UNorm if the input is kFormatR8G8B8A8\_SRGB. If the input GraphicsFormat is already linear, this function returns the input GraphicsFormat.                                                                                                                           |
| [GetRenderTextureFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getrendertextureformat.md) | Translates GraphicsFormat into RenderTextureFormat.                                                                                                                                                                                                                                                                                                                                 |
| [GetSRGBFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getsrgbformat.md)                   | Returns the equivalent sRGB format of a GraphicsFormat. For example, this function returns kFormatR8G8B8A8\_SRGB if the input is kFormatR8G8B8A8\_UNorm. If the input GraphicsFormat is already sRGB, this function returns the input GraphicsFormat. If there is no equivalent sRGB format, this function returns the input GraphicsFormat.                                        |
| [GetSwizzleA](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getswizzlea.md)                       | Returns a FormatSwizzle enum that is mapped to the alpha channel for a given format.                                                                                                                                                                                                                                                                                                |
| [GetSwizzleB](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getswizzleb.md)                       | Returns a FormatSwizzle enum that is mapped to the blue channel for a given format.                                                                                                                                                                                                                                                                                                 |
| [GetSwizzleG](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getswizzleg.md)                       | Returns a FormatSwizzle enum that is mapped to the green channel for a given format.                                                                                                                                                                                                                                                                                                |
| [GetSwizzleR](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/getswizzler.md)                       | Returns FormatSwizzle enum of which channel is mapped to the R channel for a given format.                                                                                                                                                                                                                                                                                          |
| [GetTextureFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/gettextureformat.md)             | Translates GraphicsFormat into TextureFormat.                                                                                                                                                                                                                                                                                                                                       |
| [HasAlphaChannel](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/hasalphachannel.md)               | Returns true if the format has an alpha component. Returns false otherwise.                                                                                                                                                                                                                                                                                                         |
| [Is16BitPackedFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/is16bitpackedformat.md)       | Returns true if the format is packed and a 16-bit format. Returns false otherwise.                                                                                                                                                                                                                                                                                                  |
| [IsAlphaOnlyFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isalphaonlyformat.md)           | Returns true if the format only has an alpha component. Returns false otherwise.                                                                                                                                                                                                                                                                                                    |
| [IsAlphaTestFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isalphatestformat.md)           | Returns true if the format has an alpha component with only 1 or 2 bits. Returns false otherwise.                                                                                                                                                                                                                                                                                   |
| [IsASTCFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isastcformat.md)                     | Returns true if the format uses ASTC. Returns false otherwise.                                                                                                                                                                                                                                                                                                                      |
| [IsBCFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isbcformat.md)                         | Returns true if the format is a DXTC, RGTC or BPTC format. Returns false otherwise.                                                                                                                                                                                                                                                                                                 |
| [IsBPTCFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isbptcformat.md)                     | Returns true if the format uses BPTC. Returns false otherwise.                                                                                                                                                                                                                                                                                                                      |
| [IsCompressedFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/iscompressedformat.md)         | Returns true if the format is compressed. Returns false otherwise.                                                                                                                                                                                                                                                                                                                  |
| [IsCrunchFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/iscrunchformat.md)                 | Returns true if the format data is compressed with Crunch. Returns false otherwise.                                                                                                                                                                                                                                                                                                 |
| [IsDepthFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isdepthformat.md)                   | Returns true if the format is a depth format. Returns false otherwise.                                                                                                                                                                                                                                                                                                              |
| [IsDepthStencilFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isdepthstencilformat.md)     | Returns true if the format is a depth or stencil format. Returns false otherwise.                                                                                                                                                                                                                                                                                                   |
| [IsDXTCFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isdxtcformat.md)                     | Returns true if the format uses DXTC. Returns false otherwise.                                                                                                                                                                                                                                                                                                                      |
| [IsEACFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/iseacformat.md)                       | Returns true if the format uses EAC. Returns false otherwise.                                                                                                                                                                                                                                                                                                                       |
| [IsETCFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isetcformat.md)                       | Returns true if the format uses ETC and ETC2. Returns false otherwise.                                                                                                                                                                                                                                                                                                              |
| [IsFloatFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isfloatformat.md)                   | Returns true if the format is a single precision floating point format. Returns false otherwise.                                                                                                                                                                                                                                                                                    |
| [IsHalfFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/ishalfformat.md)                     | Returns true if the format is a half precision floating point format. Returns false otherwise.                                                                                                                                                                                                                                                                                      |
| [IsHDRFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/ishdrformat.md)                       | Returns true if the format is capable of representing HDR data. Returns false otherwise.                                                                                                                                                                                                                                                                                            |
| [IsIEEE754Format](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isieee754format.md)               | Returns true if the format is a floating point format. Returns false otherwise.                                                                                                                                                                                                                                                                                                     |
| [IsIntegerFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isintegerformat.md)               | Returns true if the format is an integer format. Returns false otherwise.                                                                                                                                                                                                                                                                                                           |
| [IsNormFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isnormformat.md)                     | Returns true if the format is a normalized format. Returns false otherwise.                                                                                                                                                                                                                                                                                                         |
| [IsPackedFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/ispackedformat.md)                 | Returns true if the format is packed. Returns false otherwise.                                                                                                                                                                                                                                                                                                                      |
| [IsRGTCFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isrgtcformat.md)                     | Returns true if the format uses RGTC. Returns false otherwise.                                                                                                                                                                                                                                                                                                                      |
| [IsSignedFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/issignedformat.md)                 | Returns true if the format is a signed format. Returns false otherwise.                                                                                                                                                                                                                                                                                                             |
| [IsSIntFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/issintformat.md)                     | Returns true if the format is a signed and integer format. Returns false otherwise.                                                                                                                                                                                                                                                                                                 |
| [IsSNormFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/issnormformat.md)                   | Returns true if the format is a signed normalized format. Returns false otherwise.                                                                                                                                                                                                                                                                                                  |
| [IsSRGBFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/issrgbformat.md)                     | Returns true if the format performs sRGB to linear on read and linear to sRGB on write. Returns false otherwise.                                                                                                                                                                                                                                                                    |
| [IsStencilFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isstencilformat.md)               | Returns true if the format is a stencil format. Returns false otherwise.                                                                                                                                                                                                                                                                                                            |
| [IsSwizzleFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isswizzleformat.md)               | Returns true if the format is not a RGBA format. Returns false otherwise.                                                                                                                                                                                                                                                                                                           |
| [IsUIntFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isuintformat.md)                     | Returns true if the format is an unsigned and integer format. Returns false otherwise.                                                                                                                                                                                                                                                                                              |
| [IsUNormFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isunormformat.md)                   | Returns true if the format is an unsigned normalized format. Returns false otherwise.                                                                                                                                                                                                                                                                                               |
| [IsUnsignedFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isunsignedformat.md)             | Returns true if the format is an unsigned format. Returns false otherwise.                                                                                                                                                                                                                                                                                                          |
| [IsXRFormat](/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformatutility/isxrformat.md)                         | Returns true if the format is an extended range format. With extended range format, the blue, green, and red components are linearly encoded, and their values range from -0.752941 to 1.25098. The alpha component is always clamped to a \[0.0, 1.0] range in sampling, rendering, and writing operations, despite supporting values outside this range. Returns false otherwise. |
