From: Øyvind Kolås Date: Wed, 29 Aug 2018 21:50:56 +0000 (+0200) Subject: base: register a RGBA to RGBA float conversion for completeness X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~14^2~22 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8b1d2db37ad4a93b6ad84374a2e0602ae3993614;p=babl.git base: register a RGBA to RGBA float conversion for completeness --- diff --git a/babl/base/model-rgb.c b/babl/base/model-rgb.c index d4036d2..0a832f1 100644 --- a/babl/base/model-rgb.c +++ b/babl/base/model-rgb.c @@ -898,6 +898,25 @@ rgba_perceptual2rgba (Babl *conversion, } } +static void +rgba2rgba_float (Babl *conversion, + char *src, + char *dst, + long samples) +{ + long n = samples; + + while (n--) + { + ((float *) dst)[0] = ((float *) src)[0]; + ((float *) dst)[1] = ((float *) src)[1]; + ((float *) dst)[2] = ((float *) src)[2]; + ((float *) dst)[3] = ((float *) src)[3]; + src += 4 * sizeof (float); + dst += 4 * sizeof (float); + } +} + static void conversions (void) { @@ -1318,6 +1337,13 @@ formats (void) ); #endif + babl_conversion_new ( + babl_format ("RGBA float"), + babl_format ("RGBA float"), + "linear", rgba2rgba_float, + NULL + ); + babl_conversion_new ( babl_format ("R'G'B' float"), babl_format ("RGBA float"),