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

Semi-safe reference for AnimationEncoder.

Inheritance diagram for SDL::AnimationEncoderRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::AnimationEncoderRef:
Collaboration graph
[legend]

Public Member Functions

 AnimationEncoderRef (AnimationEncoderParam resource) noexcept
 Constructs from AnimationEncoderParam. More...
 
 AnimationEncoderRef (AnimationEncoderRaw resource) noexcept
 Constructs from AnimationEncoderParam. More...
 
constexpr AnimationEncoderRef (const AnimationEncoderRef &other) noexcept=default
 Copy constructor.
 
 ~AnimationEncoderRef ()
 Destructor.
 
constexpr AnimationEncoder (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr AnimationEncoder (const AnimationEncoderRaw resource) noexcept
 Constructs from AnimationEncoderParam. More...
 
constexpr AnimationEncoder (const AnimationEncoder &other) noexcept=default
 Copy constructor.
 
constexpr AnimationEncoder (AnimationEncoder &&other) noexcept
 Move constructor.
 
constexpr AnimationEncoder (const AnimationEncoderRef &other)=delete
 
constexpr AnimationEncoder (AnimationEncoderRef &&other)=delete
 
 AnimationEncoder (StringParam file)
 Create an encoder to save a series of images to a file. More...
 
 AnimationEncoder (IOStreamParam dst, StringParam type, bool closeio=false)
 Create an encoder to save a series of images to an IOStream. More...
 
 AnimationEncoder (PropertiesParam props)
 Create an animation encoder with the specified properties. More...
 
- Public Member Functions inherited from SDL::AnimationEncoder
constexpr AnimationEncoder (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr AnimationEncoder (const AnimationEncoderRaw resource) noexcept
 Constructs from AnimationEncoderParam. More...
 
constexpr AnimationEncoder (AnimationEncoder &&other) noexcept
 Move constructor.
 
constexpr AnimationEncoder (const AnimationEncoderRef &other)=delete
 
constexpr AnimationEncoder (AnimationEncoderRef &&other)=delete
 
 AnimationEncoder (StringParam file)
 Create an encoder to save a series of images to a file. More...
 
 AnimationEncoder (IOStreamParam dst, StringParam type, bool closeio=false)
 Create an encoder to save a series of images to an IOStream. More...
 
 AnimationEncoder (PropertiesParam props)
 Create an animation encoder with the specified properties. More...
 
 ~AnimationEncoder ()
 Destructor.
 
constexpr AnimationEncoderoperator= (AnimationEncoder &&other) noexcept
 Assignment operator.
 
constexpr AnimationEncoderRaw get () const noexcept
 Retrieves underlying AnimationEncoderRaw.
 
constexpr AnimationEncoderRaw release () noexcept
 Retrieves underlying AnimationEncoderRaw and clear this.
 
constexpr auto operator<=> (const AnimationEncoder &other) const noexcept=default
 Comparison.
 
constexpr operator bool () const noexcept
 Converts to bool.
 
constexpr operator AnimationEncoderParam () const noexcept
 Converts to AnimationEncoderParam.
 
void Close ()
 Close an animation encoder, finishing any encoding. More...
 
void AddFrame (SurfaceParam surface, Uint64 duration)
 Add a frame to an animation encoder. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SDL::AnimationEncoder
constexpr AnimationEncoder (const AnimationEncoder &other) noexcept=default
 Copy constructor.
 
constexpr AnimationEncoderoperator= (const AnimationEncoder &other) noexcept=default
 Assignment operator.
 

Constructor & Destructor Documentation

◆ AnimationEncoderRef() [1/2]

SDL::AnimationEncoderRef::AnimationEncoderRef ( AnimationEncoderParam  resource)
inlinenoexcept
Parameters
resourcea AnimationEncoderRaw or AnimationEncoder.

This does not takes ownership!

◆ AnimationEncoderRef() [2/2]

SDL::AnimationEncoderRef::AnimationEncoderRef ( AnimationEncoderRaw  resource)
inlinenoexcept
Parameters
resourcea AnimationEncoderRaw or AnimationEncoder.

This does not takes ownership!

Member Function Documentation

◆ AnimationEncoder() [1/4]

constexpr SDL::AnimationEncoder::AnimationEncoder ( const AnimationEncoderRaw  resource)
inlineexplicitconstexprnoexcept
Parameters
resourcea AnimationEncoderRaw to be wrapped.

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

◆ AnimationEncoder() [2/4]

SDL::AnimationEncoder::AnimationEncoder ( IOStreamParam  dst,
StringParam  type,
bool  closeio = false 
)
inline

These animation types are currently supported:

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

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

Parameters
dstan IOStream that will be used to save the stream.
typea filename extension that represent this data ("WEBP", etc).
closeiotrue to close the IOStream when done, false to leave it open.
Postcondition
a new AnimationEncoder, or nullptr on failure; call GetError() for more information.
Since
This function is available since SDL_image 3.4.0.
See also
AnimationEncoder.AnimationEncoder
AnimationEncoder.AnimationEncoder
AnimationEncoder.AddFrame
AnimationEncoder.Close

◆ AnimationEncoder() [3/4]

SDL::AnimationEncoder::AnimationEncoder ( PropertiesParam  props)
inline

These animation types are currently supported:

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

These are the supported properties:

  • prop::AnimationEncoder.CREATE_FILENAME_STRING: the file to save, if an IOStream isn't being used. This is required if prop::AnimationEncoder.CREATE_IOSTREAM_POINTER isn't set.
  • prop::AnimationEncoder.CREATE_IOSTREAM_POINTER: an IOStream that will be used to save the stream. This should not be closed until the animation encoder is closed. This is required if prop::AnimationEncoder.CREATE_FILENAME_STRING isn't set.
  • prop::AnimationEncoder.CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN: true if closing the animation encoder should also close the associated IOStream.
  • prop::AnimationEncoder.CREATE_TYPE_STRING: the output file type, e.g. "webp", defaults to the file extension if prop::AnimationEncoder.CREATE_FILENAME_STRING is set.
  • prop::AnimationEncoder.CREATE_QUALITY_NUMBER: the compression quality, in the range of 0 to 100. The higher the number, the higher the quality and file size. This defaults to a balanced value for compression and quality.
  • prop::AnimationEncoder.CREATE_TIMEBASE_NUMERATOR_NUMBER: the numerator of the fraction used to multiply the pts to convert it to seconds. This defaults to 1.
  • prop::AnimationEncoder.CREATE_TIMEBASE_DENOMINATOR_NUMBER: the denominator of the fraction used to multiply the pts to convert it to seconds. This defaults to 1000.
Parameters
propsthe properties of the animation encoder.
Postcondition
a new AnimationEncoder, or nullptr on failure; call GetError() for more information.
Since
This function is available since SDL_image 3.4.0.
See also
AnimationEncoder.AnimationEncoder
AnimationEncoder.AnimationEncoder
AnimationEncoder.AddFrame
AnimationEncoder.Close

◆ AnimationEncoder() [4/4]

SDL::AnimationEncoder::AnimationEncoder ( 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 encoded using WEBP.

Parameters
filethe file where the animation will be saved.
Postcondition
a new AnimationEncoder, or nullptr on failure; call GetError() for more information.
Since
This function is available since SDL_image 3.4.0.
See also
AnimationEncoder.AnimationEncoder
AnimationEncoder.AnimationEncoder
AnimationEncoder.AddFrame
AnimationEncoder.Close

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