Re: [gtkmm] Improved Gdk::Pixbuf pixel interface



Barnaby Gray <bee pickle me uk> writes:

> On Wed, Jan 22, 2003 at 10:57:23PM +0100, Ole Laursen wrote:
> > 
> > I've already implemented the interfaces - you can have a look here:
> > 
> >   http://www.cs.auc.dk/~olau/misc/pixbuf-drawing.hpp   - the interfaces
> >   http://www.cs.auc.dk/~olau/misc/test.cpp             - timing tests
> > 
> > Comments?
> 
> Could you have a operator[] on the Pixbuf that turn returns a
> reference to a PixbufRow object, which also has an operator[] to go to
> a pixel value in the row (by column), that way you could do:
> 
> pixbuf[5][2] = 0;
> 
> To set the pixel at (5, 2).

You could, but I think it's more error-prone than just having a
pixel(int x, int y) member. And less generic than having the
PixelPosition thing - I'm pretty sure it's going to be slower than
PixelPosition for column-wise visiting.

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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