using a rgbswap for the moment
This commit is contained in:
parent
7837ff6c8c
commit
3e32a14264
|
@ -63,7 +63,11 @@ namespace
|
||||||
to the quickeffects module.
|
to the quickeffects module.
|
||||||
*/
|
*/
|
||||||
setShaderFileName( VertexStage, ":/shaders/blur.vert.qsb" );
|
setShaderFileName( VertexStage, ":/shaders/blur.vert.qsb" );
|
||||||
|
#if 0
|
||||||
setShaderFileName( FragmentStage, ":/shaders/blur.frag.qsb" );
|
setShaderFileName( FragmentStage, ":/shaders/blur.frag.qsb" );
|
||||||
|
#else
|
||||||
|
setShaderFileName( FragmentStage, ":/shaders/rgbswap.frag.qsb" );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool updateUniformData( RenderState& state,
|
bool updateUniformData( RenderState& state,
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <QskGraphicLabel.h>
|
#include <QskGraphicLabel.h>
|
||||||
#include <QskGraphic.h>
|
#include <QskGraphic.h>
|
||||||
#include <QskEvent.h>
|
#include <QskEvent.h>
|
||||||
|
#include <QskRgbValue.h>
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -22,6 +23,17 @@
|
||||||
|
|
||||||
#include "Overlay.h"
|
#include "Overlay.h"
|
||||||
|
|
||||||
|
class Image : public QskGraphicLabel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Image( QQuickItem* parent = nullptr )
|
||||||
|
: QskGraphicLabel( parent )
|
||||||
|
{
|
||||||
|
const QImage image( ":/images/parrots.jpg" );
|
||||||
|
setGraphic( QskGraphic::fromImage( image ) );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class ForegroundItem : public QskLinearBox
|
class ForegroundItem : public QskLinearBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -31,10 +43,7 @@ class ForegroundItem : public QskLinearBox
|
||||||
setMargins( 20 );
|
setMargins( 20 );
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
auto label = new QskGraphicLabel( this );
|
auto label = new Image( this );
|
||||||
|
|
||||||
const QImage image( ":/images/parrots.jpg" );
|
|
||||||
label->setGraphic( QskGraphic::fromImage( image ) );
|
|
||||||
label->setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
label->setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||||
label->setLayoutAlignmentHint( Qt::AlignCenter );
|
label->setLayoutAlignmentHint( Qt::AlignCenter );
|
||||||
label->setObjectName( "miniParrots" );
|
label->setObjectName( "miniParrots" );
|
||||||
|
@ -86,16 +95,15 @@ class BackgroundItem : public QskControl
|
||||||
BackgroundItem( QQuickItem* parent = nullptr )
|
BackgroundItem( QQuickItem* parent = nullptr )
|
||||||
: QskControl( parent )
|
: QskControl( parent )
|
||||||
{
|
{
|
||||||
m_label = new QskGraphicLabel( this );
|
setObjectName( "background" );
|
||||||
m_label->setFillMode( QskGraphicLabel::Stretch );
|
|
||||||
|
|
||||||
const QImage image( ":/images/parrots.jpg" );
|
#if 1
|
||||||
m_label->setGraphic( QskGraphic::fromImage( image ) );
|
m_label = new Image( this );
|
||||||
|
m_label->setFillMode( QskGraphicLabel::Stretch );
|
||||||
|
m_label->setObjectName( "parrots" );
|
||||||
|
#endif
|
||||||
|
|
||||||
startTimer( 20 );
|
startTimer( 20 );
|
||||||
|
|
||||||
setObjectName( "background" );
|
|
||||||
m_label->setObjectName( "parrots" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -127,11 +135,12 @@ class BackgroundItem : public QskControl
|
||||||
labelRect.adjust( margin, margin, -margin, -margin );
|
labelRect.adjust( margin, margin, -margin, -margin );
|
||||||
labelRect.translate( margin * x, margin * y );
|
labelRect.translate( margin * x, margin * y );
|
||||||
|
|
||||||
m_label->setGeometry( labelRect );
|
if ( m_label )
|
||||||
|
m_label->setGeometry( labelRect );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QskGraphicLabel* m_label;
|
QskGraphicLabel* m_label = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MainView : public QskControl
|
class MainView : public QskControl
|
||||||
|
@ -146,8 +155,8 @@ class MainView : public QskControl
|
||||||
#if 0
|
#if 0
|
||||||
{
|
{
|
||||||
auto box = new QskBox( m_background );
|
auto box = new QskBox( m_background );
|
||||||
box->setGeometry( 0, 0, 600, 400 );
|
box->setGeometry( 20, 20, 600, 400 );
|
||||||
box->setFillGradient( Qt::darkRed );
|
box->setFillGradient( QskRgb::SaddleBrown );
|
||||||
box->setObjectName( "redBox" );
|
box->setObjectName( "redBox" );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -158,7 +167,7 @@ class MainView : public QskControl
|
||||||
{
|
{
|
||||||
auto box = new QskBox( m_background );
|
auto box = new QskBox( m_background );
|
||||||
box->setGeometry( 50, 50, 400, 200 );
|
box->setGeometry( 50, 50, 400, 200 );
|
||||||
box->setFillGradient( Qt::darkBlue );
|
box->setFillGradient( QskRgb::PaleGreen );
|
||||||
box->setObjectName( "blueBox" );
|
box->setObjectName( "blueBox" );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,5 +6,7 @@
|
||||||
|
|
||||||
<file>shaders/blur.vert.qsb</file>
|
<file>shaders/blur.vert.qsb</file>
|
||||||
<file>shaders/blur.frag.qsb</file>
|
<file>shaders/blur.frag.qsb</file>
|
||||||
|
|
||||||
|
<file>shaders/rgbswap.frag.qsb</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#version 440
|
||||||
|
|
||||||
|
layout( location = 0 ) in vec2 coord;
|
||||||
|
layout( location = 0 ) out vec4 fragColor;
|
||||||
|
|
||||||
|
layout( binding = 1 ) uniform sampler2D source;
|
||||||
|
|
||||||
|
layout( std140, binding = 0 ) uniform buf
|
||||||
|
{
|
||||||
|
mat4 matrix;
|
||||||
|
float opacity;
|
||||||
|
} ubuf;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec4 c = texture( source, coord );
|
||||||
|
fragColor = c.yzxw * ubuf.opacity;;
|
||||||
|
}
|
Binary file not shown.
|
@ -7,3 +7,4 @@ function qsbcompile {
|
||||||
|
|
||||||
qsbcompile blur-vulkan.vert
|
qsbcompile blur-vulkan.vert
|
||||||
qsbcompile blur-vulkan.frag
|
qsbcompile blur-vulkan.frag
|
||||||
|
qsbcompile rgbswap-vulkan.frag
|
||||||
|
|
Loading…
Reference in New Issue