After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 150227 - PIPE_SELECT_VELOCITY unimplemented for painting with brush pipes.
PIPE_SELECT_VELOCITY unimplemented for painting with brush pipes.
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-08-16 04:25 UTC by Joao S. O. Bueno
Modified: 2006-01-31 20:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implements brush-pipe select by velocity in the GIMP. (1.55 KB, patch)
2004-08-16 04:26 UTC, Joao S. O. Bueno
needs-work Details | Review
Updated patch - no changes in the code. (1.49 KB, patch)
2005-02-26 03:37 UTC, Joao S. O. Bueno
committed Details | Review
gih velocity examples (160.53 KB, image/png)
2006-01-30 23:16 UTC, Michael Schumacher
  Details
brush used for examples (12.24 KB, application/octet-stream)
2006-01-30 23:21 UTC, Michael Schumacher
  Details

Description Joao S. O. Bueno 2004-08-16 04:25:24 UTC
While doing my homework for BUG #127663, I found out that the velocity 
option was not used in the GIMP. 
 
Just open app/core/gimpbruspipe.c and look down in gimp_brush_pipe_select.  
 
Selection by velocity (which should work more or less like the pen tool) just 
is not implemented there, although it is handled in .GIH file save. 
 
I've made a small patch to implement it.
Comment 1 Joao S. O. Bueno 2004-08-16 04:26:40 UTC
Created attachment 30581 [details] [review]
Implements brush-pipe select by velocity in the GIMP.
Comment 2 Joao S. O. Bueno 2004-08-16 04:33:40 UTC
While editing this file, I found out that the random generator is created on 
for every brush stroke in gimp_brush_pipe_select_brush . It would not hurt to 
have it to be created once with the pipe brush class, and to be destroyed with 
it, I think. 
Comment 3 Joao S. O. Bueno 2004-09-27 15:33:44 UTC
The above patch, although implementing roughly the functionality, doesn't work 
fine. It does work if the strokes are being painted in realtime. 
 
If, however, stroke rendering is delayed, due to a (not so) large brush, or 
slow machinne, the timing information received is useless, and the speed is 
calculated as if it was the minimum.  
 
For this to work properly, it would have to implement time smoothing 
techniques just as the ink tool does. 
Comment 4 Joao S. O. Bueno 2004-10-27 13:52:35 UTC
Moin. 
 
Moving this to future myself. The attached patch works fine, until the 
slowdown effects reported in bug #148205 kick in. At this point, the 
coordinates passed to the painting function are interpolated, and one can no 
longer guess the pointer speed from them. 
 
To properly implement this, the time smoothing code in the Ink tool should be 
used. As such, it will have to be factored out from there to a more general 
place. 
 
Therefore Bug #143216 and bug #119240 will possibly be implemented as well.  
These are good enhancements for the GIMP and have nothing to do with GEGL, so 
they might be taken on early on the next devel. cycle. 
 
Comment 5 Dave Neary 2005-01-24 08:10:07 UTC
Comment on attachment 30581 [details] [review]
Implements brush-pipe select by velocity in the GIMP.


Not sure I understand the bug, but from Joao's last comment, he doesn't think
this should be committed.
Comment 6 Joao S. O. Bueno 2005-01-24 13:32:06 UTC
Indeed. To sum up: the implementation in this patch is machine speed and 
available memory dependant. 
 
The bug itself is a simple request: 
The animated brushes have several ways to select which image to use to stroke 
with. They may be selectable randomly, sequentialy, by pressure, or by the 
angle of the stroke. There is also, in the enumerations, the option of 
selecting the brush by the speed of the stroke.  (It also works in the .GIH 
save settings) 
 
Handling brush stroking by velocity, however, is not implemented in the CVS 
code. 
 
Comment 7 weskaggs 2005-02-25 19:42:43 UTC
Status of this is unclear.  Comment #4 indicates that bug #148205 was blocking
the usefulness of the patch, but that bug is now fixed.  Comment #4 also refers
to two other bugs, but it isn't clear how important they are.  So, is the patch
an improvment over the current code at this point?
Comment 8 Joao S. O. Bueno 2005-02-26 03:32:14 UTC
So, guess what? 
 
I never changed this file again after I posted this patch here, it is still on 
my personnal GIMP...and it is working fine now! :-) 
 
hah...code de-obsolescence brought to you by the GIMP Team.  Thanks guys! 
 
I will recreate the patch, because the file has been changed in CVS - I 
remember having read about someone fixing the issue with the random generator 
above. 
 
The other two bugs I mention, IIRC, are other brush/painting related 
enhacements that depend on this, rather than the other way around. 
Comment 9 Joao S. O. Bueno 2005-02-26 03:37:13 UTC
Created attachment 37954 [details] [review]
Updated patch - no changes in the code. 

It is working finenow. I tried it with a 480x480x9 brush on the same machinne
it was not ok with a 64x64x9 brush on previous tests.
Comment 10 weskaggs 2005-02-27 18:53:28 UTC
Great!  Removing NEEDINFO; now just needs code review.
Comment 11 Sven Neumann 2005-03-12 11:29:36 UTC
Comment on attachment 37954 [details] [review]
Updated patch - no changes in the code. 

I am not sure but it appears to me that there's a possibility for a division by
zero or is it guaranteed that spacing never becomes zero? Otherwise this looks
good to me.
Comment 12 Sven Neumann 2006-01-04 16:19:19 UTC
This should probably be committed since that's what has been decided last year already, but another review probably wouldn't hurt.
Comment 13 Michael Schumacher 2006-01-30 10:56:30 UTC
We shouldn't let this patch get any older, IMO. If no one else steps forward, I'll try to apply it to my tree tonight and will report back.
Comment 14 Michael Schumacher 2006-01-30 23:16:49 UTC
Created attachment 58433 [details]
gih velocity examples

The good news: the patch applies and velocity is now applicable for GIH brushes.
The bad news: it is almost unusable on my system. 

When doing straight line strokes, it doesn't seem got get the endpoints correct. For free strokes, it seems to be impossible to maintain a velocity. There's also no possiblity for the user to adjust the sensitivity, is there?

See the attached screenshot for examples.
Comment 15 Michael Schumacher 2006-01-30 23:21:27 UTC
Created attachment 58434 [details]
brush used for examples
Comment 16 Joao S. O. Bueno 2006-01-31 04:14:37 UTC
Hi schumanl! So, this is why I have not pushed it anymore - not of much use, is it? I get more or less the same results.

However, thanks. I guess it is better this than nothing.

A way to calibrate the speed sounds nice, indeed. For sure the day the GIMP implements BUG #119240 we would have a working speed calibration. Hmmm..maybe speed is a good candidate to begin implementation of that one.

A finner than a second time resolution for GDK events would be really nice, though.
Comment 17 Michael Schumacher 2006-01-31 12:24:58 UTC
Maybe we should commit this patch anyway - it works; it is not perfect, but it hasn't been available yet so this shouldn't have an impact on existing brushes (and if it has, those probably have to be changed).

Additionally, tweakable stuff might attract more new developers than things that have to be created from scratch.
Comment 18 Michael Schumacher 2006-01-31 20:21:05 UTC
2006-01-31  Michael Schumacher  <schumaml@cvs.gnome.org>

	* app/core/gimpbrushpipe.c: applying a patch by Joao S. O. Bueno
	Calligaris which implements PIPE_SELECT_VELOCITY for brush
	pipes. Fixes bug #150227.