| 0.6.1

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

storage.hpp
Go to the documentation of this file.
1
29 #pragma once
30
31 // STD
32 #include <vector>
33 #include <queue>
34 #include <string>
35 #include <cassert>
36 #include <cmath>
37 #include <cstring>
38 #include <memory>
39
40 #include "header.hpp"
41 #include "type.hpp"
42
43 // GLM
44 #include <glm/gtc/round.hpp>
45 #include <glm/gtx/component_wise.hpp>
46 #include <glm/gtx/gradient_paint.hpp>
47 #include <glm/gtx/integer.hpp>
48 #include <glm/gtx/bit.hpp>
49 #include <glm/gtx/raw_data.hpp>
50 #include <glm/gtx/wrap.hpp>
51
52 static_assert(GLM_VERSION >= 97, "GLI requires at least GLM 0.9.7");
53
54 namespace gli
55 {
56 class storage
57 {
58 public:
59 typedef dim3_t dim_type;
60 typedef size_t size_type;
61 typedef gli::format format_type;
62 typedef glm::byte data_type;
63 typedef glm::ivec4 swizzle_type;
64
65 public:
66 storage();
67
68 storage(
69 size_type const & Layers,
70 size_type const & Faces,
71 size_type const & Levels,
72 format_type const & Format,
73 dim_type const & Dimensions);
74
75 bool empty() const;
76 size_type size() const; // Express is bytes
77 format_type format() const;
78 size_type layers() const;
79 size_type levels() const;
80 size_type faces() const;
81 swizzle_type swizzle() const;
82
83 dim_type dimensions(size_type const & Level) const;
84
85 data_type * data();
86 data_type const * data() const;
87
88 size_type level_size(
89 size_type const & Level) const;
90 size_type face_size(
91 size_type const & BaseLevel,
92 size_type const & MaxLevel) const;
93 size_type layer_size(
94 size_type const & BaseFace,
95 size_type const & MaxFace,
96 size_type const & BaseLevel,
97 size_type const & MaxLevel) const;
98
99 private:
100 struct impl
101 {
102 impl();
103
104 explicit impl(
105 size_type const & Layers,
106 size_type const & Faces,
107 size_type const & Levels,
108 format_type const & Format,
109 dim_type const & Dimensions);
110
111 size_type const Layers;
112 size_type const Faces;
113 size_type const Levels;
114 format_type const Format;
115 dim_type const Dimensions;
116 std::vector<data_type> Data;
117 };
118
119 std::shared_ptr<impl> Impl;
120 };
121
122 /*
123 storage extractLayers(
124 storage const & Storage,
125 storage::size_type const & Offset,
126 storage::size_type const & Size);
127 */
128 /*
129 storage extractFace(
130 storage const & Storage,
131 face const & Face);
132 */
133 /*
134 storage extractLevels(
135 storage const & Storage,
136 storage::size_type const & Offset,
137 storage::size_type const & Size);
138 */
139 /*
140 void copy_layers(
141 storage const & SourceStorage,
142 storage::size_type const & SourceLayerOffset,
143 storage::size_type const & SourceLayerSize,
144 storage & DestinationStorage,
145 storage::size_type const & DestinationLayerOffset);
146
147 void copy_faces(
148 storage const & SourceStorage,
149 storage::size_type const & SourceLayerOffset,
150 storage::size_type const & SourceFaceOffset,
151 storage::size_type const & SourceLayerSize,
152 storage & DestinationStorage,
153 storage::size_type const & DestinationLayerOffset,
154 storage::size_type const & DestinationFaceOffset);
155
156 void copy_levels(
157 storage const & SourceStorage,
158 storage::size_type const & SourceLayerOffset,
159 storage::size_type const & SourceFaceOffset,
160 storage::size_type const & SourceLevelOffset,
161 storage::size_type const & SourceLayerSize,
162 storage & DestinationStorage,
163 storage::size_type const & DestinationLayerOffset,
164 storage::size_type const & DestinationFaceOffset,
165 storage::size_type const & DestinationlevelOffset);
166 */
167
168 }//namespace gli
169
170 #include "storage.inl"
gli::storage::size
size_type size() const
gli::storage::layers
size_type layers() const
gli::storage::size_type
size_t size_type
Definition: storage.hpp:60
gli::storage::swizzle_type
glm::ivec4 swizzle_type
Definition: storage.hpp:63
gli::storage::dim_type
dim3_t dim_type
Definition: storage.hpp:59
gli::format
format
Definition: format.hpp:33
gli::ivec4
glm::ivec4 ivec4
Definition: type.hpp:56
gli::storage::layer_size
size_type layer_size(size_type const &BaseFace, size_type const &MaxFace, size_type const &BaseLevel, size_type const &MaxLevel) const
type.hpp
OpenGL Image (gli.g-truc.net)
gli::storage
Definition: storage.hpp:56
gli::storage::face_size
size_type face_size(size_type const &BaseLevel, size_type const &MaxLevel) const
header.hpp
OpenGL Image (gli.g-truc.net)
gli::storage::level_size
size_type level_size(size_type const &Level) const
gli::storage::data
data_type * data()
gli::storage::faces
size_type faces() const
gli::storage::empty
bool empty() const
gli::dim3_t
glm::tvec3< size_t > dim3_t
Definition: type.hpp:49
gli::storage::format
format_type format() const
gli::storage::dimensions
dim_type dimensions(size_type const &Level) const
gli::storage::swizzle
swizzle_type swizzle() const
gli::storage::format_type
gli::format format_type
Definition: storage.hpp:61
gli::storage::data_type
glm::byte data_type
Definition: storage.hpp:62
gli
Definition: addressing.hpp:33
gli::storage::storage
storage()
gli::storage::levels
size_type levels() const