summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4443cb8)
raw | patch | inline | side by side (parent: 4443cb8)
author | johncoswell <johncoswell@users.sourceforge.net> | |
Thu, 8 Mar 2007 10:58:12 +0000 (10:58 +0000) | ||
committer | johncoswell <johncoswell@users.sourceforge.net> | |
Thu, 8 Mar 2007 10:58:12 +0000 (10:58 +0000) |
src/flood-context.cpp | patch | blob | history |
diff --git a/src/flood-context.cpp b/src/flood-context.cpp
index 561328c54c66319239a5260f9eeb58399adbffb0..7c2f05d53bb9eac53c9c9741f0ba537c9a140ccf 100644 (file)
--- a/src/flood-context.cpp
+++ b/src/flood-context.cpp
enum PaintBucketChannels {
FLOOD_CHANNELS_RGB,
+ FLOOD_CHANNELS_R,
+ FLOOD_CHANNELS_G,
+ FLOOD_CHANNELS_B,
FLOOD_CHANNELS_ALPHA
};
GList *glist = NULL;
glist = g_list_append (glist, _("Visible Colors"));
+ glist = g_list_append (glist, _("Red"));
+ glist = g_list_append (glist, _("Green"));
+ glist = g_list_append (glist, _("Blue"));
glist = g_list_append (glist, _("Alpha"));
return glist;
@@ -255,7 +261,13 @@ static bool compare_pixels(unsigned char *check, unsigned char *orig, unsigned c
switch (method) {
case FLOOD_CHANNELS_ALPHA:
- return ((int)abs(check[3] - orig[3]) <= (tolerance / 4));
+ return ((int)abs(check[3] - orig[3]) <= tolerance);
+ case FLOOD_CHANNELS_R:
+ return ((int)abs(check[0] - orig[0]) <= tolerance);
+ case FLOOD_CHANNELS_G:
+ return ((int)abs(check[1] - orig[1]) <= tolerance);
+ case FLOOD_CHANNELS_B:
+ return ((int)abs(check[2] - orig[2]) <= tolerance);
case FLOOD_CHANNELS_RGB:
unsigned char merged_orig[4];
unsigned char merged_check[4];