Function SDL_PremultiplyAlpha

pub unsafe extern "C" fn SDL_PremultiplyAlpha(
    width: i32,
    height: i32,
    src_format: u32,
    src: *const c_void,
    src_pitch: i32,
    dst_format: u32,
    dst: *mut c_void,
    dst_pitch: i32,
) -> i32
Available on crate feature dep_sdl2 only.
Expand description

Premultiply the alpha on a block of pixels.

This is safe to use with src == dst, but not for other overlapping areas.

This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.

\param width the width of the block to convert, in pixels \param height the height of the block to convert, in pixels \param src_format an SDL_PixelFormatEnum value of the src pixels format \param src a pointer to the source pixels \param src_pitch the pitch of the source pixels, in bytes \param dst_format an SDL_PixelFormatEnum value of the dst pixels format \param dst a pointer to be filled in with premultiplied pixel data \param dst_pitch the pitch of the destination pixels, in bytes \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.18.