Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/OpenGL/OpenGLTexture.h @ 2060:86e0e92a2e0d deep-learning
added OpenGLTextureArray and OpenGLFramebuffer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 May 2023 16:15:50 +0200 |
parents | c0627145b441 |
children | fdb012c86a75 |
comparison
equal
deleted
inserted
replaced
2059:f7cbc58ff44d | 2060:86e0e92a2e0d |
---|---|
35 { | 35 { |
36 namespace OpenGL | 36 namespace OpenGL |
37 { | 37 { |
38 class OpenGLTexture : public boost::noncopyable | 38 class OpenGLTexture : public boost::noncopyable |
39 { | 39 { |
40 friend class OpenGLFramebuffer; | |
41 | |
40 private: | 42 private: |
41 GLuint texture_; | 43 OpenGL::IOpenGLContext& context_; |
42 unsigned int width_; | 44 GLuint texture_; |
43 unsigned int height_; | 45 unsigned int width_; |
44 | 46 unsigned int height_; |
45 Orthanc::PixelFormat format_; | 47 Orthanc::PixelFormat format_; |
46 OpenGL::IOpenGLContext& context_; | |
47 bool isLinearInterpolation_; | 48 bool isLinearInterpolation_; |
48 | 49 |
49 void Setup(Orthanc::PixelFormat format, | 50 void Setup(Orthanc::PixelFormat format, |
50 unsigned int width, | 51 unsigned int width, |
51 unsigned int height, | 52 unsigned int height, |
52 bool isLinearInterpolation, | 53 bool isLinearInterpolation, |
53 const void* data); | 54 const void* data); |
54 | |
55 public: | |
56 explicit OpenGLTexture(OpenGL::IOpenGLContext& context); | |
57 | |
58 ~OpenGLTexture(); | |
59 | 55 |
60 /** | 56 /** |
61 * Returns the low-level OpenGL handle of the texture. Beware to | 57 * Returns the low-level OpenGL handle of the texture. Beware to |
62 * never change the size of the texture using this handle! | 58 * never change the size of the texture using this handle! |
63 **/ | 59 **/ |
64 GLuint GetId() const | 60 GLuint GetId() const |
65 { | 61 { |
66 return texture_; | 62 return texture_; |
67 } | 63 } |
64 | |
65 public: | |
66 explicit OpenGLTexture(OpenGL::IOpenGLContext& context); | |
67 | |
68 ~OpenGLTexture(); | |
68 | 69 |
69 Orthanc::PixelFormat GetFormat() const | 70 Orthanc::PixelFormat GetFormat() const |
70 { | 71 { |
71 return format_; | 72 return format_; |
72 } | 73 } |