Mercurial > hg > octave-nkf
annotate test/return.tst @ 20579:131ce8cfaa80
Relax input in functions that convert between colorspaces (bug #45456)
* scripts/image/hsv2rgb.m, scripts/image/ntsc2rgb.m, scripts/image/rgb2hsv.m,
scripts/image/rgb2ntsc.m: remove all input check and leave it up to new
private functions handled by all. This adds support for ND images, drops
check for values in the [0 1] range, allows integer images, and allows
sparse matrices. Also adjust tests and add extra ones.
* scripts/image/private/colorspace_conversion_input_check.m,
scripts/image/private/colorspace_conversion_revert.m: all of this functions
handle input check in the same way. In the same way, they need to prepare
the output in the same way based on what preparation was done during input
check (transforming image into colormap). So we create two new private
functions to avoid repeated code. All code was adapted from hsv2rgb.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Sun, 19 Jul 2015 17:41:21 +0100 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
1 ## Copyright (C) 2006-2015 John W. Eaton |
7016 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
5590 | 19 %!function y = f () |
20 %! y = 1; | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
21 %! return; |
5590 | 22 %! y = 2; |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
23 %!endfunction |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
24 %! |
16213
b1283d4c06c2
test: Use Octave coding standards for scripts in test/ directory.
Rik <rik@octave.org>
parents:
16030
diff
changeset
|
25 %!assert (f (), 1) |
5590 | 26 |
27 %!test | |
28 %! return; | |
29 |