[-]
[+]
|
Changed |
_service:tar_git:paint.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/poetaster/paint.git</param>
<param name="branch">master</param>
- <param name="revision">0.9.2</param>
+ <param name="revision">0.9.3-1</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/paint.pro
^
|
@@ -170,5 +170,14 @@
RESOURCES +=
DISTFILES += \
- qml/components/ClipboardCanvas.qml
+ qml/components/ClipboardCanvas.qml \
+ qml/components/ToolbarButtonUndo.qml \
+ qml/glsl/compoundeye.frag \
+ qml/glsl/crosshatch.frag \
+ qml/glsl/mirror.frag \
+ qml/glsl/swap_RGB-BGR.frag \
+ qml/glsl/swap_RGB-GBR.frag \
+ qml/glsl/swap_RGB-RBG.frag \
+ qml/icons/graphic-shader-texture.png \
+ qml/icons/icon-m-undo.svg
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/components/DrawingCanvas.qml
^
|
@@ -34,6 +34,10 @@
property alias areagMouseX: area.gMouseX
property alias areagMouseY: area.gMouseY
+ // try some
+ renderTarget: Canvas.FramebufferObject // default slower: Canvas.Image
+ renderStrategy: Canvas.Immediate // less memory: Canvas.Cooperative
+
property var brush
Connections
@@ -342,6 +346,7 @@
onReleased:
{
+
pressedAndHolded = false
if (gridVisible && gridSnapTo)
{
@@ -354,6 +359,9 @@
area.gMouseY = Math.round(mouseY)
}
+ // begin undo
+ idSaveCanvastimer.start()
+
switch (drawMode)
{
case Painter.Eraser:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/components/Toolbar1.qml
^
|
@@ -10,6 +10,16 @@
{
spacing: (parent.width - children.length*Theme.iconSizeLarge )/(children.length+1)
anchors.horizontalCenter: parent.horizontalCenter
+ ToolbarButtonUndo
+ {
+ mode: Painter.Pen
+ onClicked:
+ {
+ cancelPendingFunctions()
+ undo_draw()
+ drawMode = mode
+ }
+ }
ToolbarButton
{
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/components/ToolbarButtonUndo.qml
^
|
@@ -0,0 +1,48 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+import harbour.paint.PainterClass 1.0
+
+IconButton
+{
+ id: idUndoButton
+ enabled: ( (cStep+1) > 0 ) ? true : false
+
+ property int mode: Painter.None
+
+ highlighted: drawMode === mode
+
+ anchors.bottom: parent.bottom
+ icon.source: "../icons/icon-m-undo.svg"
+ icon.width: Theme.iconSizeMedium
+ icon.height: Theme.iconSizeMedium
+ height: parent.height
+ rotation: rotationSensor.angle
+ Behavior on rotation { SmoothedAnimation { duration: 500 } }
+
+ Image {
+ opacity: (idUndoButton.enabled) ? 1 : 0.4
+ anchors.centerIn: parent
+ source: "image://theme/icon-m-delete"
+ mirror: true
+ scale: 0.45
+ }
+ /*
+ onClicked: {
+ toolThicknessVisible = false
+ toolImageVisible = false
+ toolColorsPenVisible = false
+ toolColorsPageVisible = false
+ toolLineCapVisible = false
+ freeDrawCanvas.undo_draw()
+ }*/
+ /*onPressAndHold: {
+ toolThicknessVisible = false
+ toolImageVisible = false
+ toolColorsPenVisible = false
+ toolColorsPageVisible = false
+ toolSaveVisible = false
+ remorse.execute( parent, qsTr("Clear drawing?"), function() {
+ freeDrawCanvas.clear_canvas()
+ })
+ }*/
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/adjust-rgb.frag
^
|
@@ -1,8 +1,7 @@
+precision mediump float;
// Adjust RGB
// Red;-1.0;1.0;Green;-1.0;1.0;Blue;-1.0;1.0
-precision mediump float;
-
uniform sampler2D source;
uniform sampler2D mask;
varying highp vec2 qt_TexCoord0;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/compoundeye.frag
^
|
@@ -0,0 +1,49 @@
+// Compound Eye
+// amt;0.1;2.0;squares;2.0;20.0;offset;0.05;1.0
+
+precision mediump float;
+
+uniform sampler2D source;
+uniform sampler2D mask;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+uniform lowp float width;
+uniform lowp float height;
+uniform highp float param1;
+uniform highp float param2;
+uniform highp float param3;
+
+void main() {
+
+ //float aspect = resolution.x / resolution.y;
+ float aspect = width / height;
+ float offset = param1 * 0.5;
+
+ if (texture2D(mask, qt_TexCoord0.st).a > 0.5)
+ {
+
+ vec2 uv = qt_TexCoord0.xy;
+
+ /* copy of the texture coords */
+ vec2 tc = uv;
+
+ /* move into a range of -0.5 - 0.5 */
+ uv -= 0.5;
+
+ /* correct for window aspect to make param2 */
+ uv.x *= aspect;
+
+ /* tile will be used to offset the texture coordinates
+ taking the fract will give us repeating patterns */
+ vec2 tile = fract(uv * param2 + 0.5) * param1;
+
+ /* sample the texture using our computed tile
+ offset will remove some texcoord edge artifacting */
+ vec4 tex = texture2D(source, tc + tile - offset);
+ gl_FragColor = tex;
+ }
+ else
+ {
+ gl_FragColor = texture2D(source, qt_TexCoord0.st) * qt_Opacity;
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/crosshatch.frag
^
|
@@ -0,0 +1,40 @@
+// crosshatch
+// Luminosity;0.3;1.0
+
+precision mediump float;
+
+uniform sampler2D source;
+uniform sampler2D mask;
+varying highp vec2 qt_TexCoord0;
+uniform highp float param1;
+
+void main()
+{
+ float lum = length(texture2D(source, qt_TexCoord0.xy).rgb);
+
+ gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if (lum < 1.00) {
+ if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ }
+ }
+
+ if (lum < 0.75) {
+ if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ }
+ }
+
+ if (lum < 0.50) {
+ if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ }
+ }
+
+ if (lum < 0.3) {
+ if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/emboss.frag
^
|
@@ -1,5 +1,6 @@
// Emboss
+
precision mediump float;
uniform sampler2D source;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/gray_average.frag
^
|
@@ -1,5 +1,6 @@
// Grayscale, average
+
precision mediump float;
uniform sampler2D source;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/gray_lightness.frag
^
|
@@ -1,5 +1,6 @@
// Grayscale, lightness
+
precision mediump float;
uniform sampler2D source;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/gray_luminosity.frag
^
|
@@ -1,6 +1,5 @@
// Grayscale, luminosity
-precision mediump float;
uniform sampler2D source;
uniform sampler2D mask;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/jolla-glasseffect.frag
^
|
@@ -1,6 +1,6 @@
// Jolla glasseffect
// Mix;0.0;2.0
-// imageSource;image://theme/graphic-shader-texture
+// imageSource;image://paintIcons/graphic-shader-texture
precision mediump float;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/mirror.frag
^
|
@@ -0,0 +1,32 @@
+// Mirrors
+
+
+precision highp float;
+
+uniform sampler2D source;
+uniform vec2 resolution;
+uniform sampler2D mask;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+
+void main() {
+ if (texture2D(mask, qt_TexCoord0.st).a > 0.5)
+ {
+ vec2 uv = qt_TexCoord0.xy;
+ // the texture is loaded upside down and backwards by default so lets flip it
+ uv = 1.0 - uv;
+
+ // this line will make our uvs mirrored
+ // it will convert it into a number that goes 0 to 1 to 0
+ // abs() will turn our negative numbers positive
+ vec2 mirrorUvs = abs(uv * 2.0 - 1.0);
+
+ vec4 tex = texture2D(source, mirrorUvs);
+
+ // output to screen
+ gl_FragColor = tex;
+
+ } else {
+ gl_FragColor = texture2D(source, qt_TexCoord0.st) * qt_Opacity;
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/pixelate.frag
^
|
@@ -1,15 +1,13 @@
// Pixelate
// Granularity;5.0;50.0
-precision mediump float;
-
uniform sampler2D source;
uniform sampler2D mask;
varying highp vec2 qt_TexCoord0;
uniform lowp float qt_Opacity;
-uniform highp float param1;
uniform highp float width;
uniform highp float height;
+uniform lowp float param1;
void main()
{
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/swap_RGB-BGR.frag
^
|
@@ -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;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/swap_RGB-GBR.frag
^
|
@@ -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;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/swap_RGB-RBG.frag
^
|
@@ -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;
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/glsl/warhol.frag
^
|
@@ -27,4 +27,3 @@
gl_FragColor = texture2D(source, qt_TexCoord0.st) * qt_Opacity;
}
}
-
|
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/icons/graphic-shader-texture.png
^
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/icons/icon-m-undo.svg
^
|
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 17.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="64px"
+ height="64px"
+ viewBox="0 0 64 64"
+ style="enable-background:new 0 0 64 64;"
+ xml:space="preserve"
+ sodipodi:docname="icon-m-undo.svg"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"><metadata
+ id="metadata13"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs11">
+
+
+
+</defs><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1055"
+ id="namedview9"
+ showgrid="false"
+ inkscape:zoom="2.6074563"
+ inkscape:cx="-26.838399"
+ inkscape:cy="62.103965"
+ inkscape:window-x="1920"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1" />
+<rect
+ y="0"
+ x="-64"
+ height="64"
+ width="64"
+ style="opacity:0;fill:#ffffff"
+ id="icon-m-refresh_1_"
+ transform="scale(-1,1)" /><path
+ inkscape:connector-curvature="0"
+ id="path3"
+ d="m 32.003,51.563 c 10.77,0 19.532,-8.762 19.532,-19.53 0,-10.771 -8.762,-19.533 -19.532,-19.533 -5.048,0 -9.838,1.92 -13.489,5.406 -0.399,0.381 -0.414,1.014 -0.033,1.414 0.382,0.4 1.015,0.415 1.414,0.033 3.277,-3.129 7.578,-4.853 12.108,-4.853 9.667,0 17.532,7.865 17.532,17.533 0,9.666 -7.865,17.53 -17.532,17.53 -4.098,0 -8.086,-1.447 -11.23,-4.076 -0.426,-0.354 -1.056,-0.296 -1.409,0.126 -0.354,0.424 -0.298,1.055 0.126,1.409 3.504,2.929 7.947,4.541 12.513,4.541 z"
+ style="opacity:0.6;fill:#ffffff" />
+<path
+ sodipodi:type="star"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffff00;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path825"
+ sodipodi:sides="3"
+ sodipodi:cx="12.512194"
+ sodipodi:cy="22.196804"
+ sodipodi:r1="6.3634982"
+ sodipodi:r2="3.1817491"
+ sodipodi:arg1="-0.53783553"
+ sodipodi:arg2="0.50936202"
+ inkscape:flatsided="false"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="M 17.97729,18.936922 15.290038,23.74829 12.602786,28.559657 9.7796455,23.826745 6.9565048,19.093833 12.466897,19.015377 Z"
+ inkscape:transform-center-x="7.296036"
+ inkscape:transform-center-y="-0.14735897"
+ transform="matrix(0.60165272,0.88180113,-0.97181431,0.66306869,34.714116,-8.3359631)" /></svg>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/pages/Paint.qml
^
|
@@ -8,6 +8,8 @@
Page
{
+
+
id: page
anchors.fill: parent
@@ -33,6 +35,10 @@
}
}
+ // undo variables
+ property var imageData : []
+ property var cStep : -1
+
Connections
{
target: painter
@@ -394,6 +400,45 @@
z: layers.count - index
}
}
+ /* begin undo */
+ Timer {
+ id: idSaveCanvastimer
+ running: false
+ repeat: false
+ interval: 5
+ onTriggered: {
+ saveCurrentCanvas()
+ }
+ }
+ Timer {
+ id: idRefreshCanvastimer
+ running: false
+ repeat: false
+ interval: 10
+ onTriggered: {
+ drawingCanvas.visible = true
+ }
+ }
+
+ function saveCurrentCanvas() {
+ cStep++
+ var ctx = drawingCanvas.getContext('2d')
+ imageData[cStep+1] = ctx.getImageData( 0, 0, drawingCanvas.width, drawingCanvas.height )
+ }
+
+ function undo_draw() {
+ cStep--
+ var ctx = drawingCanvas.getContext('2d')
+ ctx.clearRect( 0, 0, drawingCanvas.width, drawingCanvas.height )
+ if ( (cStep+1) > 0) {
+ ctx.drawImage( imageData[cStep+1], 0, 0, drawingCanvas.width, drawingCanvas.height )
+
+ }
+ drawingCanvas.requestPaint()
+ drawingCanvas.visible = false
+ idRefreshCanvastimer.start() // needs to reload canvas, to show clear screen
+ }
+ /* end undo */
function textAccept()
{
|