diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-19 08:48:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-19 08:48:34 +0400 |
commit | db051f2b2ddae22b6ff7468ae5cca7884d5b06da (patch) | |
tree | 67dc02d3c2d30fde68c8d7889bf93cff0ccff3d4 /source/blender/blenlib/intern/math_color_inline.c | |
parent | 946c9580b5d2735072fa2a4bd817c23fe269ec91 (diff) |
fix MESH_OT_tris_convert_to_quads() limit options (uv and vertex color) were not working at all.
Diffstat (limited to 'source/blender/blenlib/intern/math_color_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_color_inline.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index 6b90cbfe9c3..f520b2318e5 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -273,5 +273,20 @@ MINLINE float rgb_to_luma_y(const float rgb[3]) return 0.212671f * rgb[0] + 0.71516f * rgb[1] + 0.072169f * rgb[2]; } +MINLINE int compare_rgb_uchar(const unsigned char col_a[3], const unsigned char col_b[3], const int limit) +{ + int r = (int)col_a[0] - (int)col_b[0]; + if (ABS(r) < limit) { + int g = (int)col_a[1] - (int)col_b[1]; + if (ABS(g) < limit) { + int b = (int)col_a[2] - (int)col_b[2]; + if (ABS(b) < limit) { + return 1; + } + } + } + + return 0; +} #endif /* __MATH_COLOR_INLINE_C__ */ |