On 10/8/07, Kalle Vahlman <[EMAIL PROTECTED]> wrote: > 2007/10/8, BJörn Lindqvist <[EMAIL PROTECTED]>: > > It feels like Cairo doesn't fit in. For example, GDK uses GdkColor to > > represent colors but Cairo has no equivalent. > > There is gdk_cairo_set_source_color() though, which bridges the gap. > > > Same thing with > > GdkRectangle, GdkPoint and a whole host of other types that becomes > > much less useful in a cairo-world. > > There's also gdk_cairo_rectangle() and _region(), and I'm sure the > rest (what they ever may be) could have similar bridging API if deemed > necessary. Like forming a path from an array of GdkPoints etc.
Yeah, but those functions aren't substitutes for "native" Cairo types. For example, gdk_cairo_set_source_color() as no matching gdk_cairo_get_source_color(). It is not so strange because Cairo handles an infinite amount of colors in the range 0..1 and has alpha channels, GdkColor only has 0..65535 and no alpha channel. There is a similar mismatch between GdkRectangle and cairo_rectangle_t. I think that integrating Cairo with GDK involves much more work than just replacing GdkPixbuf even if that is good first step. > > So how about replacing gdk-pixbuf with something cairo compatible that > > is also modern? 16 bits per sample is common these days. Support for > > digital camera RAW images would also be nice. Is a completely new > > image library worth pursuing? Are there maybe better ways to solve the > > problems Cairo and GdkPixbuf have? > > Even having an additional API for things like > gdk_pixbuf_cairo_load_from_file() would be a step forward I guess. I'd > personally like to see all the useful pixbuf API (file loading/saving, > possibly others) migrated to allow cairo usage and then deprecate > PixBufs over cairo image surfaces, but YMMV. I think that is out of the question. The Cairo developers are happy with Cairo being "only" a drawing API and letting other libraries handle loading and saving. -- mvh Björn _______________________________________________ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list