Topaz 5.0
Topaz Game Engine
Loading...
Searching...
No Matches
image.hpp
1#ifndef TOPAZ_IO_IMAGE_HPP
2#define TOPAZ_IO_IMAGE_HPP
3#include "tz/core/error.hpp"
4#include <cstddef>
5#include <span>
6#include <expected>
7
8namespace tz::io
9{
17 {
19 unsigned int width = 0u;
21 unsigned int height = 0u;
23 std::size_t data_size_bytes = 0u;
24 };
25
39 std::expected<image_header, tz::error_code> image_info(std::span<const std::byte> img_file_data);
49 tz::error_code parse_image(std::span<const std::byte> img_file_data, std::span<std::byte> buffer);
50}
51
52#endif // TOPAZ_IO_IMAGE_HPP
error_code
Error codes for Topaz.
Definition error.hpp:14
std::expected< image_header, tz::error_code > image_info(std::span< const std::byte > img_file_data)
Retrieve info about an image loaded in memory.
tz::error_code parse_image(std::span< const std::byte > img_file_data, std::span< std::byte > buffer)
Load an image from file data resident in memory.
Describes basic information about an image.
Definition image.hpp:17
std::size_t data_size_bytes
Size of the total image data, in bytes.
Definition image.hpp:23
unsigned int height
Height of the image, in pixels.
Definition image.hpp:21
unsigned int width
Width of the image, in pixels.
Definition image.hpp:19