Срд, 30 Июн 2010, Sherlock Ric писал(а):
> Yes that is a useful performance comparison.
>
> Timings on my 32-bit Win7 system:
> J6.02 wd : less than a second
> J7.01beta gtk : less than 2 seconds
> J7.01beta cairo: ~ 10 seconds
My wine ran forever for cairo, and I had to abort it to prevent
overheat. Timings for other cases are roughly the same as yours.
>
> Would it be worth trying out drawing the image using native graphics
> libraries (media/platimg) and then copying the resulting bitmap
> buffer to gdk for display?
Do you mean draw using gdi+? I'm not familiar with it, would you do it
by yourself? You can use the same skeleton.
require'gui/gtk'
coinsert 'jgtk'
L0=: 50 NB. initial length
A0=: 1r8p1 NB. initial angle: pi divided by 8
dL=: 0.9 NB. shrink factor for length
dA=: 0.75 NB. shrink factor for angle
N=: 14 NB. number of branches
L=: L0*dL^1+i.N NB. lengths of line segments
NB. relative angles of successive line segments
A=: A0*(dA^i.N) +/\@:*("1) _1 ^ #:i.2 ^ N
NB. end points for each line segment
P=: 0 0+/\@,"2 +.*.inv (L0,0),"2 L,"0"1 A
NB. =========================================================
gtk_show=: 3 : 0
gtkinit ''
newwindow 'graph'
locGB=: 540 400 conew 'jgtkcanvas'
coinsert__locGB coname''
gtk_container_add window,gtkbox__locGB
windowfinish''
if. -.IFGTK do. gtk_main '' end.
)
NB. =========================================================
NB. this is the main drawing program
paint=: 3 : 0
NB. 'Cw Ch'=: glqwh''
NB. gdi stuff to generate bitmap data in glpixel format
glpixels data
0
)
window_delete=: 0:
gtk_show ''
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm