coastline 0.0.4
Loading...
Searching...
No Matches
indexedimage.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <filesystem>
5#include <optional>
6#include <span>
7#include <vector>
8
9namespace coastline {
10
25 int width,
26 int height);
27
40
52
64 int width,
65 int height);
66
80 int width,
81 int height);
82
92EncodeRgba8Png(std::span<const std::uint8_t> rgba, int width, int height);
93
94} // namespace coastline
Definition assetimport.h:11
std::optional< std::vector< std::uint8_t > > EncodeRgba8Png(std::span< const std::uint8_t > rgba, int width, int height)
Encode 8-bit RGBA texels as a PNG image in memory.
bool LoadIndexed4Png(const std::filesystem::path &path, std::span< std::uint8_t > texels, std::span< std::uint8_t, 32 > palette)
Read an indexed PNG image as the 4-bit texels and the RGBA5551 palette of the console.
bool SaveIndexed4Png(const std::filesystem::path &path, std::span< const std::uint8_t > texels, std::span< const std::uint8_t, 32 > palette, int width, int height)
Write a 4-bit colour-indexed image of the console as an indexed PNG image.
std::optional< std::vector< std::uint8_t > > EncodeIndexed4Png(std::span< const std::uint8_t > texels, std::span< const std::uint8_t, 32 > palette, int width, int height)
Encode a 4-bit colour-indexed image of the console as an indexed PNG image in memory.
bool SaveRgba8Png(const std::filesystem::path &path, std::span< const std::uint8_t > rgba, int width, int height)
Write 8-bit RGBA texels as a PNG image, and read it back to check it.