comparison OrthancStone/Sources/OpenGL/OpenGLTextureArray.cpp @ 2066:cf3d85eb291c deep-learning

added class OpenGLTextureVolume
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 May 2023 17:18:14 +0200
parents 15f2e52835a1
children
comparison
equal deleted inserted replaced
2065:15f2e52835a1 2066:cf3d85eb291c
185 if (image.GetWidth() != width_ || 185 if (image.GetWidth() != width_ ||
186 image.GetHeight() != height_) 186 image.GetHeight() != height_)
187 { 187 {
188 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageSize); 188 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageSize);
189 } 189 }
190 190 else if (layer >= depth_)
191 if (layer >= depth_)
192 { 191 {
193 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 192 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
194 } 193 }
195 194 else if (image.GetPitch() != Orthanc::GetBytesPerPixel(format_) * width_)
196 if (width_ != 0 && 195 {
197 height_ != 0) 196 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Minimal pitch is required for upload");
197 }
198 else if (width_ != 0 &&
199 height_ != 0)
198 { 200 {
199 GLenum sourceFormat, internalFormat, pixelType; 201 GLenum sourceFormat, internalFormat, pixelType;
200 OpenGLTexture::ConvertToOpenGLFormats(sourceFormat, internalFormat, pixelType, image.GetFormat()); 202 OpenGLTexture::ConvertToOpenGLFormats(sourceFormat, internalFormat, pixelType, image.GetFormat());
201 203
202 glBindTexture(GL_TEXTURE_2D_ARRAY, texture_); 204 glBindTexture(GL_TEXTURE_2D_ARRAY, texture_);