Re: Inlining pixbufs



Tim Janik <timj@gtk.org> writes: 
> 1) what's that magic steaming from?

rand()

> 2) why do we need a rowstride here? we don't have a length field and
>    are talking about transporting one frame, so i don't see a need for
>    that (and it defeats things like RLE)

It's just to simplify the code. I don't know how RLE works so I don't
know how they interact; this is perhaps one reason that I shouldn't
implement RLE. ;-)

> 3) why have has_alpha, colorspace and n_channels? that's better encoded
>    in one 4 byte type field with an open flag convention (i.e. with something
>    like the enum BsePixdataType i use)

It's just a raw dump of Pixbuf; this is what Pixbuf has. 

> 4) how are bit sizes other than 8 handled, especially wrg to packing non
>    powers of two?
> 

Pixbuf doesn't support these, when it does we could come up with some
convention.
 
> i think it's be better to define a 4 byte type field that also leaves
> room for enhancements like RLE:
> 
...  
>   /* generate Pixbuf from C source saved structure */
>   GdkPixbuf* gdk_pixbuf_new_from_pixdata (const GdkPixdata *pixdata);
>   
>   /* generate Pixbuf from byte stream, ignores GDK_PIXDATA_MEMTYPE_STATIC */
>   GdkPixbuf* gdk_pixbuf_new_from_stream  (const guint8 *pixdata_stream);
> 
> (the functions would share the same decoder backend of course)
> 

I have no objection to that - if Owen agrees I'll do this, otherwise
you and Owen discuss and tell me what to implement.

Havoc




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