coastline 0.0.4
Loading...
Searching...
No Matches
iconfile.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <optional>
5#include <span>
6#include <string>
7#include <string_view>
8#include <vector>
9
10namespace coastline {
11
17
24
26struct IconSize {
27 int width = 0;
28 int height = 0;
29 int bitCount = 0;
30
34 bool operator==(const IconSize &) const = default;
35};
36
44
52
62
73
74} // namespace coastline
Definition assetimport.h:11
std::string IconName(const IconSize &size)
Give the name of the PNG file of an image of the icon.
std::optional< IconPixels > DecodeIconBitmap(std::span< const std::uint8_t > image)
Decode an icon image that is a device-independent bitmap: the colours, then the AND mask that makes a...
std::vector< IconEntry > ListIconImages(std::span< const std::uint8_t > icon)
List the images of an icon file.
std::optional< IconSize > ParseIconName(std::string_view name)
Read the size of an image of the icon from the name the import gives its PNG file.
One image of an icon file.
Definition iconfile.h:13
std::uint32_t bitCount
Definition iconfile.h:14
std::span< const std::uint8_t > image
Definition iconfile.h:15
An image of an icon as 8-bit RGBA texels.
Definition iconfile.h:19
int width
Definition iconfile.h:20
std::vector< std::uint8_t > rgba
Definition iconfile.h:22
int height
Definition iconfile.h:21
The size of an image of the icon of the game, from the name of its PNG file.
Definition iconfile.h:26
bool operator==(const IconSize &) const =default
int bitCount
Definition iconfile.h:29
int height
Definition iconfile.h:28
int width
Definition iconfile.h:27