GLI 0.6.0

- 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 dim1_t dim1_type;
60 typedef dim2_t dim2_type;
61 typedef dim3_t dim3_type;
62 typedef dim4_t dim4_type;
63 typedef dim3_type dim_type;
64 typedef texcoord1_t texcoord1_type;
65 typedef texcoord2_t texcoord2_type;
66 typedef texcoord3_t texcoord3_type;
67 typedef texcoord4_t texcoord4_type;
68 typedef size_t size_type;
69 typedef size_t layer_type;
70 typedef size_t level_type;
71 typedef size_t face_type;
72 typedef gli::format format_type;
73 typedef glm::byte data_type;
74 typedef glm::ivec4 swizzle_type;
75
76 public:
77 storage();
78
79 storage(
80 layer_type const & Layers,
81 face_type const & Faces,
82 level_type const & Levels,
83 format_type const & Format,
84 dim_type const & Dimensions);
85
86 bool empty() const;
87 size_type size() const; // Express is bytes
88 format_type format() const;
89 layer_type layers() const;
90 level_type levels() const;
91 face_type faces() const;
92 swizzle_type swizzle() const;
93
94 dim_type dimensions(size_type const & Level) const;
95
96 data_type * data();
97 data_type const * data() const;
98
99 size_type level_size(
100 level_type const & Level) const;
101 size_type face_size(
102 level_type const & BaseLevel,
103 level_type const & MaxLevel) const;
104 size_type layer_size(
105 face_type const & BaseFace,
106 face_type const & MaxFace,
107 level_type const & BaseLevel,
108 level_type const & MaxLevel) const;
109
110 private:
111 struct impl
112 {
113 impl();
114
115 explicit impl(
116 layer_type const & Layers,
117 face_type const & Faces,
118 level_type const & Levels,
119 format_type const & Format,
120 dim_type const & Dimensions);
121
122 size_type const Layers;
123 size_type const Faces;
124 size_type const Levels;
125 format_type const Format;
126 dim_type const Dimensions;
127 std::vector<data_type> Data;
128 };
129
130 std::shared_ptr<impl> Impl;
131 };
132
133 /*
134 storage extractLayers(
135 storage const & Storage,
136 storage::size_type const & Offset,
137 storage::size_type const & Size);
138 */
139 /*
140 storage extractFace(
141 storage const & Storage,
142 face const & Face);
143 */
144 /*
145 storage extractLevels(
146 storage const & Storage,
147 storage::size_type const & Offset,
148 storage::size_type const & Size);
149 */
150 /*
151 void copy_layers(
152 storage const & SourceStorage,
153 storage::size_type const & SourceLayerOffset,
154 storage::size_type const & SourceLayerSize,
155 storage & DestinationStorage,
156 storage::size_type const & DestinationLayerOffset);
157
158 void copy_faces(
159 storage const & SourceStorage,
160 storage::size_type const & SourceLayerOffset,
161 storage::size_type const & SourceFaceOffset,
162 storage::size_type const & SourceLayerSize,
163 storage & DestinationStorage,
164 storage::size_type const & DestinationLayerOffset,
165 storage::size_type const & DestinationFaceOffset);
166
167 void copy_levels(
168 storage const & SourceStorage,
169 storage::size_type const & SourceLayerOffset,
170 storage::size_type const & SourceFaceOffset,
171 storage::size_type const & SourceLevelOffset,
172 storage::size_type const & SourceLayerSize,
173 storage & DestinationStorage,
174 storage::size_type const & DestinationLayerOffset,
175 storage::size_type const & DestinationFaceOffset,
176 storage::size_type const & DestinationlevelOffset);
177 */
178
179 }//namespace gli
180
181 #include "storage.inl"
gli::storage::size
size_type size() const
gli::storage::size_type
size_t size_type
Definition: storage.hpp:68
gli::storage::swizzle_type
glm::ivec4 swizzle_type
Definition: storage.hpp:74
gli::texcoord3_t
glm::vec3 texcoord3_t
Definition: type.hpp:53
gli::texcoord4_t
glm::vec4 texcoord4_t
Definition: type.hpp:54
gli::dim2_t
glm::tvec2< size_t > dim2_t
Definition: type.hpp:48
gli::storage::face_type
size_t face_type
Definition: storage.hpp:71
gli::dim1_t
glm::tvec1< size_t > dim1_t
Definition: type.hpp:47
gli::dim4_t
glm::tvec4< size_t > dim4_t
Definition: type.hpp:50
gli::texcoord2_t
glm::vec2 texcoord2_t
Definition: type.hpp:52
gli::storage::texcoord1_type
texcoord1_t texcoord1_type
Definition: storage.hpp:64
gli::storage::texcoord2_type
texcoord2_t texcoord2_type
Definition: storage.hpp:65
gli
Definition: addressing.hpp:33
type.hpp
OpenGL Image (gli.g-truc.net)
gli::storage
Definition: storage.hpp:56
gli::storage::faces
face_type faces() const
gli::storage::levels
level_type levels() const
gli::storage::texcoord4_type
texcoord4_t texcoord4_type
Definition: storage.hpp:67
gli::storage::level_type
size_t level_type
Definition: storage.hpp:70
gli::storage::data
data_type * data()
gli::storage::level_size
size_type level_size(level_type const &Level) const
gli::texcoord1_t
glm::vec1 texcoord1_t
Definition: type.hpp:51
gli::storage::empty
bool empty() const
gli::storage::format
format_type format() const
header.hpp
OpenGL Image (gli.g-truc.net)
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:72
gli::storage::dim_type
dim3_type dim_type
Definition: storage.hpp:63
gli::storage::data_type
glm::byte data_type
Definition: storage.hpp:73
gli::dim3_t
glm::tvec3< size_t > dim3_t
Definition: type.hpp:49
gli::storage::texcoord3_type
texcoord3_t texcoord3_type
Definition: storage.hpp:66
gli::storage::dim4_type
dim4_t dim4_type
Definition: storage.hpp:62
gli::storage::layers
layer_type layers() const
gli::storage::face_size
size_type face_size(level_type const &BaseLevel, level_type const &MaxLevel) const
gli::storage::dim2_type
dim2_t dim2_type
Definition: storage.hpp:60
gli::storage::layer_size
size_type layer_size(face_type const &BaseFace, face_type const &MaxFace, level_type const &BaseLevel, level_type const &MaxLevel) const
gli::storage::dim1_type
dim1_t dim1_type
Definition: storage.hpp:59
gli::storage::storage
storage()
gli::storage::layer_type
size_t layer_type
Definition: storage.hpp:69
gli::storage::dim3_type
dim3_t dim3_type
Definition: storage.hpp:61
gli::format
format
Definition: format.hpp:33