app: in Luminance mode, cache RGBA -> Y fish

This commit is contained in:
Ell 2018-12-01 05:35:38 -05:00
parent 70b7316ebc
commit dbab0b557d
1 changed files with 9 additions and 5 deletions

View File

@ -868,17 +868,21 @@ gimp_operation_layer_mode_blend_luminance (const gfloat *in,
gfloat *comp, gfloat *comp,
gint samples) gint samples)
{ {
static const Babl *fish;
gfloat *scratch; gfloat *scratch;
gfloat *in_Y; gfloat *in_Y;
gfloat *layer_Y; gfloat *layer_Y;
if (! fish)
fish = babl_fish ("RGBA float", "Y float");
scratch = gimp_scratch_new (gfloat, 2 * samples); scratch = gimp_scratch_new (gfloat, 2 * samples);
in_Y = scratch; in_Y = scratch;
layer_Y = scratch + samples; layer_Y = scratch + samples;
babl_process (babl_fish ("RGBA float", "Y float"), in, in_Y, samples); babl_process (fish, in, in_Y, samples);
babl_process (babl_fish ("RGBA float", "Y float"), layer, layer_Y, samples); babl_process (fish, layer, layer_Y, samples);
while (samples--) while (samples--)
{ {