[gimp/goat-invasion] app: use gimp_image_get_component_format() instead of hardcoding "A u8"
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion] app: use gimp_image_get_component_format() instead of hardcoding "A u8"
- Date: Sun, 22 Apr 2012 13:50:46 +0000 (UTC)
commit 80b936313c3f247fa096946f052f112ae0e7521d
Author: Michael Natterer <mitch gimp org>
Date: Sun Apr 22 15:50:02 2012 +0200
app: use gimp_image_get_component_format() instead of hardcoding "A u8"
to extract a drawable's alpha channel into a layer mask.
app/core/gimplayer.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 29c350b..f4ffefa 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1292,10 +1292,14 @@ gimp_layer_create_mask (const GimpLayer *layer,
if (gimp_drawable_has_alpha (drawable))
{
GeglBuffer *dest_buffer;
+ const Babl *component_format;
dest_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask));
- gegl_buffer_set_format (dest_buffer, babl_format ("A u8"));
+ component_format =
+ gimp_image_get_component_format (image, GIMP_ALPHA_CHANNEL);
+
+ gegl_buffer_set_format (dest_buffer, component_format);
gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
dest_buffer, NULL);
gegl_buffer_set_format (dest_buffer, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]