imgCreateAnimationDecoderWithProperties function image

Pointer<ImgAnimationDecoder> imgCreateAnimationDecoderWithProperties(
  1. int props
)

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.

\param props the properties of the animation decoder. \returns a new IMG_AnimationDecoder, or NULL on failure; call SDL_GetError() for more information.

\since This function is available since SDL_image 3.4.0.

\sa IMG_CreateAnimationDecoder \sa IMG_CreateAnimationDecoder_IO \sa IMG_GetAnimationDecoderFrame \sa IMG_ResetAnimationDecoder \sa IMG_CloseAnimationDecoder

extern SDL_DECLSPEC IMG_AnimationDecoder * SDLCALL IMG_CreateAnimationDecoderWithProperties(SDL_PropertiesID props)

Implementation

Pointer<ImgAnimationDecoder> imgCreateAnimationDecoderWithProperties(
  int props,
) {
  final imgCreateAnimationDecoderWithPropertiesLookupFunction = _libImage
      .lookupFunction<
        Pointer<ImgAnimationDecoder> Function(Uint32 props),
        Pointer<ImgAnimationDecoder> Function(int props)
      >('IMG_CreateAnimationDecoderWithProperties');
  return imgCreateAnimationDecoderWithPropertiesLookupFunction(props);
}