mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
35 lines
964 B
C++
35 lines
964 B
C++
#ifndef __TEXTURESLICEVOLUMEREADER_H__
|
|
#define __TEXTURESLICEVOLUMEREADER_H__
|
|
|
|
#include <vector>
|
|
#include <ghoul/opengl/texture.h>
|
|
#include <memory>
|
|
#include <modules/volume/linearlrucache.h>
|
|
#include <map>
|
|
#include <unordered_map>
|
|
|
|
namespace openspace {
|
|
|
|
template <typename Voxel>
|
|
class TextureSliceVolumeReader {
|
|
public:
|
|
typedef Voxel VoxelType;
|
|
TextureSliceVolumeReader(std::vector<std::string> paths, size_t sliceCacheMaxItems, size_t sliceCacheSize);
|
|
VoxelType get(const glm::ivec3& coordinates) const;
|
|
virtual glm::ivec3 dimensions() const;
|
|
void setPaths(const std::vector<std::string> paths);
|
|
void initialize();
|
|
private:
|
|
ghoul::opengl::Texture& getSlice(int sliceIndex) const;
|
|
std::vector<std::string> _paths;
|
|
mutable LinearLruCache<std::shared_ptr<ghoul::opengl::Texture>> _cache;
|
|
glm::ivec2 _sliceDimensions;
|
|
bool _initialized;
|
|
};
|
|
|
|
}
|
|
|
|
#include "textureslicevolumereader.inl"
|
|
|
|
#endif // __TEXTURESLICEVOLUME_H__
|