# HG changeset patch # User Carnë Draug # Date 1446575218 0 # Node ID 1672bb8882dd2e8153d15ff713137be12f22c43b # Parent ae83fda9929f4c0a23a4f4bdfae6cda801c7c9be Remove unused arguments in private functions for colorspace arguments. * scripts/image/private/colorspace_conversion_revert.m: originally, this function made use of the cls argument but not anymore since a5ed88c9eb14. * scripts/image/private/colorspace_conversion_input_check.m: no longer return cls argument which not needed. * scripts/image/hsv2rgb.m, scripts/image/ntsc2rgb.m, scripts/image/rgb2hsv.m, scripts/image/rgb2ntsc.m: fix calls to the modified private functions. diff -r ae83fda9929f -r 1672bb8882dd scripts/image/hsv2rgb.m --- a/scripts/image/hsv2rgb.m Tue Nov 03 18:21:02 2015 +0000 +++ b/scripts/image/hsv2rgb.m Tue Nov 03 18:26:58 2015 +0000 @@ -63,7 +63,7 @@ print_usage (); endif - [hsv, cls, sz, is_im, is_nd] ... + [hsv, sz, is_im, is_nd] ... = colorspace_conversion_input_check ("hsv2rgb", "HSV", hsv); h = hsv(:,1); @@ -92,7 +92,7 @@ + (hue >= 1/6 & hue < 1/2) + (hue >= 1/2 & hue < 2/3) .* (4 - 6 * hue)); - rgb = colorspace_conversion_revert (rgb, cls, sz, is_im, is_nd); + rgb = colorspace_conversion_revert (rgb, sz, is_im, is_nd); endfunction diff -r ae83fda9929f -r 1672bb8882dd scripts/image/ntsc2rgb.m --- a/scripts/image/ntsc2rgb.m Tue Nov 03 18:21:02 2015 +0000 +++ b/scripts/image/ntsc2rgb.m Tue Nov 03 18:26:58 2015 +0000 @@ -60,7 +60,7 @@ if (! isfloat (yiq)) error ("ntsc2rgb: YIQ must be of floating point class"); endif - [yiq, cls, sz, is_im, is_nd] ... + [yiq, sz, is_im, is_nd] ... = colorspace_conversion_input_check ("ntsc2rgb", "YIQ", yiq); ## Conversion matrix constructed from 'inv (rgb2ntsc matrix)'. @@ -81,7 +81,7 @@ idx = any (rgb > 1, 2); rgb(idx,:) = rgb(idx,:) ./ max (rgb(idx,:), [], 2); - rgb = colorspace_conversion_revert (rgb, cls, sz, is_im, is_nd); + rgb = colorspace_conversion_revert (rgb, sz, is_im, is_nd); endfunction %!shared trans diff -r ae83fda9929f -r 1672bb8882dd scripts/image/private/colorspace_conversion_input_check.m --- a/scripts/image/private/colorspace_conversion_input_check.m Tue Nov 03 18:21:02 2015 +0000 +++ b/scripts/image/private/colorspace_conversion_input_check.m Tue Nov 03 18:26:58 2015 +0000 @@ -21,7 +21,7 @@ ## handle input in the same way. The returned flags are meant to be handled ## by the complementary private function colorspace_conversion_revert() -function [in_arg, cls, sz, is_im, is_nd] ... +function [in_arg, sz, is_im, is_nd] ... = colorspace_conversion_input_check (func, arg_name, in_arg) cls = class (in_arg); diff -r ae83fda9929f -r 1672bb8882dd scripts/image/private/colorspace_conversion_revert.m --- a/scripts/image/private/colorspace_conversion_revert.m Tue Nov 03 18:21:02 2015 +0000 +++ b/scripts/image/private/colorspace_conversion_revert.m Tue Nov 03 18:26:58 2015 +0000 @@ -22,7 +22,7 @@ ## to come from complementary private function ## colorspace_conversion_input_check() -function rv = colorspace_conversion_revert (rv, cls, sz, is_im, is_nd) +function rv = colorspace_conversion_revert (rv, sz, is_im, is_nd) if (is_im) if (is_nd) rv = reshape (rv, [sz(1:2) sz(4) sz(3)]); diff -r ae83fda9929f -r 1672bb8882dd scripts/image/rgb2hsv.m --- a/scripts/image/rgb2hsv.m Tue Nov 03 18:21:02 2015 +0000 +++ b/scripts/image/rgb2hsv.m Tue Nov 03 18:26:58 2015 +0000 @@ -43,7 +43,7 @@ print_usage (); endif - [rgb, cls, sz, is_im, is_nd] ... + [rgb, sz, is_im, is_nd] ... = colorspace_conversion_input_check ("rgb2hsv", "RGB", rgb); ## get the max and min for each row @@ -78,7 +78,7 @@ s(notgray) = 1 - s(notgray) ./ v(notgray); hsv = [h, s, v]; - hsv = colorspace_conversion_revert (hsv, cls, sz, is_im, is_nd); + hsv = colorspace_conversion_revert (hsv, sz, is_im, is_nd); endfunction diff -r ae83fda9929f -r 1672bb8882dd scripts/image/rgb2ntsc.m --- a/scripts/image/rgb2ntsc.m Tue Nov 03 18:21:02 2015 +0000 +++ b/scripts/image/rgb2ntsc.m Tue Nov 03 18:26:58 2015 +0000 @@ -51,7 +51,7 @@ print_usage (); endif - [rgb, cls, sz, is_im, is_nd] ... + [rgb, sz, is_im, is_nd] ... = colorspace_conversion_input_check ("rgb2ntsc", "RGB", rgb); ## Reference matrix for transformation from http://en.wikipedia.org/wiki/YIQ @@ -65,7 +65,7 @@ ## of class single. This is Matlab incompatible by design, since ## Matlab always returning class double, is a Matlab bug (see patch #8709) - yiq = colorspace_conversion_revert (yiq, cls, sz, is_im, is_nd); + yiq = colorspace_conversion_revert (yiq, sz, is_im, is_nd); endfunction