createIo static method

Pointer<ImgAnimationDecoder> createIo(
  1. Pointer<SdlIoStream> src,
  2. String type, {
  3. bool closeio = false,
})

Create a decoder to read a series of images from an IOStream.

These animation types are currently supported:

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

If closeio is true, src will be closed before returning if this function fails, or when the animation decoder is closed if this function succeeds.

\param src an SDL_IOStream containing a series of images. \param closeio true to close the SDL_IOStream when done, false to leave it open. \param type a filename extension that represent this data ("WEBP", etc). \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_CreateAnimationDecoderWithProperties \sa IMG_GetAnimationDecoderFrame \sa IMG_ResetAnimationDecoder \sa IMG_CloseAnimationDecoder

extern SDL_DECLSPEC IMG_AnimationDecoder * SDLCALL IMG_CreateAnimationDecoder_IO(SDL_IOStream *src, bool closeio, const char *type)

Implementation

static Pointer<ImgAnimationDecoder> createIo(
  Pointer<SdlIoStream> src,
  String type, {
  bool closeio = false,
}) => imgCreateAnimationDecoderIo(src, closeio, type);