On Feb 16, 2008 2:08 PM, Tor Lillqvist <[EMAIL PROTECTED]> wrote:

> But isn't each stroke with a tool a separate GimpPaintCore object?

No, a GimpPaintCore is basically an object that creates brush-marks.
A paint tool creates its paint core when it comes into existence, and
uses the paint core as long as it exists.

I have doubts that the Warp tool should be a paint tool at all -- it
certainly doesn't use a brush.  When I was thinking about this, I
imagined that the tool would inherit directly from GimpDrawTool,
or maybe even from GimpTool, with the code that actually
does the warping in a file gimpdrawable-warp.c in app/core.

Anyway, the paint tool that has most in common with a warp tool
would probably be the ink tool, because it also does not use a
brush.  The brush tools have a lot of specialized code for
brush-handling that wouldn't be of any use to you.

> the warp tool's case, I would like sequential strokes to have access
> to the same original image, the one before the first stroke. Is there
> any existing infrastructure to do this, or would the warp tool code
> need to manage such bookkeeping itself?

For paint tools (the ones that use a brush), there is a distinction
between "incremental" mode and "non-incremental" mode.  In
incremental mode (as used by the airbrush), each brush mark is
added to the image that results from the previous brush marks.
In non-incremental mode (as used by the simple paintbrush), all
of the brush-marks from a stroke are in effect applied at once to the
image as it existed before the stroke.  So, in non-incremental mode,
going back and forth over the same area in a single stroke does
not produce a cumulative result.  Multiple strokes are always treated
incrementally, though.  So, you might look at how this is handled
in the paint core code.

  -- Bill
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to