Returns both the row and slice pitch for a given width, height, and DXGI format. It supports a number of flags for overriding the default byte-alignment usually used by DDS files and Direct3D 11 resources.

void ComputePitch( _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height,
   _Out_ size_t& rowPitch, _Out_ size_t& slicePitch,
   _In_ DWORD flags = CP_FLAGS_NONE );

Parameters

The rowPitch is the number of bytes in a scanline of pixels in the image. A standard pitch is 'byte' aligned and therefore it is equal to bytes-per-pixel * width-of-image. For block-compressed (BC) formats, this is the number of bytes in a row of blocks (which covers up to 4 scanlines at once). The rowPitch can be larger than the number of valid pixels in the image due to alignment padding.

For volume (3D) textures, slicePitch is the number of bytes in each depth slice. For 1D and 2D images, this is simply the total size of the image including any alignment padding.

A non-standard pitch can computed by the use of the flags parameter:
These flags only effect standard color formats. They have no effect on BC, packed, or planar format.