Re[3]: Object IO, fast window redraw
Valery A.Khamenya
khamenya@module.ru
Tue, 23 May 2000 18:00:10 +0400
Hello Peter and clean-list,
Tuesday, May 23, 2000, 8:44:02 PM, you wrote:
PA> As I observed in my reply, much depends on the actual algorithm. I am not
PA> sure what you mean with your last remark:
>>the main delay as I guess stands for update window procedure in/after
>>every drawPoint call.
PA> drawPoint, as any StdPicture function, does nothing more than performing
PA> the specified task.
OK, but I see slow pixel-by-pixel drawing. I'd wait that whole
the picture will be drawn (somewhere in OS area) and only then shown
at screen. "wholesale", not pixel-by-pixel: draw,show, draw,show ...
PA> The *Picture environment is a specialised sub
PA> environment in which drawing occurs. This environment must be retrieved
PA> from the super environment (either PSt or IOSt).This is a rather
PA> costly action.
it is clear. However for drawing I use my function supplied via
WindowLook attribute like this:
window = Window "Bitmap" NilLS
[ WindowViewSize bitmapsize
, WindowLook True lookfunc
, WindowClose (noLS closeProcess)
]
and I do nothing for retreiving that Picture from the super
environment (either PSt or IOSt), this a problem of caller of lookfunc.
PA> I don't know if you're doing this per pixel, but if you do then I
PA> suggest to minimise this as well.
I do. And how I can "minimize this"?
the super environment (either PSt or IOSt).
here is my code:
//---------------------------------------------
some_matrix = [[j \\ j<-[0..80] ] \\ k<-[0..80] ]
lookfunc = (\_ _ ->drawmat {x=0,y=0} some_matrix)
drawrow::Vector *Picture ->*Picture
drawrow [] pic = pic
drawrow [v:vs] pic =
((drawrow vs) o
(drawPoint) o
(setPenColour (RGB {r=v,g= v,b= v})) ) pic
drawmat:: !Point2 !Matrix !*Picture -> !*Picture
drawmat _ [] pic = pic
drawmat pnt [row:rows] pic
= ((drawmat {x=pnt.x, y=pnt.y+1} rows)
o (drawrow row)
o (setPenSize 1)
o (setPenPos {x=pnt.x, y=pnt.y})) pic
//------------------------------------
Is there an advice?
thank you in advance.
--
Best regards,
Valery mailto:khamenya@module.ru