Re: [Gimp-developer] Code for editing in non-sRGB color spaces

On 04/06/2016 03:26 PM, Elle Stone wrote:
The question isn't how to get the nine RGB profile colorant values from
GIMP. That's easy.

The question is given these nine floating point values, how to convey
the values from GIMP to babl.

Like I said in my first post on this topic, the babl palette functions look like perhaps they could be used to ferry floating point values from GIMP to babl.

The following function placed inside babl's CIE.c ( does compile without errors:

void get_rgb (void)
  float rgbxyz[] = {
  0.436, 0.385, 0.143,
  0.222, 0.717, 0.061,
  0.014, 0.097, 0.714

const Babl *rgb;
const Babl *rgba;
const Babl *format = rgb;

babl_new_palette ("mypalette", &rgb, NULL);

babl_palette_set_palette (format,
                          babl_format ("RGB float"),
                          rgbxyz, 3);


Palettes can be created in GIMP and then passed from GIMP to babl.

Once the matrix rgbxyz[] have been place inside a palette created in GIMP and then passed to babl, is there a way to retrieve the matrix from the palette for use as colorant values in CIE.c?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]