From 21b4e0934cc91010187f97c4f3b33bae3d3bf714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Sun, 25 Aug 2024 17:55:47 +0200 Subject: [PATCH] Set GL_UNPACK_ALIGNMENT --- imagescrollareagl.cpp | 5 +---- imagescrollareagl.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/imagescrollareagl.cpp b/imagescrollareagl.cpp index 8e57155..98969d7 100644 --- a/imagescrollareagl.cpp +++ b/imagescrollareagl.cpp @@ -144,9 +144,7 @@ void ImageWidget::setImage(std::shared_ptr image, int index) m_image->allocateStorage(); m_image->setMinMagFilters(QOpenGLTexture::LinearMipMapLinear, QOpenGLTexture::Linear); m_image->setWrapMode(QOpenGLTexture::ClampToEdge); - //m_image->setBorderColor(0, 0, 0, 0); m_image->setData(0, rawImageType.pixelFormat, rawImageType.dataType, (const void*)image->data()); - //m_image->generateMipMaps(); m_image->bind(); f->glGenerateMipmap(GL_TEXTURE_2D); qDebug() << "setImage" << timer.elapsed(); @@ -598,8 +596,7 @@ void ImageWidget::initializeGL() m_thumbnailTexture = std::unique_ptr(new QOpenGLTexture(QOpenGLTexture::Target2DArray)); - m_transferOptions = std::unique_ptr(new QOpenGLPixelTransferOptions); - m_transferOptions->setAlignment(1); + f->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); m_lut = std::make_unique(QOpenGLTexture::Target3D); m_lut->setSize(LUT_SIZE, LUT_SIZE, LUT_SIZE); diff --git a/imagescrollareagl.h b/imagescrollareagl.h index 5b07b34..a0c1fec 100644 --- a/imagescrollareagl.h +++ b/imagescrollareagl.h @@ -40,7 +40,6 @@ class ImageWidget : public QOpenGLWidget std::unique_ptr m_image; std::unique_ptr m_vao; std::unique_ptr m_vaoThumb; - std::unique_ptr m_transferOptions; std::unique_ptr m_thumbnailTexture; std::unique_ptr m_lut; GLuint m_debayerTex = 0;