On Friday 25 July 2003 1:36 pm, Guillermo S. Romero / Familia Romero 
> [EMAIL PROTECTED] (2003-07-24 at 2031.28 -0300):
> > The basic idea is that besides the "normal" "addition" " darken
> > only" layer modes, to implement a "custom mode". In it, the user
> > gets to type a c-like expression of what to do with the pixel
> > values in each channel when combining the layer.
> IMO you are forgeting a kind that users will like a lot more: call
> other GIMP functions, specially some like levels or curves (in this
> case, using the layer to control strengh in a channel by channel
> basis, or maybe using value (V in HSV) to get a single number and
> work like a selection mask, you should have to checke what makes
> sense). I guess users will find more use to those than playing
> around with formulas. I used the filter that lets you do math
> formulas to test ideas, but dunno how many people would like to use
> that daily.

My  idea is that in the end,  the custom layer formulas get recorded 
in a gimp directory, just like brushes and patterns. So, a set 
ofrather itneresting formulas would be shipped with the Gimp (or with 
the patch). That would provide alone could provide a lot of 

My idea for the PDB entry is just to accept such a formula.
I am sorry - I coonot think of another interface for this thing I am 
creating. When I first presented the idea, someone came up with the 
idea ofan interface like those used to set filters to e-mail 
prograns. Maybe it can be done... But when itīs i n formula type and 
go stage,, I will have some of you using the feature, and we will be 
able to think together on a new interface.

> The formulas are nice, I am not saying you should drop that, but
> you should find a way to cover both if you can, formula and PDB. If
> you are going to get dirty, make it really worth it. Maybe even you
> can do the PDB way only, and provide a new call that does formulas
> (sounds simpler to me, more generic).

I don't get exactly what is your idea. I will probably, in the end
make a gimp_custom_layer_set_mode (drawable, custom_layer_formula);
where custom layer formula is a string exactly like the one taht would 
be typed on the interface.

The rendering engine use a stack - I am in the proccess of writting a 
"compiler" from the c like expression to the operand stack.
> Hey, maybe you can fit into it effect layers. ;] Well, probably
> not, they are not simple operations to layers below them. Depends
> if you want to apply filter to the result, which is just the call
> idea, or to the layer data only, 

Actually, thta already happens.
The formulas are simply. The input operands are the letters describing 
a channel, followed by "1" if the channel belongs to the image 
bellow, or "2" if it belongs to the actual layer. And letter+D makes 
the destiantion channel.
So something like:
RD=R2*R2; GD=G2*G2; BD=B2*B2;
will actually square the values of each channel. Since they are 
treated as normalized (i.e. from 0 to 1), it's akim to using  the
curves tool to enhance contrast sharply. The main difference is that 
you can work on the drawing while experimenting with the contrast 
levels, without wororring about spoiling the RGB data on the process. 
Just change back to "normal mode", and all your raw data is there.

>which is what you need for auto
> bevel or auto drop shadow when working with text, ie. Last case
> would be more like having a layer hidden as input and a visible one
> as output, and recalculate output one only when input changes, not
> every time layers below change.

Hmm. I am working ont he paint functions..gimp s smart,a nd the code 
on this are is rather clean now...The paint functions are only called 
when changes are made.
Drop shadow however is not an option - I can use the blend of the 
pixel directly bellow the one I am processing, and none other.
> In any way, all are interesting ideas to explore.
I can barelly finish to get it working na  reasonabvle dinamic form, 
so thatI myself can experiment with it.

On the technical side - I will need to code in some string 
manipulation now.
Are there API's for string deeply hidden ing gtk/gimplib?
I had seen none so far (did nt  pick GTK reference however),a nd I a m 
goint staright to stdlib's strlen and strncpy. Is there any issue 
with using these?


Gimp-developer mailing list

Reply via email to