OGLplus  (0.59.0) a C++ wrapper for rendering APIs

image_file_hdr.hpp
Go to the documentation of this file.
1 
9 #ifndef OGLPLUS_UTILS_IMAGE_FILE_HDR_HPP
10 #define OGLPLUS_UTILS_IMAGE_FILE_HDR_HPP
11 
12 #include "../gl_api/enum_types.hpp"
16 #include <array>
17 
18 namespace eagine::oglp {
19 
20 struct image_data_header {
21  file_magic_number<'o', 'g', 'l', '+', 't', 'e', 'x', 'i'> magic;
22  gl_types::sizei_type width{0}, height{0}, depth{0}, channels{0};
23  gl_types::enum_type format{0}, internal_format{0};
24  gl_types::enum_type data_type{0};
25 
26  memory::offset_span<const gl_types::ubyte_type> pixels{};
27 
28  constexpr image_data_header() noexcept = default;
29 
30  image_data_header(
31  valid_if_positive<gl_types::sizei_type> w,
32  valid_if_positive<gl_types::sizei_type> h,
33  valid_if_positive<gl_types::sizei_type> d,
34  valid_if_positive<gl_types::sizei_type> c) noexcept
35  : width(w.value())
36  , height(h.value())
37  , depth(d.value())
38  , channels(c.value()) {}
39 };
40 
41 } // namespace eagine::oglp
42 
43 #endif // OGLPLUS_UTILS_IMAGE_FILE_HDR_HPP
GLsizei sizei_type
Signed integer size type.
Definition: config.hpp:88
valid_if< T, valid_if_positive_policy< T > > valid_if_positive
Specialization of valid_if, for values valid if positive.
Definition: positive.hpp:44
GLenum enum_type
Enumeration type.
Definition: config.hpp:52
static auto format(std::string &&fmt_str) noexcept -> format_string_and_list< 0 >
Function taking a format string, returning an object for variable specification.
Definition: str_format.hpp:118

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).