🔀 Merge pull request #208 from Schneegans/feature/pixel-effects

This commit is contained in:
Simon Schneegans
2022-09-02 21:04:17 +02:00
committed by GitHub
69 changed files with 1245 additions and 18 deletions
+4
View File
@@ -32,6 +32,8 @@ Effect | Preview
**Incinerate** <br> A less snappy but definitely more fancy take on the fire effect. | <img src ="docs/pics/incinerate.gif" /> **Incinerate** <br> A less snappy but definitely more fancy take on the fire effect. | <img src ="docs/pics/incinerate.gif" />
**Matrix** <br> Turn your windows into a shower of green letters! The color is actually configurable.| <img src ="docs/pics/matrix.gif" /> **Matrix** <br> Turn your windows into a shower of green letters! The color is actually configurable.| <img src ="docs/pics/matrix.gif" />
**Pixelate** <br> Pixelate your windows and randomly hide pixels until the entire window is gone.| <img src ="docs/pics/pixelate.gif" /> **Pixelate** <br> Pixelate your windows and randomly hide pixels until the entire window is gone.| <img src ="docs/pics/pixelate.gif" />
**Pixel Wheel** <br> This simple effect pixelates the window and hides the pixels in a wheel-like fashion.| <img src ="docs/pics/pixel-wheel.gif" />
**Pixel Wipe** <br> This effect pixelates the window and hides the pixels radially, starting from the pointer position.| <img src ="docs/pics/pixel-wipe.gif" />
**Snap of Disintegration** <br> Dissolve your windows into a cloud of dust.| <img src ="docs/pics/snap.gif" /> **Snap of Disintegration** <br> Dissolve your windows into a cloud of dust.| <img src ="docs/pics/snap.gif" />
**T-Rex Attack** <br> Destroy your windows with a series of violent slashes!| <img src ="docs/pics/trex.gif" /> **T-Rex Attack** <br> Destroy your windows with a series of violent slashes!| <img src ="docs/pics/trex.gif" />
**TV-Effect** <br> This is a very simple effect to demonstrate that this extension could also be used in a more professional environment. | <img src ="docs/pics/tv.gif" /> **TV-Effect** <br> This is a very simple effect to demonstrate that this extension could also be used in a more professional environment. | <img src ="docs/pics/tv.gif" />
@@ -60,6 +62,8 @@ Below is a table which summarizes the current availability for all effects.
<tr><td>Incinerate</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr> <tr><td>Incinerate</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Matrix</td> <td> </td> <td> </td> <td>✅</td><td>✅</td><td>✅</td><td> </td> </tr> <tr><td>Matrix</td> <td> </td> <td> </td> <td>✅</td><td>✅</td><td>✅</td><td> </td> </tr>
<tr><td>Pixelate</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr> <tr><td>Pixelate</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Pixel Wheel</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Pixel Wipe</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Snap of Disintegration</td> <td> </td> <td> </td> <td>✅</td><td>✅</td><td>✅</td><td> </td> </tr> <tr><td>Snap of Disintegration</td> <td> </td> <td> </td> <td>✅</td><td>✅</td><td>✅</td><td> </td> </tr>
<tr><td>T-Rex Attack</td> <td> </td> <td> </td> <td>✅</td><td>✅</td><td>✅</td><td> </td> </tr> <tr><td>T-Rex Attack</td> <td> </td> <td> </td> <td>✅</td><td>✅</td><td>✅</td><td> </td> </tr>
<tr><td>TV-Effect</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr> <tr><td>TV-Effect</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
+2
View File
@@ -8,6 +8,8 @@
* **New Effect: Doom.** Melt your windows. Inspired by the legendary screen transitions of the original Doom. * **New Effect: Doom.** Melt your windows. Inspired by the legendary screen transitions of the original Doom.
* **New Effect: Pixelate.** Pixelate your windows and randomly hide pixels until the entire window is gone. * **New Effect: Pixelate.** Pixelate your windows and randomly hide pixels until the entire window is gone.
* **New Effect: Pixel Wheel.** This simple effect pixelates the window and hides the pixels in a wheel-like fashion.
* **New Effect: Pixel Wipe.** This effect pixelates the window and hides the pixels radially, starting from the pointer position.
#### Enhancements #### Enhancements
Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 KiB

+2
View File
@@ -60,6 +60,8 @@ class Extension {
new Me.imports.src.Incinerate.Incinerate(), new Me.imports.src.Incinerate.Incinerate(),
new Me.imports.src.Matrix.Matrix(), new Me.imports.src.Matrix.Matrix(),
new Me.imports.src.Pixelate.Pixelate(), new Me.imports.src.Pixelate.Pixelate(),
new Me.imports.src.PixelWheel.PixelWheel(),
new Me.imports.src.PixelWipe.PixelWipe(),
new Me.imports.src.SnapOfDisintegration.SnapOfDisintegration(), new Me.imports.src.SnapOfDisintegration.SnapOfDisintegration(),
new Me.imports.src.TRexAttack.TRexAttack(), new Me.imports.src.TRexAttack.TRexAttack(),
new Me.imports.src.TVEffect.TVEffect(), new Me.imports.src.TVEffect.TVEffect(),
+11 -9
View File
@@ -128,15 +128,17 @@ generate() {
# window canvas during the animation. # window canvas during the animation.
#generate "apparition" "[BMW] Apparition" "This effect hides your windows by violently sucking them into the void of magic" #generate "apparition" "[BMW] Apparition" "This effect hides your windows by violently sucking them into the void of magic"
generate "energize-a" "Energize A [Burn-My-Windows]" "Beam your windows away" generate "energize-a" "Energize A [Burn-My-Windows]" "Beam your windows away"
generate "energize-b" "Energize B [Burn-My-Windows]" "Using different transporter technology results in an alternative visual effect" generate "energize-b" "Energize B [Burn-My-Windows]" "Using different transporter technology results in an alternative visual effect"
generate "doom" "Doom [Burn-My-Windows]" "Melt your windows" generate "doom" "Doom [Burn-My-Windows]" "Melt your windows"
generate "fire" "Fire [Burn-My-Windows]" "The classic effect inspired by Compiz" generate "fire" "Fire [Burn-My-Windows]" "The classic effect inspired by Compiz"
generate "hexagon" "Hexagon [Burn-My-Windows]" "With glowing lines and hexagon-shaped tiles, this effect looks very sci-fi" generate "hexagon" "Hexagon [Burn-My-Windows]" "With glowing lines and hexagon-shaped tiles, this effect looks very sci-fi"
generate "incinerate" "Incinerate [Burn-My-Windows]" "A less snappy but definitely more fancy take on the fire effect" generate "incinerate" "Incinerate [Burn-My-Windows]" "A less snappy but definitely more fancy take on the fire effect"
generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and randomly hide the pixels" generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and randomly hide the pixels"
generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV" generate "pixel-wheel" "Pixel Wheel [Burn-My-Windows]" "Pixelate the window and hide the pixels in a wheel-like fashion"
generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies" generate "pixel-wipe" "Pixel Wipe [Burn-My-Windows]" "Pixelate the window and hide the pixels radially, starting from the pointer position"
generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV"
generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies"
# Finally, create an archive for the effects. # Finally, create an archive for the effects.
# shellcheck disable=SC2046 # shellcheck disable=SC2046
+3 -3
View File
@@ -7,10 +7,10 @@ let startPos = seed[0] > seed[1] ? [seed[0], Math.floor(seed[1] + 0.5)] :
if (effect.readConfig('UsePointer', true)) { if (effect.readConfig('UsePointer', true)) {
startPos = [ startPos = [
(effects.cursorPos.x - window.x) / window.width, Math.min(1.0, Math.max(0.0, (effects.cursorPos.x - window.x) / window.width)),
(effects.cursorPos.y - window.y) / window.height Math.min(1.0, Math.max(0.0, (effects.cursorPos.y - window.y) / window.height))
]; ];
} }
effect.setUniform(this.shader, 'uSeed', seed); effect.setUniform(this.shader, 'uSeed', seed);
effect.setUniform(this.shader, 'uStartPos', startPos); effect.setUniform(this.shader, 'uStartPos', startPos);
+90
View File
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BMWConfigForm</class>
<widget class="QWidget" name="BMWConfigForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>562</width>
<height>365</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Duration:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Pixel Size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="kcfg_Duration">
<property name="suffix">
<string> milliseconds</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Spoke Count</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="kcfg_PixelSize">
<property name="decimals">
<number>0</number>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>50.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="kcfg_SpokeCount">
<property name="decimals">
<number>0</number>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>50.000000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
<resources />
<connections />
</ui>
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name="" />
<group name="">
<entry name="Duration" type="UInt">
<default>300</default>
</entry>
<entry name="SpokeCount" type="UInt">
<default>12</default>
</entry>
<entry name="PixelSize" type="UInt">
<default>10</default>
</entry>
</group>
</kcfg>
+6
View File
@@ -0,0 +1,6 @@
// This part is automatically included in the effect's source during the build process.
// The code below is called whenever the user changes something in the configuration of
// the effect.
effect.setUniform(this.shader, 'uSpokeCount', effect.readConfig('SpokeCount', 1.0));
effect.setUniform(this.shader, 'uPixelSize', effect.readConfig('PixelSize', 1.0));
+67
View File
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BMWConfigForm</class>
<widget class="QWidget" name="BMWConfigForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>562</width>
<height>365</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Duration:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Pixel Size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="kcfg_Duration">
<property name="suffix">
<string> milliseconds</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="kcfg_PixelSize">
<property name="decimals">
<number>0</number>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>50.000000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
<resources />
<connections />
</ui>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name="" />
<group name="">
<entry name="Duration" type="UInt">
<default>1000</default>
</entry>
<entry name="PixelSize" type="UInt">
<default>10</default>
</entry>
</group>
</kcfg>
+9
View File
@@ -0,0 +1,9 @@
// This part is automatically included in the effect's source during the build process.
// The code below is called whenever a window is closed or opened.
let startPos = [
Math.min(1.0, Math.max(0.0, (effects.cursorPos.x - window.x) / window.width)),
Math.min(1.0, Math.max(0.0, (effects.cursorPos.y - window.y) / window.height))
];
effect.setUniform(this.shader, 'uStartPos', startPos);
+5
View File
@@ -0,0 +1,5 @@
// This part is automatically included in the effect's source during the build process.
// The code below is called whenever the user changes something in the configuration of
// the effect.
effect.setUniform(this.shader, 'uPixelSize', effect.readConfig('PixelSize', 1.0));
+2
View File
@@ -56,6 +56,8 @@ var PreferencesDialog = class PreferencesDialog {
new Me.imports.src.Incinerate.Incinerate(), new Me.imports.src.Incinerate.Incinerate(),
new Me.imports.src.Matrix.Matrix(), new Me.imports.src.Matrix.Matrix(),
new Me.imports.src.Pixelate.Pixelate(), new Me.imports.src.Pixelate.Pixelate(),
new Me.imports.src.PixelWheel.PixelWheel(),
new Me.imports.src.PixelWipe.PixelWipe(),
new Me.imports.src.SnapOfDisintegration.SnapOfDisintegration(), new Me.imports.src.SnapOfDisintegration.SnapOfDisintegration(),
new Me.imports.src.TRexAttack.TRexAttack(), new Me.imports.src.TRexAttack.TRexAttack(),
new Me.imports.src.TVEffect.TVEffect(), new Me.imports.src.TVEffect.TVEffect(),
+1
View File
@@ -142,6 +142,7 @@ vec3 tritone(float val, vec3 shadows, vec3 midtones, vec3 highlights) {
// https://gitlab.gnome.org/GNOME/mutter/-/blob/main/clutter/clutter/clutter-easing.c // https://gitlab.gnome.org/GNOME/mutter/-/blob/main/clutter/clutter/clutter-easing.c
float easeOutQuad(float x) { return -1.0 * x * (x - 2.0); } float easeOutQuad(float x) { return -1.0 * x * (x - 2.0); }
float easeInQuad(float x) { return x * x; }
// --------------------------------------------------------------------- edge mask helpers // --------------------------------------------------------------------- edge mask helpers
+46
View File
@@ -0,0 +1,46 @@
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
// Copyright (c) 2021 Simon Schneegans //
// Released under the GPLv3 or later. See LICENSE file for details. //
//////////////////////////////////////////////////////////////////////////////////////////
// The content from common.glsl is automatically prepended to each shader effect.
uniform float uPixelSize;
uniform float uSpokeCount;
void main() {
// We simply inverse the progress for opening windows.
float progress = smoothstep(0.0, 1.0, uForOpening ? 1.0 - uProgress : uProgress);
// The current level of pixelation increases with the progress.
float pixelSize = ceil(uPixelSize * progress + 1.0);
vec2 pixelGrid = vec2(pixelSize) / uSize;
vec2 texcoord = iTexCoord.st - mod(iTexCoord.st, pixelGrid) + pixelGrid * 0.5;
vec4 oColor = getInputColor(texcoord);
// Now hide the spoke sections.
vec2 down = vec2(0.0, 1.0);
vec2 fragDir = normalize(texcoord - 0.5);
// Compute angle to down direction.
float angle = 0.5 * acos(dot(down, fragDir)) / 3.14159265359;
if (fragDir.x < 0.0) {
angle = 1.0 - angle;
}
// Progressively hide the spokes.
float threshold = mod(angle * uSpokeCount, 1.0);
if (progress > threshold) {
oColor.a = 0.0;
}
setOutputColor(oColor);
}
+51
View File
@@ -0,0 +1,51 @@
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
// Copyright (c) 2021 Simon Schneegans //
// Released under the GPLv3 or later. See LICENSE file for details. //
//////////////////////////////////////////////////////////////////////////////////////////
// The content from common.glsl is automatically prepended to each shader effect.
uniform float uPixelSize;
uniform vec2 uStartPos;
const float FADE_WIDTH = 1.0; // Width of the transition.
void main() {
// Now we compute a 2D gradient in [0..1] which covers the entire window. The dark
// regions will be burned first, the bright regions in the end. We mix a radial gradient
// with some noise. The center of the radial gradient is positioned at uStartPos.
float circle = length(iTexCoord - uStartPos);
float progress = easeOutQuad(uProgress);
progress = ((1.0 - progress) * (1.0 + FADE_WIDTH) - 1.0 + circle) / FADE_WIDTH;
progress = smoothstep(0.0, 1.0, progress);
progress = uForOpening ? progress : 1.0 - progress;
// The current level of pixelation increases with the progress.
float pixelSize = ceil(uPixelSize * progress + 1.0);
vec2 pixelGrid = vec2(pixelSize) / uSize;
vec2 texcoord = iTexCoord.st - mod(iTexCoord.st, pixelGrid) + pixelGrid * 0.5;
vec4 oColor = getInputColor(texcoord);
// Hide pixels in the transition zone.
float random = simplex2DFractal(texcoord * uSize / 20.0) * 1.5 - 0.25;
if (progress > random) {
oColor.a *= max(0.0, 1.0 - (progress - random) * 10.0);
}
// These are pretty useful for understanding how this works.
// oColor = vec4(progress, 0.0, 0.0, 1.0);
// oColor = vec4(random, 0.0, 0.0, 1.0);
setOutputColor(oColor);
}
+3 -3
View File
@@ -27,9 +27,9 @@ void main() {
vec4 oColor = getInputColor(texcoord); vec4 oColor = getInputColor(texcoord);
// Hide selected pixels based on some random noise. // Hide selected pixels based on some random noise.
float random = simplex2DFractal(texcoord * uNoise * uSize / 1000.0); float random = simplex2DFractal(texcoord * uNoise * uSize / 1000.0) * 1.5 - 0.25;
if (random * 1.5 - 0.25 < progress) { if (progress > random) {
oColor.a = 0.0; oColor.a *= max(0.0, 1.0 - (progress - random) * 20.0);
} }
setOutputColor(oColor); setOutputColor(oColor);
+192
View File
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="burn-my-windows">
<object class="GtkAdjustment" id="pixel-wheel-animation-time">
<property name="upper">2000</property>
<property name="lower">100</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
<object class="GtkAdjustment" id="pixel-wheel-spoke-count">
<property name="upper">50</property>
<property name="lower">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="pixel-wheel-pixel-size">
<property name="upper">50</property>
<property name="lower">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkBox" id="pixel-wheel-prefs">
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Animation Time [ms]</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">pixel-wheel-animation-time</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wheel-animation-time">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Spoke Count</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">pixel-wheel-spoke-count</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wheel-spoke-count">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Pixel Size</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">pixel-wheel-pixel-size</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wheel-pixel-size">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
+143
View File
@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="burn-my-windows">
<object class="GtkAdjustment" id="pixel-wipe-animation-time">
<property name="upper">5000</property>
<property name="lower">100</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
<object class="GtkAdjustment" id="pixel-wipe-direction">
<property name="upper">360</property>
<property name="lower">0</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="pixel-wipe-pixel-size">
<property name="upper">50</property>
<property name="lower">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkBox" id="pixel-wipe-prefs">
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Animation Time [ms]</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">pixel-wipe-animation-time</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wipe-animation-time">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Pixel Size</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">pixel-wipe-pixel-size</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wipe-pixel-size">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
+163
View File
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="burn-my-windows">
<object class="GtkBox" id="pixel-wheel-prefs">
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Animation Time [ms]</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="pixel-wheel-animation-time">
<property name="upper">2000</property>
<property name="lower">100</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wheel-animation-time">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Spoke Count</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="pixel-wheel-spoke-count">
<property name="upper">50</property>
<property name="lower">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wheel-spoke-count">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Pixel Size</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="pixel-wheel-pixel-size">
<property name="upper">50</property>
<property name="lower">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wheel-pixel-size">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
+117
View File
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="burn-my-windows">
<object class="GtkBox" id="pixel-wipe-prefs">
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Animation Time [ms]</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="pixel-wipe-animation-time">
<property name="upper">5000</property>
<property name="lower">100</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wipe-animation-time">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Pixel Size</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="pixel-wipe-pixel-size">
<property name="upper">50</property>
<property name="lower">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-pixel-wipe-pixel-size">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
@@ -112,12 +112,75 @@
<description>The noise of the effect.</description> <description>The noise of the effect.</description>
</key> </key>
<key name="pixelate-pixel-size" type="d"> <key name="pixelate-pixel-size" type="i">
<default>10</default> <default>10</default>
<summary>Pixelate Pixel Size</summary> <summary>Pixelate Pixel Size</summary>
<description>The size of the maximum pixelation.</description> <description>The size of the maximum pixelation.</description>
</key> </key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Pixel Wipe Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<key name="pixel-wipe-close-effect" type="b">
<default>false</default>
<summary>Pixel Wipe Close Effect</summary>
<description>Use the Pixel Wipe effect for window closing.</description>
</key>
<key name="pixel-wipe-open-effect" type="b">
<default>false</default>
<summary>Pixel Wipe Open Effect</summary>
<description>Use the Pixel Wipe effect for window opening.</description>
</key>
<key name="pixel-wipe-animation-time" type="i">
<default>1000</default>
<summary>Pixel Wipe Animation Time</summary>
<description>The time the Pixel Wipe effect takes.</description>
</key>
<key name="pixel-wipe-pixel-size" type="i">
<default>10</default>
<summary>Pixel Wipe Pixel Size</summary>
<description>The size of the maximum pixelation.</description>
</key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Pixel Wheel Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<key name="pixel-wheel-close-effect" type="b">
<default>false</default>
<summary>Pixel Wheel Close Effect</summary>
<description>Use the Pixel Wheel effect for window closing.</description>
</key>
<key name="pixel-wheel-open-effect" type="b">
<default>false</default>
<summary>Pixel Wheel Open Effect</summary>
<description>Use the Pixel Wheel effect for window opening.</description>
</key>
<key name="pixel-wheel-animation-time" type="i">
<default>300</default>
<summary>Pixel Wheel Animation Time</summary>
<description>The time the Pixel Wheel effect takes.</description>
</key>
<key name="pixel-wheel-spoke-count" type="i">
<default>12</default>
<summary>Pixel Wheel Spoke Count</summary>
<description>The number of sections in the wheel.</description>
</key>
<key name="pixel-wheel-pixel-size" type="d">
<default>10</default>
<summary>Pixel Wheel Pixel Size</summary>
<description>The size of the maximum pixelation.</description>
</key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Doom Options --> <!-- Doom Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -152,7 +215,7 @@
<description>The Y scale of the effect.</description> <description>The Y scale of the effect.</description>
</key> </key>
<key name="doom-pixel-size" type="d"> <key name="doom-pixel-size" type="i">
<default>10</default> <default>10</default>
<summary>Doom Pixel Size</summary> <summary>Doom Pixel Size</summary>
<description>The size of the maximum pixelation.</description> <description>The size of the maximum pixelation.</description>
+102
View File
@@ -0,0 +1,102 @@
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
// Copyright (c) 2021 Simon Schneegans //
// Released under the GPLv3 or later. See LICENSE file for details. //
//////////////////////////////////////////////////////////////////////////////////////////
'use strict';
const GObject = imports.gi.GObject;
const _ = imports.gettext.domain('burn-my-windows').gettext;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
const ShaderFactory = Me.imports.src.ShaderFactory.ShaderFactory;
//////////////////////////////////////////////////////////////////////////////////////////
// This simple effect pixelates the window texture and hides the pixels in a wheel-like //
// fashion. //
//////////////////////////////////////////////////////////////////////////////////////////
// The effect class can be used to get some metadata (like the effect's name or supported
// GNOME Shell versions), to initialize the respective page of the settings dialog, as
// well as to create the actual shader for the effect.
var PixelWheel = class {
// The constructor creates a ShaderFactory which will be used by extension.js to create
// shader instances for this effect. The shaders will be automagically created using the
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance.
constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => {
// Store uniform locations of newly created shaders.
shader._uPixelSize = shader.get_uniform_location('uPixelSize');
shader._uSpokeCount = shader.get_uniform_location('uSpokeCount');
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings) => {
// clang-format off
shader.set_uniform_float(shader._uPixelSize, 1, [settings.get_double('pixel-wheel-pixel-size')]);
shader.set_uniform_float(shader._uSpokeCount, 1, [settings.get_int('pixel-wheel-spoke-count')]);
// clang-format on
});
});
}
// ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() {
return [3, 36];
}
// This will be called in various places where a unique identifier for this effect is
// required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-close-effect'), and its animation time
// (e.g. '*-animation-time').
getNick() {
return 'pixel-wheel';
}
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
getLabel() {
return _('Pixel Wheel');
}
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/PixelWheel.ui`);
// Bind all properties.
dialog.bindAdjustment('pixel-wheel-animation-time');
dialog.bindAdjustment('pixel-wheel-pixel-size');
dialog.bindAdjustment('pixel-wheel-spoke-count');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('pixel-wheel-prefs');
}
// ---------------------------------------------------------------- API for extension.js
// The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) {
return {x: 1.0, y: 1.0};
}
}
+127
View File
@@ -0,0 +1,127 @@
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
// Copyright (c) 2021 Simon Schneegans //
// Released under the GPLv3 or later. See LICENSE file for details. //
//////////////////////////////////////////////////////////////////////////////////////////
'use strict';
const GObject = imports.gi.GObject;
const _ = imports.gettext.domain('burn-my-windows').gettext;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
const ShaderFactory = Me.imports.src.ShaderFactory.ShaderFactory;
//////////////////////////////////////////////////////////////////////////////////////////
// This effect pixelates the window texture and hides the pixels radially, starting //
// from the pointer position. //
//////////////////////////////////////////////////////////////////////////////////////////
// The effect class can be used to get some metadata (like the effect's name or supported
// GNOME Shell versions), to initialize the respective page of the settings dialog, as
// well as to create the actual shader for the effect.
var PixelWipe = class {
// The constructor creates a ShaderFactory which will be used by extension.js to create
// shader instances for this effect. The shaders will be automagically created using the
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance.
constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => {
// Store uniform locations of newly created shaders.
shader._uPixelSize = shader.get_uniform_location('uPixelSize');
shader._uStartPos = shader.get_uniform_location('uStartPos');
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings, forOpening, actor) => {
// Because the actor position may change after the begin-animation signal is
// called, we set the uDirection uniform during the update callback.
this._startPointerPos = global.get_pointer();
this._actor = actor;
// clang-format off
shader.set_uniform_float(shader._uPixelSize, 1, [settings.get_int('pixel-wipe-pixel-size')]);
// clang-format on
});
// We set the uDirection uniform during the update callback as the actor position
// may not be set up properly before the begin animation callback.
shader.connect('update-animation', (shader) => {
if (this._startPointerPos) {
const [x, y] = this._startPointerPos;
const [ok, localX, localY] = this._actor.transform_stage_point(x, y);
if (ok) {
let startPos = [
Math.max(0.0, Math.min(1.0, localX / this._actor.width)),
Math.max(0.0, Math.min(1.0, localY / this._actor.height))
];
shader.set_uniform_float(shader._uStartPos, 2, startPos);
}
}
});
// Make sure to drop the reference to the actor.
shader.connect('end-animation', (shader) => {
shader._actor = null;
});
});
}
// ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() {
return [3, 36];
}
// This will be called in various places where a unique identifier for this effect is
// required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-close-effect'), and its animation time
// (e.g. '*-animation-time').
getNick() {
return 'pixel-wipe';
}
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
getLabel() {
return _('Pixel Wipe');
}
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/PixelWipe.ui`);
// Bind all properties.
dialog.bindAdjustment('pixel-wipe-animation-time');
dialog.bindAdjustment('pixel-wipe-pixel-size');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('pixel-wipe-prefs');
}
// ---------------------------------------------------------------- API for extension.js
// The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) {
return {x: 1.0, y: 1.0};
}
}
+1 -1
View File
@@ -46,7 +46,7 @@ var Pixelate = class {
shader.connect('begin-animation', (shader, settings) => { shader.connect('begin-animation', (shader, settings) => {
// clang-format off // clang-format off
shader.set_uniform_float(shader._uNoise, 1, [settings.get_double('pixelate-noise')]); shader.set_uniform_float(shader._uNoise, 1, [settings.get_double('pixelate-noise')]);
shader.set_uniform_float(shader._uPixelSize, 1, [settings.get_double('pixelate-pixel-size')]); shader.set_uniform_float(shader._uPixelSize, 1, [settings.get_int('pixelate-pixel-size')]);
// clang-format on // clang-format on
}); });
}); });
+2
View File
@@ -187,6 +187,8 @@ capture_effect "fire"
capture_effect "hexagon" capture_effect "hexagon"
capture_effect "incinerate" capture_effect "incinerate"
capture_effect "pixelate" capture_effect "pixelate"
capture_effect "pixel-wheel"
capture_effect "pixel-wipe"
capture_effect "tv" capture_effect "tv"
capture_effect "wisps" capture_effect "wisps"
Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

+2
View File
@@ -215,6 +215,8 @@ test_effect "fire"
test_effect "hexagon" test_effect "hexagon"
test_effect "incinerate" test_effect "incinerate"
test_effect "pixelate" test_effect "pixelate"
test_effect "pixel-wheel"
test_effect "pixel-wipe"
test_effect "tv" test_effect "tv"
test_effect "wisps" test_effect "wisps"