Mercurial > hg > octave-nkf
changeset 15764:0a27a0e157a6
Temporary fix for display of indexed images of integer class.
True fix will be done later in C++ code.
* image.m: Convert integer indexed images to class single and
switch to 1-based indexing.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 10 Dec 2012 15:38:38 -0800 |
parents | 56239ff815a3 |
children | 70bf9b6d47af |
files | scripts/image/image.m |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -105,6 +105,13 @@ error ("__img__: matrix is empty"); endif + ## FIXME: Hack for integer formats which use zero-based indexing + ## Hack favors correctness of display over size of image in memory. + ## True fix will be done in C++ code. + if (ndims (img) == 2 && (isinteger (img) || islogical (img))) + img = single (img) + 1; + endif + if (isempty (x)) x = [1, columns(img)]; endif