discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSColor patterns and NSImage draw...


From: Fred Kiefer
Subject: Re: NSColor patterns and NSImage draw...
Date: Mon, 01 Nov 2004 13:55:52 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114

Uli Kusterer wrote:
that's what I get for not testing my beautiful progress indicator code under GNUstep after writing it on OS X...

Are there any docs or other infos (subjects of interesting threads on a mailing list?) on how the graphics stuff in GNUstep works? Because without patterns and the NSImage drawXXX operations, there's not much fun in progress indicators. And the sources say "// Need another PS function for this".

 So, what would be involved in writing one?

And while I'm here: Does anyone know the difference between the drawAtPoint: and compositeToPoint: methods of NSImage? Couldn't one just use composite to implement draw?


You should not confuse these two. The operations compositeXXX and disolveXXX are very similar and all of them should be handle by just one operation implementing [NSImage compositeToPoint:fromRect:operation:fraction:] (this is the other point where I put in the request for a new PS function). But as this requires a change in all backends, it always seemed to complicated to achive up to now. The code for this is already there in xlib, cairo and winlib. Changing ART as well should be easy, but it will be an incompatible change, you will need to have matching GUI and backend components. I am waiting for Alexander to declare that it is ok, to make such changes. Before the last GUI release I hoped that incompatible changes would be allowed after that release, but somehow this did not happen.

The drawAtPoint: and drawInRect: methods are different from this set in that they apply the current transformation to the image. That is, the image will be scaled and rotated, the later would not happen with the other operations. I would expect that only the art backend is prepared for such an operation. Only if we had full image transformation implemented in GUI could the compositeXXX methods be used to give us the rest of the operation.


As for pattern colours, Alexander and I discussed this some time ago. My idea was a cheap implementation on the GSC level (common layer of the backends), where we would add the image as an ivar on the GState and when performing a fill operation use this value, if available, instead of the colour values (Setting a colour would unset the image of course). For the image than the normal draw operations, plus the clippath would be used. The idea comes of course from the cameleon engine. Perhaps slow and not very elegant, but usable at once for all different backend. Alexander, if I remember correctly, suggested some interesting pattern composition only available for the art backend. In the end nothing came out of this discussion. Again any solution here would require a parallel change to GUI and all backends.

Cheers
Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]