vsg 1.1.13
VulkanSceneGraph library
Loading...
Searching...
No Matches
MipmapLayout.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2025 Robert Osfield
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
9The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
11THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
13</editor-fold> */
14
15#include <vsg/core/Inherit.h>
16#include <vsg/maths/vec4.h>
17
18#include <vector>
19
20namespace vsg
21{
22
23 class VSG_DECLSPEC MipmapLayout : public Inherit<Object, MipmapLayout>
24 {
25 public:
26 MipmapLayout();
27
28 explicit MipmapLayout(std::size_t size);
29
30 using Mipmaps = std::vector<vsg::uivec4>;
31
32 Mipmaps mipmaps;
33
34 std::size_t size() const { return mipmaps.size(); }
35 vsg::uivec4& at(size_t i) { return mipmaps[i]; }
36 const vsg::uivec4& at(size_t i) const { return mipmaps[i]; }
37
38 void set(size_t i, const vsg::uivec4& value) { mipmaps[i] = value; }
39
40 Mipmaps::iterator begin() { return mipmaps.begin(); }
41 Mipmaps::iterator end() { return mipmaps.end(); }
42
43 Mipmaps::const_iterator begin() const { return mipmaps.begin(); }
44 Mipmaps::const_iterator end() const { return mipmaps.end(); }
45
46 void read(Input& input) override;
47 void write(Output& output) const override;
48
49 protected:
50 virtual ~MipmapLayout();
51 };
52 VSG_type_name(vsg::MipmapLayout);
53
54} // namespace vsg
Definition Input.h:44
Definition MipmapLayout.h:24
Definition Output.h:41