3#ifndef GDK_GFX_TEXTURE_DATA_H
4#define GDK_GFX_TEXTURE_DATA_H
6#include <gdk/texture.h>
12namespace gdk::texture_data {
13 using channel_type =
unsigned char;
14 using channel_data = std::vector<channel_type>;
15 using encoded_byte =
unsigned char;
31 size_t width; //!< number of texels wide
32 size_t height; //!< number of texels tall
33 size_t length; //!< number of texels long
34 texture::format format; //!< format of the data
35 const channel_type *data; //!< ptr to the start of decoded texture data
39 std::pair<view, std::shared_ptr<channel_data>> make_from_png(
40 const encoded_byte* aDataStart,
const size_t aLength,
42 std::pair<view, std::shared_ptr<channel_data>> make_from_png(
44 template <std::
size_t N>
45 std::pair<view, std::shared_ptr<channel_data>> make_from_png(
47 return make_from_png(data.data(), N, aFormat);
format
format of data in the component_type array
Definition texture.h:23
@ rgba
a sequence of 4 channels, single byte colors: red, green, blue, alpha, ...
Definition texture.h:27
provides a pointer a contiguous list of channel data representing 2D texture metadata that contains i...
Definition texture_data.h:20
size_t width
number of texels wide
Definition texture_data.h:21
size_t height
number of texels tall
Definition texture_data.h:22
const channel_type * data
ptr to the start of decoded texture data
Definition texture_data.h:24
texture::format format
format of the data
Definition texture_data.h:23