ANNOUNCE - graphics package
Mon Jan 12 16:35:42 CET 2004
On Mon, 12 Jan 2004, Vlad Dumitrescu wrote:
> > To add support for (say) a rendering extension one could make a new
> > protocol conversion module and write:
> > xDo(Display, render:eSomeProtocolMessage(.....))
> > etc.
> Oh, yes! :-)
> The replies are a little more tricky (i.e. one has to know which module to ask
> to decode the data) but not much, and what I was thinking was to have the
> extensions in mind so that it will be easy to add them after the core
> functionality runs smoothly.
This is also easy :-)
Primitives end up by calling either req or call like this:
ePutImage(Draw, GC, Width, Ht, X, Y, Pad, Depth, Data) ->
req(72, 2, <<Draw:32,GC:32,Width:16,Ht:16,X:16,Y:16,Pad:8,Depth:8,
PutImage has no reply
call(47, <<Id:32>>, eQueryFont).
Query font has a reply. Here eQueryFont is the name of the parser to
be called when the command returns
Then when later the command returns this code gets called: ...
MinBounds:12/binary, % note the units of binary
% are inbytes
> Just to check if I didn't miss this one: the image functionality isn't complete,
> is it?
No. I have included the code to read and display a Jpeg - but I removed it
from the examples when I found that it didn't work on all machines.
You can try it if you like
The example only works if you have "true color" (I think its called this)
The code works if you have a modern graphics card but fails if you have to
map the colors. I have written the code for this but
still get weird colors on my machine at work.
More information about the erlang-questions