SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches

Animated image support. More...

Inheritance diagram for SDL::Animation:
[legend]

Public Member Functions

constexpr Animation (AnimationRaw resource) noexcept
 Constructs from raw Animation.
constexpr Animation (Animation &&other) noexcept
 Move constructor.
 Animation (StringParam file)
 Load an animation from a file.
 Animation (IOStreamRef src, bool closeio=false)
 Load an animation from an IOStream.
 ~Animation ()
 Destructor.
constexpr Animationoperator= (Animation &&other) noexcept
 Assignment operator.
Public Member Functions inherited from SDL::AnimationBase
constexpr operator AnimationConstRef () const noexcept
 Converts to AnimationConstRef.
void Free ()
 Dispose of an Animation and free its resources.
int GetWidth () const
 Get the width in pixels.
int GetHeight () const
 Get the height in pixels.
Point GetSize () const
 Get the size in pixels.
int GetCount () const
 Return the number of frames.
Surface GetFrame (int index) const
 Return the frame image under given index.
int GetDelay (int index) const
 Return the frame delay under given index.
void Save (StringParam file)
 Save an animation to a file.
void SaveTyped_IO (IOStreamRef dst, StringParam type, bool closeio=false)
 Save an animation to an IOStream.
void SaveANI_IO (IOStreamRef dst, bool closeio=false)
 Save an animation in ANI format to an IOStream.
void SaveAPNG_IO (IOStreamRef dst, bool closeio=false)
 Save an animation in APNG format to an IOStream.
void SaveAVIF_IO (IOStreamRef dst, int quality, bool closeio=false)
 Save an animation in AVIF format to an IOStream.
void SaveGIF_IO (IOStreamRef dst, bool closeio=false)
 Save an animation in GIF format to an IOStream.
void SaveWEBP_IO (IOStreamRef dst, int quality, bool closeio=false)
 Save an animation in WEBP format to an IOStream.
Cursor CreateCursor (const PointRaw &hotspot)
 Create an animated cursor from an animation.
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr ResourceBaseT (RawPointer resource)
 Constructs from resource pointer.
constexpr ResourceBaseT (std::nullptr_t)
 Constructs null/invalid.
constexpr ResourceBaseT (const ResourceBaseT &)=default
 Copy constructor.
constexpr ResourceBaseT (ResourceBaseT &&) noexcept=default
 Move constructor.
Public Member Functions inherited from SDL::ResourceBaseT< AnimationRaw, AnimationRawConst >
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr operator bool () const
 Converts to bool.
constexpr auto operator<=> (const ResourceBaseT &other) const=default
 Comparison.
constexpr RawConstPointer operator-> () const noexcept
 member access to underlying resource pointer.
constexpr RawPointer get () const noexcept
 Retrieves underlying resource pointer.
constexpr RawPointer release () noexcept
 Retrieves underlying resource pointer and clear this.

Additional Inherited Members

Public Types inherited from SDL::ResourceBaseT< AnimationRaw, AnimationRawConst >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< AnimationRaw, AnimationRawConst >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

Animated image support.

Category:
Resource

Constructor & Destructor Documentation

◆ Animation()

SDL::Animation::Animation ( AnimationRaw resource)
inlineexplicitconstexprnoexcept

Constructs from raw Animation.

Parameters
resourcea AnimationRaw to be wrapped.

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


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