Mercurial > octave
changeset 20676:1672bb8882dd
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.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Tue, 03 Nov 2015 18:26:58 +0000 |
parents | ae83fda9929f |
children | 0d5d8db55790 |
files | scripts/image/hsv2rgb.m scripts/image/ntsc2rgb.m scripts/image/private/colorspace_conversion_input_check.m scripts/image/private/colorspace_conversion_revert.m scripts/image/rgb2hsv.m scripts/image/rgb2ntsc.m |
diffstat | 6 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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
--- 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);
--- 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)]);
--- 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
--- 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