Re: XP design for image support


Subject: Re: XP design for image support
From: Dom Lachowicz (cinamod@hotmail.com)
Date: Thu Apr 19 2001 - 20:29:18 CDT


Jamie wrote:
>But doesn't this already exist?
>
>It might be annoying, but I know that sometimes fresh eyes can bring
>insight, so I'll have a go.
>
>As far as I can see, the current design should work like this (but I don't
>think it does on GNOME any more):

No, this is wrong. We pass a byte-buffer loaded from a file. We could be
passing around an ABW in memory for all that we know. The graphics classes
convert that byte-buffer into something useful, like a pretty picture. The
fact that Gnome represents that parsed data as a GdkPixbuf and other people
represent it as a png_info_struct_p or an ImageMagic struct in the future is
irrelevant.

>When loading or saving, convertToBuffer or convertFromBuffer are
>called. These convert the file to PNG or SVG , depending on whether we've
>inherited from the gr_RasterImage or gr_VectorImage, and store it in a
>UT_ByteBuf, or take a PNG or SVG and store it internally for rendering
>later and internal manipulation respectively.

No, they don't. They turn what just happens to be data representing a PNG
into an internal RGBA array useful for rendering to screen/printers.

>Am I missing something? I really don't see how the features of IM or
>GDK_Pixbuff or FooLib can't easily fit into the current framework in either
>XP or platform-specific land.

Well, at miminum it's between:
1) Using libpng or GdkPixbuf to load your data

We could easily just keep loading *only* PNGs but let GdkPixbuf do rendering
for us instead of working ourselves with the libpng/jpeglib/libtiff APIs.
Much simpler and fewer LOC and lower learning curve. Plus if we choose to
change things in the future to handle more image types, we get them
for-free.

>Jamie -> Hoping he's not missed something obvious and made himself look a
>moron.

Another set of eyes is always useful.

Dom

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com



This archive was generated by hypermail 2b25 : Thu Apr 19 2001 - 20:29:21 CDT