Converts an image assuming the original is not using premultiplied alpha into a premultiplied alpha version of the same image.
HRESULT PremultiplyAlpha(
const Image *srcImages,
size_t nimages,
const TexMetadata &metadata,
ScratchImage &result
)
srcImages
Type: Image *
[in] Pointer to one or more Image structures in a memory buffer.
nimages
Type: size_t
[in] The number of images.
metadata
Type: TexMetadata
[in] Address of a TexMetadata structure.
result
Type: ScratchImage
[out] Pointer to a ScratchImage class instance.
Type: HRESULT
This function does not operate directly on block compressed images. See Decompress and Compress.
This function is most useful for working with rendering that relies on premultiplied alpha blending (see DirectXTK).
CodePlex shows an example and blog links.
Header: Declared in directxtex.h.