Re: [Gimp-developer] Gaussian blur: Silly question or buffer error?

2008-02-13 Thread Stephane Chauveau
The answer is given by the definition of 'terms':

terms = (row  4) ? row : 4;

In pratice, that means that
  - with row4 the loop is

  for (i = 0; i = row; i++) {
   ...
  }
 
- with row=4 the loop is
  for (i = 0; i = 4; i++) {
   ...
 }





Alastair M. Robinson wrote:
 Hi,

 I may be missing something obvious here, but I'm trying to understand
 the workings of the Gaussian Blur plugin, since I need to implement
 something similar myself, and either there's something screwy here, or
 there's something obvious I'm missing.

 In gimp-2.4.4/plugins/common/gauss.c, the gauss_iir() function,
 at line 960 we have four pointers initialised - two to the beginning of
 their respective buffers, and two to one tuple before the end.

sp_p = src;
sp_m = src + (height - 1) * bytes;
vp = val_p;
vm = val_m + (height - 1) * bytes;

 But then the inner loop does this:
for (b = 0; b  bytes; b++)
  {
vpptr = vp + b; vmptr = vm + b;
for (i = 0; i = terms; i++)
  {
*vpptr += n_p[i] * sp_p[(-i * bytes) + b] - d_p[i] * vp[(-i *
 bytes) + b];
*vmptr += n_m[i] * sp_m[(i * bytes) + b] - d_m[i] * vm[(i *
 bytes) + b];
  }
  ...

 On the first run through, with b=0, the index [(-i * bytes) + b] will be
 negative for all but the first iteration, yet it's used with the sp_p
 and vp pointers, which point to the beginning of their buffers, thus
 accessing memory outside the buffer.  Or am I missing something here?

 And while we're on the subject, can anyone point me to an explanation of
 the maths behind this IIR approximation of the Gaussian filter?  I
 understand Gaussian blurring well enough to implement a
 convolution-based version, but I want to implement a
 local-contrast-stretch filter - basically a gentle large-radius
 unsharp-mask, which would require unfeasibly large convolution matrices
 to do it that way.

 All the best,
 --
 Alastair M. Robinson


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

   

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


[Gimp-developer] Merged Image not able to be drawn on...

2008-02-13 Thread Brendan
More on the bug I am running into. It very well may be that this is not a 
bug and just a feature or whatever that I am running into, but it's not very 
well explained anywhere, seemingly.

I have an image that I have worked on, had multiple layers, then when merged 
down, it cannot be drawn on directly, even though only one layer is shown and 
no error message pops up. 2.2 didn't seem to feature this, as I have done it 
countless times. Seems to be intermittent, but it's hard to figure out when I 
don't have much time to debug.

More info...when I am saving the image as a jpeg, it shows the message about 
transparency...so is there a hidden layer or something that isn't allowing me 
to draw on...oh hell, I am running out of words.

I can send out a screenshot of the issue. Didn't want to send it to the list 
and waste bandwidth.

BTW, this is a compiled-from-source version of 2.4.4.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Merged Image not able to be drawn on...

2008-02-13 Thread Jim Sabatke
Brendan wrote:
 More on the bug I am running into. It very well may be that this is not a 
 bug and just a feature or whatever that I am running into, but it's not very 
 well explained anywhere, seemingly.

 I have an image that I have worked on, had multiple layers, then when merged 
 down, it cannot be drawn on directly, even though only one layer is shown and 
 no error message pops up. 2.2 didn't seem to feature this, as I have done it 
 countless times. Seems to be intermittent, but it's hard to figure out when I 
 don't have much time to debug.

 More info...when I am saving the image as a jpeg, it shows the message about 
 transparency...so is there a hidden layer or something that isn't allowing me 
 to draw on...oh hell, I am running out of words.

 I can send out a screenshot of the issue. Didn't want to send it to the 
 list 
 and waste bandwidth.

 BTW, this is a compiled-from-source version of 2.4.4.
 ___
   

I suspect that sending the XCF file, as suggested earlier by I don't
remember who, might be the best way to start.  That should contain
everything, hidden or not, in your picture.

Good  luck,

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


Re: [Gimp-developer] Merged Image not able to be drawn on...

2008-02-13 Thread Brendan
On Wednesday 13 February 2008, Jim Sabatke wrote:
 Brendan wrote:
  More on the bug I am running into. It very well may be that this is not
  a bug and just a feature or whatever that I am running into, but it's not
  very well explained anywhere, seemingly.
 
  I have an image that I have worked on, had multiple layers, then when
  merged down, it cannot be drawn on directly, even though only one layer
  is shown and no error message pops up. 2.2 didn't seem to feature this,
  as I have done it countless times. Seems to be intermittent, but it's
  hard to figure out when I don't have much time to debug.
 
  More info...when I am saving the image as a jpeg, it shows the message
  about transparency...so is there a hidden layer or something that isn't
  allowing me to draw on...oh hell, I am running out of words.
 
  I can send out a screenshot of the issue. Didn't want to send it to the
  list and waste bandwidth.
 
  BTW, this is a compiled-from-source version of 2.4.4.
  ___

 I suspect that sending the XCF file, as suggested earlier by I don't
 remember who, might be the best way to start.  That should contain
 everything, hidden or not, in your picture.

Sadly, it's private work product that I can't release...If someone mailed me 
off-list, I'm sure I could find a way.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Bug? Clone Tool after Merge Layers

2008-02-13 Thread Liam R E Quin
On Mon, 2008-02-11 at 21:39 -0500, Brendan wrote:
[...]
 Layer Mask gets squashed down with a Merge Visible Layers command.
 After that, I can't seem to get the Clone or Heal or really any drawing tool 
 to work on the image. Unselected everything even.
Make sure the background layer is selected in the layers dialogue.

Liam

-- 
Liam Quin - http://www.holoweb.net/~liam/
XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org


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


Re: [Gimp-developer] Bug? Clone Tool after Merge Layers

2008-02-13 Thread Sven Neumann
Hi,

On Wed, 2008-02-13 at 09:05 -0500, Liam R E Quin wrote:
 On Mon, 2008-02-11 at 21:39 -0500, Brendan wrote:
 [...]
  Layer Mask gets squashed down with a Merge Visible Layers command.
  After that, I can't seem to get the Clone or Heal or really any drawing 
  tool 
  to work on the image. Unselected everything even.
 Make sure the background layer is selected in the layers dialogue.

That should happen automatically after Merge Visible Layers. Do you
end up with no layer being selected? That would be a bug then.


Sven


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


Re: [Gimp-developer] IWarp as a tool

2008-02-13 Thread Sven Neumann
Hi,

On Wed, 2008-02-13 at 02:06 +0200, Tor Lillqvist wrote:

 Currently it allocates a big buffer for the deformation vectors, two
 doubles for each pixel in the image. This should probably be changed
 to either use tile-based storage, or use a scaled (when necessary)
 deformation vector array with some fixed maximum size.

You should be able to use a tile-manager for this. A tile-manager can
hold any number of bytes per pixel. There is one tool already that does
something like this, the IScissors tool. It even does something
particularily elegant in that it uses a validate_proc so that only the
tiles that are actually needed by the tool are calculated.


Sven


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


Re: [Gimp-developer] Merged Image not able to be drawn on...

2008-02-13 Thread Sven Neumann
Hi,

On Wed, 2008-02-13 at 20:05 -0500, Brendan wrote:

 I have an image that I have worked on, had multiple layers, then when merged 
 down, it cannot be drawn on directly, even though only one layer is shown and 
 no error message pops up.

The single layer that is shown, is it selected? There is most likely a
channel in your image which is selected as the active drawable.


Sven


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