3#ifndef GDK_GRAPHICS_EXT_ASEPRITE_H
4#define GDK_GRAPHICS_EXT_ASEPRITE_H
6#include <gdk/graphics/ext/sprite_animation.h>
15namespace gdk::graphics::ext {
29 [[nodiscard]]
bool operator==(
const aseprite_frame &)
const =
default;
33 enum class aseprite_direction {
47 aseprite_direction direction = aseprite_direction::forward;
53 [[nodiscard]]
bool operator==(
const aseprite_tag &)
const =
default;
67 std::optional<std::pair<int, int>> pivot;
69 [[nodiscard]]
bool operator==(
const aseprite_slice &)
const =
default;
78 std::vector<aseprite_frame> frames;
80 std::vector<aseprite_tag> tags;
82 std::vector<aseprite_slice> slices;
94 constexpr std::size_t MOST_ASEPRITE_FRAMES = 65536;
97 [[nodiscard]]
aseprite_sheet read_aseprite(std::span<const std::byte> aBytes);
100 [[nodiscard]] std::vector<sprite_animation::frame> frames_of(
105 [[nodiscard]] std::vector<sprite_animation::frame> frames_of(
const aseprite_sheet &aSheet);
non-interpolated 2d sprite animation
Definition sprite_animation.h:14
const aseprite_tag * tag(std::string_view aName) const
the tag of that name
const aseprite_slice * slice(std::string_view aName) const
the first slice of that name
a slice is a named rectangle of a frame which may carry a pivot
Definition aseprite.h:57
a tag is a run of frames with a name
Definition aseprite.h:41