Commit c218c4be authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

the color samples are always RGB or RGBA, so always compare 3 or 4 bytes

2005-10-25  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-contiguous-region.c
	(struct ContinuousRegionData)
	(gimp_image_contiguous_region_by_color)
	(contiguous_region_by_color): the color samples are always RGB or
	RGBA, so always compare 3 or 4 bytes of pixel data, and not just
	the number of bytes of the drawable/projection. Fixes "select by
	color" on GRAYA (bug #319683).
parent dc4757ce
2005-10-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-contiguous-region.c
(struct ContinuousRegionData)
(gimp_image_contiguous_region_by_color)
(contiguous_region_by_color): the color samples are always RGB or
RGBA, so always compare 3 or 4 bytes of pixel data, and not just
the number of bytes of the drawable/projection. Fixes "select by
color" on GRAYA (bug #319683).
2005-10-25 Sven Neumann <sven@gimp.org>
* tools/pdbgen/lib.pl: add G_GNUC_INTERNAL to declaration of
......
......@@ -46,7 +46,6 @@ typedef struct
gint threshold;
gboolean select_transparent;
gboolean has_alpha;
gint color_bytes;
guchar color[MAX_CHANNELS];
} ContinuousRegionData;
......@@ -255,17 +254,6 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage,
select_transparent = FALSE;
}
if (GIMP_IMAGE_TYPE_IS_INDEXED (cont.type))
{
/* indexed colors are always RGB or RGBA */
cont.color_bytes = cont.has_alpha ? 4 : 3;
}
else
{
/* RGB, RGBA, GRAY and GRAYA colors are shaped just like the image */
cont.color_bytes = imagePR.bytes;
}
cont.gimage = gimage;
cont.antialias = antialias;
cont.threshold = threshold;
......@@ -312,7 +300,7 @@ contiguous_region_by_color (ContinuousRegionData *cont,
*m++ = pixel_difference (cont->color, rgb,
cont->antialias,
cont->threshold,
cont->color_bytes,
cont->has_alpha ? 4 : 3,
cont->has_alpha,
cont->select_transparent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment