Skip to main content

IMG_CreateAnimationDecoderWithProperties

Function IMG_CreateAnimationDecoderWithProperties 

Source
pub unsafe extern "C" fn IMG_CreateAnimationDecoderWithProperties(
    props: SDL_PropertiesID,
) -> *mut IMG_AnimationDecoder
Expand description

Create an animation decoder with the specified properties.

These animation types are currently supported:

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

These are the supported properties:

  • IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING: the file to load, if an SDL_IOStream isn’t being used. This is required if IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_POINTER isn’t set.
  • IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_POINTER: an SDL_IOStream containing a series of images. This should not be closed until the animation decoder is closed. This is required if IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING isn’t set.
  • IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN: true if closing the animation decoder should also close the associated SDL_IOStream.
  • IMG_PROP_ANIMATION_DECODER_CREATE_TYPE_STRING: the input file type, e.g. “webp”, defaults to the file extension if IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING is set.

Parameter: props the properties of the animation decoder.

Returns: a new IMG_AnimationDecoder, or NULL on failure; call SDL_GetError() for more information.

Available Since: This function is available since SDL_image 3.4.0.

See Also: IMG_CreateAnimationDecoder

See Also: IMG_CreateAnimationDecoder_IO

See Also: IMG_GetAnimationDecoderFrame

See Also: IMG_ResetAnimationDecoder

See Also: IMG_CloseAnimationDecoder