Re: "floccinaucinihilipilification", or "convolutions, blocking, and windows server 2003"

Jaymz Julian <jaymz-y6qSm6YX8/[email protected]>
Newsgroups gmane.comp.freedesktop.xserver
Message-ID <[email protected]>
So much for the job thing.  Showed up to work to find myself no longer
having one, heh.

> Is the interface you're currently using for Xrender final, or is it
> likely to change? If it's final, it would be kind if you could save me
> some time and shortly describe the convolution interface (functions,
> function parameters ...). libglc is currently using a simple interface
> similar to the Transform interface of Xrender. Setting a convolution
> kernel for a surface will currently make libglc perform convolution on
> that surface when it's used as source in a composite operation without
> modifying the original surface

I should have done my research better - if I'd known that there was already
an implentation of this, I would have just copied that :).  But anyhow.

How this works as implented right now:

XRenderCreateConvolution() creates a convolution, and takes a bunch of
parameters, those being:

	- op (which operation to perform.  There is a list of these, all
	      of which are matrix ops, but they could be anything)
	- wrapType (WrapNone, WrapClamp, WrapRepeat - think opengl texture wrapping)
	
	it then takesfour divisors for matricies, an xsize and a ysize, and four
	matricies (of these, all are optional depending on the op - for the
	desaturate op, they're all NULL.  for the blur op, you only set
	xsize and ysize).  This should be cleaned up, though, perhaps passing
	a structure instead.

.From there, there are two methods for using this convolution:

XRenderExecuteConvolution() will execute it on a specific area.  I use this to
implent "blur under transparent window", for example, where I place the data
to be displayed under the window, execute the convolution on the window area, 
and then place the transparent window. (no screenshot of this, use your 
imagination :))

XRenderAddConvolution() will add a convolution to a picture.  A picture can have
an arbitary number of convolutions attached to it, an example of this is that
in my shadow drawing code (http://www.dspaudio.com/~jaymz/shadow12.png), I have
a desaturate and a blur attached to each shadow image, and the xserver just
magically applies those.

One thing which I havn't implented yet, is the API to reorder the convolutions
attached to a picture, mostly because I havn't yet found a set of semantics 
for this which I find appealing.  There is an XRenderRemoveAllConvolutions()
in my tree, which I just stopped from randomly crashing about, uhm, three 
minutes ago, so I'll upload a tarball with that in it later.

	-- jj

p.s. i cc'd this mail to [email protected], since the explanation of how it works 
is probably useful to anyone daring to look at the steaming pile :)

-- 
Jaymz Julian - Coder, Visionary, Fat Ass.
"Hannibal is a serial killer. He only likes to kill and eat people. 
 Very few people have `I want to be killed and eaten' on their cards, 
 so Hannibal is out of a job." - http://cards.sf.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.