app: use gimp_rgba_set,get_pixel() instead of babl_process() directly

This commit is contained in:
Michael Natterer
2012-04-03 16:25:31 +02:00
parent 73108152ea
commit 7ec6c48636
2 changed files with 5 additions and 15 deletions

View File

@ -2223,9 +2223,7 @@ gimp_context_get_foreground_pixel (GimpContext *context,
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (babl_format ("R'G'B'A double"),
pixel_format),
&context->foreground, pixel, 1);
gimp_rgba_get_pixel (&context->foreground, pixel_format, pixel);
}
void
@ -2250,9 +2248,7 @@ gimp_context_set_foreground_pixel (GimpContext *context,
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (pixel_format,
babl_format ("R'G'B'A double")),
pixel, &color, 1);
gimp_rgba_set_pixel (&color, pixel_format, pixel);
gimp_context_set_foreground (context, &color);
}
@ -2305,9 +2301,7 @@ gimp_context_get_background_pixel (GimpContext *context,
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (babl_format ("R'G'B'A double"),
pixel_format),
&context->background, pixel, 1);
gimp_rgba_get_pixel (&context->background, pixel_format, pixel);
}
void
@ -2332,9 +2326,7 @@ gimp_context_set_background_pixel (GimpContext *context,
g_return_if_fail (pixel_format != NULL);
g_return_if_fail (pixel != NULL);
babl_process (babl_fish (pixel_format,
babl_format ("R'G'B'A double")),
pixel, &color, 1);
gimp_rgba_set_pixel (&color, pixel_format, pixel);
gimp_context_set_background (context, &color);
}

View File

@ -184,9 +184,7 @@ gimp_pickable_get_color_at (GimpPickable *pickable,
if (! gimp_pickable_get_pixel_at (pickable, x, y, pixel))
return FALSE;
babl_process (babl_fish (gimp_pickable_get_format (pickable),
babl_format ("R'G'B'A double")),
pixel, color, 1);
gimp_rgba_set_pixel (color, gimp_pickable_get_format (pickable), pixel);
return TRUE;
}