[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bevel filter



HI,

> I am working on creating a square/rectangular bevel filter. The problem 
> that i have encountered is getting the corners to go at an angle. If 
> anyone could give me a hint, i would b most greatful. This is what i 
> have so far:
> 
> r:
> x<ctl(0)?r+ctl(1):r&& x>xmax-ctl(0)?r-ctl(0)/2-ctl(1):r&& 
> y<ctl(0)?r+ctl(1)+ctl(0)+50:r&& y>ymax-ctl(0)?r-ctl(1):r
> 
> g:
> x<ctl(0)?g+ctl(1):g&& x>xmax-ctl(0)?g-ctl(0)/2-ctl(1):g&& 
> y<ctl(0)?g+ctl(1)+ctl(0)+50:g&& y>ymax-ctl(0)?g-ctl(1):g
> 
> b:
> x<ctl(0)?b+ctl(1):b&& x>xmax-ctl(0)?b-ctl(0)/2-ctl(1):b&& 
> y<ctl(0)?b+ctl(1)+ctl(0)+50:b&& y>ymax-ctl(0)?b-ctl(1):b
> 
> slider(0): Bevel Width
> slider(1): Shadow and Highlight Depth
> 
> The current code gives me a the desired effect exept for the corners. 

The corners are created with c2d(x,y)<128, c2d(X-x,y)<128, 
c2d(x,Y-y)>128, c2d(X-x,Y-y)<128 and c2d(X-x,y)>=128.

Have a look at the following code:

R:
put(val(0,0,M*Y/X),0),
put(c2d(x,y)<128&&c2d(X-x,y)<128&&y<get(0),3),
put(c2d(x,Y-y)>128&&x<get(0),5),
put(c2d(X-x,Y-y)<128&&y>Y-1-get(0),6),
put(c2d(X-x,y)>=128&&x>X-1-get(0),4),
get(3)?c+ctl(1):
get(4)?c-ctl(0)/2ctl(1):
get(5)?c+ctl(1)+ctl(0)+50:
get(6)?c-ctl(1):c


G:
get(3)?c+ctl(1):
get(4)?c-ctl(0)/2ctl(1):
get(5)?c+ctl(1)+ctl(0)+50:
get(6)?c-ctl(1):c

B:
get(3)?c+ctl(1):
get(4)?c-ctl(0)/2ctl(1):
get(5)?c+ctl(1)+ctl(0)+50:
get(6)?c-ctl(1):c

A:
a

ctl[0]: Bevel Width
ctl[1]: Shadow and Highlight Depth

val[0]: 57
val[1]: 44


If you shouldn't understand something of the above, just ask.
Harry


PlugIn Com HQ - 
Free Plugins, Effects and Tools for Image and Video Editing
http://pico.i-us.com/