49template <SupportsTransparency PixelType>
81template <SupportsTransparency PixelType,
typename LoaderType>
83 const std::filesystem::path &png_path,
const std::string &frame_name,
const LoaderType &loader)
86 auto image_result = loader.load_from_file(png_path);
87 if (!image_result.has_value()) {
106 if (img.
palette().has_value()) {
Represents a single frame of an animation, containing tiles and a frame name.
const Palette< Rgba32 > & palette() const
A result type that maintains a chainable sequence of errors for debugging and error reporting.
A template for two-dimensional images with arbitrarily typed pixel values.
std::size_t width() const
const std::optional< std::vector< Rgba32 > > & palette() const
std::size_t height() const
A generic palette container for colors that support transparency checking.
static const Style bold
Bold text formatting.
constexpr std::size_t side_length_pix
std::vector< PixelTile< PixelType > > extract_tiles_from_image(const Image< PixelType > &img, std::size_t tile_offset, std::size_t tile_count, std::size_t tiles_per_row=16)
Extracts a subset of 8x8 tiles from a tileset image at a specific offset.
ChainableResult< FrameLoadResult< PixelType > > load_animation_frame_from_png(const std::filesystem::path &png_path, const std::string &frame_name, const LoaderType &loader)
Loads an animation frame from a PNG file.
Result of loading an animation frame from a PNG file.
AnimFrame< PixelType > frame