Mercurial > hg > octave-lyh
changeset 3616:1b5178224a25
[project @ 2000-03-21 08:45:53 by jwe]
author | jwe |
---|---|
date | Tue, 21 Mar 2000 08:45:53 +0000 |
parents | c3b1f34a4748 |
children | b0d6c6e84d56 |
files | scripts/ChangeLog scripts/image/saveimage.m |
diffstat | 2 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2000-03-21 Kai Habel <kahacjde@calvados.zrz.TU-Berlin.DE> + + * image/saveimage.m: Swap black and white colormaps so zero is + displayed as black and 1 is displayed as white. + Fix indexing bug in ppm case. + 2000-03-06 Stephen Eglen <stephen@anc.ed.ac.uk> * statistics/tests/kolmogorov_smirnov_test_2.m: Account for ties
--- a/scripts/image/saveimage.m +++ b/scripts/image/saveimage.m @@ -153,9 +153,9 @@ if (grey && map_nr == 2 && bw) if (map(1) != 0) - map = [1; 0]; + map = [0; 1]; else - map = [0; 1]; + map = [1; 0]; endif n_long = rem (img_nc, 8); @@ -168,13 +168,14 @@ else img_row = map(img(idx)); endif + l_img_row = length (img_row); if (img_nc < 8) for j = 1:8 tmp(:,i) = tmp(:,i) + img_row (j) * 2^(8-j); endfor else for j = 1:8 - tmp(:,i) = tmp(:,i) + img_row (j:8:img_nc) * 2^(8-j); + tmp(:,i) = tmp(:,i) + img_row (j:8:l_img_row) * 2^(8-j); endfor endif endfor