Re: [Gegl-developer] babl: format comparison
Vom: Sat, 21 May 2011 22:37:41 + Hi, what would be the best-practice to check if two BablFormats are the same? I would need something like: Babl *format1 = babl_format(R'G'B' u8); Babl *format2 = babl_format(CIE Lab float); if(is_same_format(format1, format2)) if (format1 == format2) { ... } else { ... } But do note that internally babl will provide you with a memcpy instead of a conversion if the passed in formats are the same; thus yep, i've seen that. this should only be neccesary if direct access with no copies whatsoever is an option where used. I don't quite understand. Without (my own) copies of the babl object? Maybe types would be a better example. If I understand you right I can do this: Babl *format = babl_format(R'G'B' u8); ... if(babl_format_get_type(format) == babl_type(u8)) { /* u8 type */ } else { /* no u8 type */ } BablFishes never change their source nor destination formats, and at the moment the source and destination formats of fishes are not exposed bu the publicly installed headers for babl. Then it looks like I have to remember the formats of all created fish myself :( best regards -- rigid printk(NULL POINTER IDIOT\n); linux-2.6.6/drivers/media/dvb/dvb-core/dvb_filter.c ___ Gegl-developer mailing list Gegl-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer
Re: [Gegl-developer] babl: format comparison
On Sun, May 22, 2011 at 10:26 AM, Daniel Hiepler ri...@boogiepalace.hopto.org wrote: Vom: Sat, 21 May 2011 22:37:41 + if(babl_format_get_type(format) == babl_type(u8)) { /* u8 type */ } else { /* no u8 type */ } Yes, all Babl objects are effectively singletons - and the same internal object will be returned for all subsequent calls that refer to one. BablFishes never change their source nor destination formats, and at the moment the source and destination formats of fishes are not exposed bu the publicly installed headers for babl. Then it looks like I have to remember the formats of all created fish myself :( This depends on what you are trying to do, if all you are trying to do is to avoid creating multiple fishes referring to the same two formats than babl already does this for you internally. Just like pixel formats and types, you should be getting the same fish, with significantly less computation needed. On subsequent requests. /Øyvind K. -- «The future is already here. It's just not very evenly distributed» -- William Gibson http://pippin.gimp.org/ http://ffii.org/ ___ Gegl-developer mailing list Gegl-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer
[Gegl-developer] hayalok thinks you should join SoSasta!
A personal message from hayalok: Hey, have you checked out SoSasta? They give you discounts of up to 99% on your favourite restaurants, cofee hours, holidays, movies, spas, and other activities! I am already in and this is your invitation to join -- all you do is go to www.sosasta.com and subscribe to their mailing list. You can even login using your Facebook or Gmail account. You will also get 500 points in rewards when you subscribe! Fan them on Facebook and Follow them on Twitter to get 10,000 points! Use these points to increase your account credit, and get their awesome deals for FREE! Cheers!! hayalok Click here to find out how SoSasta works. Accept Invitation >> Best, Team SoSasta Have a question? Email us at cont...@sosasta.com ___ Gegl-developer mailing list Gegl-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer