comparison OrthancStone/Sources/OpenGL/OpenGLTexture.cpp @ 2047:0b596428e60c deep-learning

added OpenGLTexture::GetFormat()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Mar 2023 11:00:55 +0100
parents 98b44468332e
children a05b03f45289
comparison
equal deleted inserted replaced
2046:98b44468332e 2047:0b596428e60c
34 { 34 {
35 OpenGLTexture::OpenGLTexture(OpenGL::IOpenGLContext& context) : 35 OpenGLTexture::OpenGLTexture(OpenGL::IOpenGLContext& context) :
36 texture_(0), 36 texture_(0),
37 width_(0), 37 width_(0),
38 height_(0), 38 height_(0),
39 format_(Orthanc::PixelFormat_Grayscale8),
39 context_(context) 40 context_(context)
40 { 41 {
41 if (!context_.IsContextLost()) 42 if (!context_.IsContextLost())
42 { 43 {
43 // Generate a texture object 44 // Generate a texture object
104 glBindTexture(GL_TEXTURE_2D, texture_); 105 glBindTexture(GL_TEXTURE_2D, texture_);
105 106
106 GLenum sourceFormat, internalFormat, pixelType; 107 GLenum sourceFormat, internalFormat, pixelType;
107 ConvertToOpenGLFormats(sourceFormat, internalFormat, pixelType, format); 108 ConvertToOpenGLFormats(sourceFormat, internalFormat, pixelType, format);
108 109
110 format_ = format;
109 width_ = width; 111 width_ = width;
110 height_ = height; 112 height_ = height;
111 113
112 GLint interpolation = (isLinearInterpolation ? GL_LINEAR : GL_NEAREST); 114 GLint interpolation = (isLinearInterpolation ? GL_LINEAR : GL_NEAREST);
113 115