| 1 | import QtQuick |
| 2 | |
| 3 | // Dot-matrix mask for layer.effect: `layer.enabled: true; layer.effect: DotMask { step: 4 }`. |
| 4 | // The item becomes evenly sized grey LED dots (luminance only). Album covers, app icons, the halftone orb. |
| 5 | // Parts from glyph-rice (GPL-3.0), components/Dm.qml. |
| 6 | ShaderEffect { |
| 7 | property real step: 5 |
| 8 | readonly property real pitch: step // the shader's uniform: "step" is a GLSL builtin |
| 9 | property bool circle: false // only the dots inside the inscribed circle |
| 10 | readonly property real circ: circle ? 1 : 0 |
| 11 | readonly property size size: Qt.size(width, height) |
| 12 | fragmentShader: Qt.resolvedUrl("shaders/dots.frag.qsb") |
| 13 | } |