Re: [Gegl-developer] babl: format comparison

2011-05-22 Thread Daniel Hiepler
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


[Gegl-developer] babl: format comparison

2011-05-21 Thread Daniel Hiepler
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))
{ ... } else { ... }


Also I would need to get the current source- and destination-format of
a fish.

Is that possible?



thanks in advance
-- 
rigid

I have hardly ever known a mathematician who was capable of reasoning.
-- Plato

PGP-Key available on subkeys.pgp.net


___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer