SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
SDL::AnimationDecoder Class Reference

An object representing animation decoder. More...

Inheritance diagram for SDL::AnimationDecoder:
Inheritance graph
[legend]

Public Member Functions

constexpr AnimationDecoder (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr AnimationDecoder (const AnimationDecoderRaw resource) noexcept
 Constructs from AnimationDecoderParam. More...
 
constexpr AnimationDecoder (AnimationDecoder &&other) noexcept
 Move constructor.
 
constexpr AnimationDecoder (const AnimationDecoderRef &other)=delete
 
constexpr AnimationDecoder (AnimationDecoderRef &&other)=delete
 
 AnimationDecoder (StringParam file)
 Create a decoder to read a series of images from a file. More...
 
 AnimationDecoder (IOStreamParam src, StringParam type, bool closeio=false)
 Create a decoder to read a series of images from an IOStream. More...
 
 AnimationDecoder (PropertiesParam props)
 Create an animation decoder with the specified properties. More...
 
 ~AnimationDecoder ()
 Destructor.
 
constexpr AnimationDecoderoperator= (AnimationDecoder &&other) noexcept
 Assignment operator.
 
constexpr AnimationDecoderRaw get () const noexcept
 Retrieves underlying AnimationDecoderRaw.
 
constexpr AnimationDecoderRaw release () noexcept
 Retrieves underlying AnimationDecoderRaw and clear this.
 
constexpr auto operator<=> (const AnimationDecoder &other) const noexcept=default
 Comparison.
 
constexpr operator bool () const noexcept
 Converts to bool.
 
constexpr operator AnimationDecoderParam () const noexcept
 Converts to AnimationDecoderParam.
 
void Close ()
 Close an animation decoder, finishing any decoding. More...
 
PropertiesRef GetProperties ()
 Get the properties of an animation decoder. More...
 
Surface GetFrame (Uint64 *duration)
 Get the next frame in an animation decoder. More...
 
AnimationDecoderStatus GetStatus ()
 Get the decoder status indicating the current state of the decoder. More...
 
void Reset ()
 Reset an animation decoder. More...
 

Protected Member Functions

constexpr AnimationDecoder (const AnimationDecoder &other) noexcept=default
 Copy constructor.
 
constexpr AnimationDecoderoperator= (const AnimationDecoder &other) noexcept=default
 Assignment operator.
 

Detailed Description

Category:
Resource

Constructor & Destructor Documentation

◆ AnimationDecoder() [1/4]

constexpr SDL::AnimationDecoder::AnimationDecoder ( const AnimationDecoderRaw  resource)
inlineexplicitconstexprnoexcept
Parameters
resourcea AnimationDecoderRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.

◆ AnimationDecoder() [2/4]

SDL::AnimationDecoder::AnimationDecoder ( StringParam  file)
inline

These animation types are currently supported:

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

The file type is determined from the file extension, e.g. "file.webp" will be decoded using WEBP.

Parameters
filethe file containing a series of images.
Postcondition
a new AnimationDecoder, or nullptr on failure; call GetError() for more information.
Since
This function is available since SDL_image 3.4.0.
See also
AnimationDecoder.AnimationDecoder
AnimationDecoder.AnimationDecoder
AnimationDecoder.GetFrame
AnimationDecoder.Reset
AnimationDecoder.Close

◆ AnimationDecoder() [3/4]

SDL::AnimationDecoder::AnimationDecoder ( IOStreamParam  src,
StringParam  type,
bool  closeio = false 
)
inline

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.

Parameters
srcan IOStream containing a series of images.
closeiotrue to close the IOStream when done, false to leave it open.
typea filename extension that represent this data ("WEBP", etc).
Postcondition
a new AnimationDecoder, or nullptr on failure; call GetError() for more information.
Since
This function is available since SDL_image 3.4.0.
See also
AnimationDecoder.AnimationDecoder
AnimationDecoder.AnimationDecoder
AnimationDecoder.GetFrame
AnimationDecoder.Reset
AnimationDecoder.Close

◆ AnimationDecoder() [4/4]

SDL::AnimationDecoder::AnimationDecoder ( PropertiesParam  props)
inline

These animation types are currently supported:

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

These are the supported properties:

  • prop::AnimationDecoder.CREATE_FILENAME_STRING: the file to load, if an IOStream isn't being used. This is required if prop::AnimationDecoder.CREATE_IOSTREAM_POINTER isn't set.
  • prop::AnimationDecoder.CREATE_IOSTREAM_POINTER: an IOStream containing a series of images. This should not be closed until the animation decoder is closed. This is required if prop::AnimationDecoder.CREATE_FILENAME_STRING isn't set.
  • prop::AnimationDecoder.CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN: true if closing the animation decoder should also close the associated IOStream.
  • prop::AnimationDecoder.CREATE_TYPE_STRING: the input file type, e.g. "webp", defaults to the file extension if prop::AnimationDecoder.CREATE_FILENAME_STRING is set.
Parameters
propsthe properties of the animation decoder.
Postcondition
a new AnimationDecoder, or nullptr on failure; call GetError() for more information.
Since
This function is available since SDL_image 3.4.0.
See also
AnimationDecoder.AnimationDecoder
AnimationDecoder.AnimationDecoder
AnimationDecoder.GetFrame
AnimationDecoder.Reset
AnimationDecoder.Close

The documentation for this class was generated from the following file: