comparison scripts/image/imread.m @ 12091:6f1857d0f5c1 release-3-2-x

image/imread.m Test added.
author Alexander Mamonov <mamonov@gmail.com>
date Mon, 14 Sep 2009 07:57:38 +0200
parents 4adc2a069031
children cca16271a517
comparison
equal deleted inserted replaced
12090:f12b581a1572 12091:6f1857d0f5c1
86 endif 86 endif
87 87
88 end_try_catch 88 end_try_catch
89 89
90 endfunction 90 endfunction
91
92 %!test
93 %! vpng = [ ...
94 %! 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, ...
95 %! 0, 13, 73, 72, 68, 82, 0, 0, 0, 3, ...
96 %! 0, 0, 0, 3, 8, 2, 0, 0, 0, 217, ...
97 %! 74, 34, 232, 0, 0, 0, 1, 115, 82, 71, ...
98 %! 66, 0, 174, 206, 28, 233, 0, 0, 0, 4, ...
99 %! 103, 65, 77, 65, 0, 0, 177, 143, 11, 252, ...
100 %! 97, 5, 0, 0, 0, 32, 99, 72, 82, 77, ...
101 %! 0, 0, 122, 38, 0, 0, 128, 132, 0, 0, ...
102 %! 250, 0, 0, 0, 128, 232, 0, 0, 117, 48, ...
103 %! 0, 0, 234, 96, 0, 0, 58, 152, 0, 0, ...
104 %! 23, 112, 156, 186, 81, 60, 0, 0, 0, 25, ...
105 %! 73, 68, 65, 84, 24, 87, 99, 96, 96, 96, ...
106 %! 248, 255, 255, 63, 144, 4, 81, 111, 101, 84, ...
107 %! 16, 28, 160, 16, 0, 197, 214, 13, 34, 74, ...
108 %! 117, 213, 17, 0, 0, 0, 0, 73, 69, 78, ...
109 %! 68, 174, 66, 96, 130];
110 %! fid = fopen('test.png', 'wb');
111 %! fwrite(fid, vpng);
112 %! fclose(fid);
113 %! A = imread('test.png');
114 %! delete('test.png');
115 %! assert(A(:,:,1), [0, 255, 0; 255, 237, 255; 0, 255, 0]);
116 %! assert(A(:,:,2), [0, 255, 0; 255, 28, 255; 0, 255, 0]);
117 %! assert(A(:,:,3), [0, 255, 0; 255, 36, 255; 0, 255, 0]);