gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
texture_data.h
Go to the documentation of this file.
1// © Joseph Cameron - MIT License
2
3#ifndef GDK_GRAPHICS_TEXTURE_DATA_H
4#define GDK_GRAPHICS_TEXTURE_DATA_H
5
6#include <cstddef>
7#include <vector>
8
11namespace gdk::graphics::texture_data {
13 enum class format {
18 };
19
20 using channel_type = unsigned char;
21 using channel_data = std::vector<channel_type>;
22 using encoded_byte = unsigned char;
23
27 struct view {
28 std::size_t width;
29 std::size_t height;
31 const channel_type *data;
32 };
33}
34
35#endif
36
provides a pointer a contiguous list of channel data representing 2D texture metadata that contains i...
Definition texture_data.h:27
std::size_t width
number of texels wide
Definition texture_data.h:28
std::size_t height
number of texels tall
Definition texture_data.h:29
texture_data::format format
format of the data
Definition texture_data.h:30
const channel_type * data
ptr to the start of decoded texture data
Definition texture_data.h:31
format
format of data in the component_type array
Definition texture_data.h:13
@ rg
a sequence of 2 channels, single byte colors: red, green, ...
Definition texture_data.h:15
@ rgba
a sequence of 4 channels, single byte colors: red, green, blue, alpha, ...
Definition texture_data.h:17
@ grey
a sequence of 1 channel, single byte color: grey, ...
Definition texture_data.h:14
@ rgb
a sequence of 3 channels, single byte colors: red, green, blue, ...
Definition texture_data.h:16