Function SDL_PremultiplySurfaceAlpha

pub unsafe extern "C" fn SDL_PremultiplySurfaceAlpha(
    surface: *mut SDL_Surface,
    linear: bool,
) -> bool
Available on crate feature dep_sdl3 only.
Expand description

Premultiply the alpha in a surface.

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

§Parameters

  • surface: the surface to modify.
  • linear: true to convert from sRGB to linear space for the alpha multiplication, false to do multiplication in sRGB space.

§Return value

Returns true on success or false on failure; call SDL_GetError() for more information.

§Availability

This function is available since SDL 3.2.0.