|
Haio 0.2.X
Homebrew Asset IO/CDN
|
#include "haio_common.hpp"#include "haio_formats.hpp"#include "haio_object.hpp"#include <expected>#include <meta>#include <optional>#include <span>

Go to the source code of this file.
Classes | |
| struct | Haio::Error |
| struct | Haio::Image< P > |
| struct | Haio::Image< Color::PALETTE > |
| struct | Haio::Blob |
Namespaces | |
| namespace | Haio |
| namespace | Haio::Codecs |
Concepts | |
| concept | Haio::Addressable |
| concept | Haio::Maskable |
| concept | Haio::Codecs::HasDefaultColor |
| concept | Haio::Codecs::Detectable |
| concept | Haio::Codecs::Decodable |
| concept | Haio::Codecs::Encodable |
| concept | Haio::Codecs::Movable |
| concept | Haio::Codecs::Convertible |
Macros | |
| #define | HAIO_TRY(name, expr) |
| #define | HAIO_CHECK(expr) |
| #define | HAIO_FAIL(why, message) |
| #define | HAIO_FOR_EACH_FORMAT(e) |
| #define | HAIO_FOR_EACH_COLOR(e) |
Typedefs | |
| using | Haio::Bytes = std::span<const uint8_t> |
| template<typename T> | |
| using | Haio::Result = std::expected<T, Error> |
Enumerations | |
| enum class | Haio::ErrorCode { Haio::Internal , Haio::InvalidInput , Haio::UnsupportedFormat , Haio::NotFound , Haio::Io , Haio::Upstream , Haio::Timeout } |
Functions | |
| constexpr size_t | Haio::strideOf (Color color) |
| constexpr int | Haio::alphaOffsetOf (Color color) |
| template<Format F, Color P = DefaultColor<F>::value> | |
| bool | Haio::Codecs::Detect (Bytes)=delete |
| template<Format F, Color P = DefaultColor<F>::value> | |
| Result< Image< P > > | Haio::Codecs::Decode (const Blob &)=delete |
| template<Format F, Color P> | |
| Result< Blob > | Haio::Codecs::Encode (Image< P >)=delete |
| template<Color From, Color To> | |
| Result< void > | Haio::Codecs::Move (Bytes src, std::span< uint8_t > dst, Size size)=delete |
| consteval std::string_view | Haio::lowerOf (std::meta::info enumerator) |
Convert | |
| template<Color From, Color To> | |
| Result< Image< To > > | Haio::Codecs::Convert (Image< From >)=delete |
| struct Haio::Error |
Definition at line 26 of file haio_codec.hpp.
| Class Members | ||
|---|---|---|
| ErrorCode | code = ErrorCode::Internal | |
| string | message | |
| struct Haio::Blob |
bytes of a file. it has a container and the colour it was found to hold
Definition at line 122 of file haio_codec.hpp.
| Class Members | ||
|---|---|---|
| Color | color = Color::RGBA8888 | |
| string | contentType = "application/octet-stream" | |
| vector< uint8_t > | data | |
| Format | format = Format::RAW | |
| string | path | |
| #define HAIO_CHECK | ( | expr | ) |
for a check that only reports a problem and produces no value
Definition at line 252 of file haio_codec.hpp.
| #define HAIO_FAIL | ( | why, | |
| message ) |
a plain failure, for the common case of a message and a cause
Definition at line 258 of file haio_codec.hpp.
| #define HAIO_FOR_EACH_COLOR | ( | e | ) |
Definition at line 265 of file haio_codec.hpp.
| #define HAIO_FOR_EACH_FORMAT | ( | e | ) |
the enums are the loops: a new enumerator grows every table on its own
Definition at line 262 of file haio_codec.hpp.
| #define HAIO_TRY | ( | name, | |
| expr ) |
go style early return. c++26 still has no "?" operator, so unwrapping a Result and leaving on failure is either this or a monadic chain that reads badly when the steps are independent.
Definition at line 246 of file haio_codec.hpp.