FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
ImagePyramidRenderer.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 #include <deque>
5 #include <thread>
6 
7 namespace fast {
8 
9 class ImagePyramid;
10 
11 class FAST_EXPORT ImagePyramidRenderer : public Renderer {
13  public:
14  void loadAttributes() override;
15  void setIntensityLevel(float level);
16  float getIntensityLevel();
17  void setIntensityWindow(float window);
18  float getIntensityWindow();
19  ~ImagePyramidRenderer() override;
20  void clearPyramid();
21  private:
23  void draw(Matrix4f perspectiveMatrix, Matrix4f viewingMatrix, float zNear, float zFar, bool mode2D);
24 
25  std::unordered_map<std::string, uint> mTexturesToRender;
26  std::unordered_map<uint, std::shared_ptr<ImagePyramid>> mImageUsed;
27  std::unordered_map<std::string, uint> mVAO;
28  std::unordered_map<std::string, uint> mVBO;
29  std::unordered_map<std::string, uint> mEBO;
30 
31  // Queue of tiles to be loaded
32  std::list<std::string> m_tileQueue; // LIFO queue
33  // Buffer to process queue
34  std::unique_ptr<std::thread> m_bufferThread;
35  // Condition variable to wait if queue is empty
36  std::condition_variable m_queueEmptyCondition;
37  std::mutex m_tileQueueMutex;
38  bool m_stop = false;
39  std::unordered_set<std::string> m_loaded;
40 
41  int m_currentLevel = -1;
42 
43  cl::Kernel mKernel;
44 
45  std::shared_ptr<ImagePyramid> m_input;
46 
47  // Level and window intensities
48  float mWindow;
49  float mLevel;
50 
51  void drawTextures(Matrix4f &perspectiveMatrix, Matrix4f &viewingMatrix, bool mode2D);
52 };
53 
54 }
fast::Renderer
Definition: Renderer.hpp:14
fast
Definition: AffineTransformation.hpp:7
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
Renderer.hpp
fast::ImagePyramidRenderer
Definition: ImagePyramidRenderer.hpp:11