Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates to support harbour, chum and SFOS 4.4 Sailjail requirements. #55

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Added some more filters for testing.
On image insert, the image Red and Blue channel are swapped. Now you can
swap em back:)
  • Loading branch information
poetaster committed May 2, 2022
commit f5f199e7f4fc163cb5c773cf1c198670ceb7fe78
5 changes: 4 additions & 1 deletion paint.pro
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,8 @@ TRANSLATIONS += i18n/*.ts
RESOURCES +=

DISTFILES += \
qml/components/ClipboardCanvas.qml
qml/components/ClipboardCanvas.qml \
qml/glsl/swap_RGB-BGR.frag \
qml/glsl/swap_RGB-GBR.frag \
qml/glsl/swap_RGB-RBG.frag

16 changes: 16 additions & 0 deletions qml/glsl/swap_RGB-BGR.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Swap color channels RGB --> BGR

precision mediump float;

uniform sampler2D source;
uniform sampler2D mask;
varying highp vec2 qt_TexCoord0;
uniform lowp float qt_Opacity;

void main(void)
{
if (texture2D(mask, qt_TexCoord0.st).a > 0.5)
gl_FragColor = texture2D(source, qt_TexCoord0.st).bgra * qt_Opacity;
else
gl_FragColor = texture2D(source, qt_TexCoord0.st) * qt_Opacity;
}
16 changes: 16 additions & 0 deletions qml/glsl/swap_RGB-GBR.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Swap color channels RGB --> GBR

precision mediump float;

uniform sampler2D source;
uniform sampler2D mask;
varying highp vec2 qt_TexCoord0;
uniform lowp float qt_Opacity;

void main(void)
{
if (texture2D(mask, qt_TexCoord0.st).a > 0.5)
gl_FragColor = texture2D(source, qt_TexCoord0.st).gbra * qt_Opacity;
else
gl_FragColor = texture2D(source, qt_TexCoord0.st) * qt_Opacity;
}
16 changes: 16 additions & 0 deletions qml/glsl/swap_RGB-RBG.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Swap color channels RGB --> RBG

precision mediump float;

uniform sampler2D source;
uniform sampler2D mask;
varying highp vec2 qt_TexCoord0;
uniform lowp float qt_Opacity;

void main(void)
{
if (texture2D(mask, qt_TexCoord0.st).a > 0.5)
gl_FragColor = texture2D(source, qt_TexCoord0.st).rbga * qt_Opacity;
else
gl_FragColor = texture2D(source, qt_TexCoord0.st) * qt_Opacity;
}