RE: clipping
"Bruce Q. Hammond" <[email protected]> Wed, 4 Feb 2004 21:33:16 -0800
| Newsgroups | gmane.comp.gnome.lib.libart.general |
|---|---|
| Message-ID | <[email protected]> |
Well libart has to be able to do rectangular clips, because otherwise libart would write off the top/bottom of the pixel buf (corrupting memory) or off the left/right which would wrap around to the prev/next raster line destroying the image. What is doesn't have to do is make it convenient. :-) Libart is a very low-level system, so it doesn't provide many high-level services that you expect from a full graphics system; e.g. simple to use/nice clipping primitives, bitmap blit/compositing, multiple pixmap depths, text rendering, etc, but it provides (mostly) everything you need to create a high-level lib on top. For rectilinear clipping, I had to roll my own, I wrote a function that computes the intersection of the canvas pixmap and my clip rect then, if there is an intersection, we compute a new base pointer and new pixmap dimensions and call libart to draw using this new pixmap geometry. This really should be part of libart. The routines I wrote depend on nice Point and Rect classes, etc that make it really nice to do rectangle intersection and geometry stuff so it can't be contributed to the main libart as-is. Perhaps a new "libart_driver" in C++ would be a nice. I have the ground work for it and would love to see it used for something. BQ > -----Original Message----- > From: [email protected] [mailto:[email protected]]On Behalf Of > John Hunter > Sent: Wednesday, February 04, 2004 8:24 PM > To: [email protected] > Cc: [email protected] > Subject: Re: [LIBART] clipping > > > >>>>> "Bruce" == Bruce Q Hammond <[email protected]> writes: > > Bruce> This is a nice document. I wish it had existed when I > Bruce> started with Libart. :-) > > I found another nice document - > http://developer.gnome.org/doc/books/WGA/graphics-libart.html > > Bruce> The SVP intersect code might be exactly what you want. I > Bruce> had forgotten about that until I looked at the overview. > > Bruce> I didn't use that in the general case for my app, since I > Bruce> wanted to be able to do weird compositing and masking of > Bruce> bitmaps and also I wanted any imaginable bit depth and byte > Bruce> ordering for the pixel buffer that libart was rendering > Bruce> into. I have a bunch of C++ code that does this stuff. If > Bruce> you want I can give it to you. It won't compile > Bruce> stand-alone, but it is something to look at that does > Bruce> interesting thing with the libart library. > > Please send it along, if only for educational purposes. > > BTW, I still haven't found any reference to the ability you referred > to do simple rectangular clips, outside the aforementioned > art_svp_intersect. > > Thanks, > JDH` > _______________________________________________ > Libart mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/libart > >