Fix for nVidia
This commit is contained in:
+3
-3
@@ -1,9 +1,10 @@
|
|||||||
#version 130
|
#version 130
|
||||||
|
|
||||||
uniform sampler2D qt_Texture0;
|
uniform sampler2D qt_Texture0;
|
||||||
varying vec2 qt_TexCoord0;
|
out vec2 qt_TexCoord0;
|
||||||
uniform vec3 mtf_param;
|
uniform vec3 mtf_param;
|
||||||
uniform bool bw;
|
uniform bool bw;
|
||||||
|
out vec4 color;
|
||||||
|
|
||||||
vec4 MTF(vec4 x, vec3 m)
|
vec4 MTF(vec4 x, vec3 m)
|
||||||
{
|
{
|
||||||
@@ -14,11 +15,10 @@ vec4 MTF(vec4 x, vec3 m)
|
|||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
vec4 color = texture2D(qt_Texture0, qt_TexCoord0);
|
color = texture2D(qt_Texture0, qt_TexCoord0);
|
||||||
if(bw)color = color.rrra;
|
if(bw)color = color.rrra;
|
||||||
color = MTF(color, mtf_param);
|
color = MTF(color, mtf_param);
|
||||||
|
|
||||||
if(any(lessThan(qt_TexCoord0, vec2(0.0))) || any(greaterThan(qt_TexCoord0, vec2(1.0))))
|
if(any(lessThan(qt_TexCoord0, vec2(0.0))) || any(greaterThan(qt_TexCoord0, vec2(1.0))))
|
||||||
color = vec4(0.0);
|
color = vec4(0.0);
|
||||||
gl_FragColor = color;
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
#version 130
|
#version 130
|
||||||
|
|
||||||
uniform sampler2D qt_Texture0;
|
uniform sampler2D qt_Texture0;
|
||||||
attribute vec2 qt_Vertex;
|
in vec2 qt_Vertex;
|
||||||
attribute vec2 qt_MultiTexCoord0;
|
in vec2 qt_MultiTexCoord0;
|
||||||
varying vec2 qt_TexCoord0;
|
out vec2 qt_TexCoord0;
|
||||||
uniform vec2 viewport;
|
uniform vec2 viewport;
|
||||||
uniform vec2 offset;
|
uniform vec2 offset;
|
||||||
uniform float zoom;
|
uniform float zoom;
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ void ImageWidget::resizeGL(int w, int h)
|
|||||||
|
|
||||||
void ImageWidget::initializeGL()
|
void ImageWidget::initializeGL()
|
||||||
{
|
{
|
||||||
f = context()->functions();
|
f = context()->versionFunctions<QOpenGLFunctions_3_0>();
|
||||||
f->glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
|
f->glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
|
||||||
|
|
||||||
m_vao = std::unique_ptr<QOpenGLVertexArrayObject>(new QOpenGLVertexArrayObject);
|
m_vao = std::unique_ptr<QOpenGLVertexArrayObject>(new QOpenGLVertexArrayObject);
|
||||||
@@ -209,6 +209,7 @@ void ImageWidget::initializeGL()
|
|||||||
m_program = std::unique_ptr<QOpenGLShaderProgram>(new QOpenGLShaderProgram);
|
m_program = std::unique_ptr<QOpenGLShaderProgram>(new QOpenGLShaderProgram);
|
||||||
m_program->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/shaders/image.vert");
|
m_program->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/shaders/image.vert");
|
||||||
m_program->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shaders/image.frag");
|
m_program->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shaders/image.frag");
|
||||||
|
f->glBindFragDataLocation(m_program->programId(), 0, "color");
|
||||||
if(!m_program->link())
|
if(!m_program->link())
|
||||||
{
|
{
|
||||||
qDebug() << "Link failed" << m_program->log();
|
qDebug() << "Link failed" << m_program->log();
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QOpenGLWidget>
|
#include <QOpenGLWidget>
|
||||||
#include <QOpenGLFunctions>
|
#include <QOpenGLFunctions_3_0>
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
#include <QOpenGLBuffer>
|
#include <QOpenGLBuffer>
|
||||||
#include <QOpenGLTexture>
|
#include <QOpenGLTexture>
|
||||||
@@ -24,7 +24,7 @@ typedef enum
|
|||||||
class ImageWidget : public QOpenGLWidget
|
class ImageWidget : public QOpenGLWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QOpenGLFunctions *f;
|
QOpenGLFunctions_3_0 *f;
|
||||||
std::unique_ptr<QOpenGLShaderProgram> m_program;
|
std::unique_ptr<QOpenGLShaderProgram> m_program;
|
||||||
std::unique_ptr<QOpenGLBuffer> m_buffer;
|
std::unique_ptr<QOpenGLBuffer> m_buffer;
|
||||||
std::unique_ptr<QOpenGLTexture> m_image;
|
std::unique_ptr<QOpenGLTexture> m_image;
|
||||||
|
|||||||
+1
-1
@@ -122,7 +122,7 @@ bool loadRAW(QString path, ImageInfoData &info, RawImage **image)
|
|||||||
info.append(StringPair(QObject::tr("ISO"), QString::number(raw.imgdata.other.iso_speed)));
|
info.append(StringPair(QObject::tr("ISO"), QString::number(raw.imgdata.other.iso_speed)));
|
||||||
info.append(StringPair(QObject::tr("Shutter speed"), shutterSpeed));
|
info.append(StringPair(QObject::tr("Shutter speed"), shutterSpeed));
|
||||||
#if LIBRAW_MINOR_VERSION>=19
|
#if LIBRAW_MINOR_VERSION>=19
|
||||||
info.append(StringPair(QObject::tr("Camera temperature"), QString::number(raw.imgdata.other.CameraTemperature)));
|
// info.append(StringPair(QObject::tr("Camera temperature"), QString::number(raw.imgdata.other.CameraTemperature)));
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
|
#include <QPainterPath>
|
||||||
|
|
||||||
static float clamp(float x)
|
static float clamp(float x)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user