comparison libinterp/dldfcn/__magick_read__.cc @ 17380:63b53ea33a8b

imread: fix returning multiple variables. * imread.m: fix mistake when filling varargout from cset. Do not miss the first cell. * __magick_read__.cc (read_maps): change class of alpha map which is only a column vector, not a Nx3 Matrix.
author Carnë Draug <carandraug@octave.org>
date Wed, 04 Sep 2013 21:22:43 +0100
parents 6e1a3b8fc312
children 8508b8ae46a8
comparison
equal deleted inserted replaced
17379:f9e8544ce66d 17380:63b53ea33a8b
167 read_maps (Magick::Image& img) 167 read_maps (Magick::Image& img)
168 { 168 {
169 // can't call colorMapSize on const Magick::Image 169 // can't call colorMapSize on const Magick::Image
170 const octave_idx_type mapsize = img.colorMapSize (); 170 const octave_idx_type mapsize = img.colorMapSize ();
171 Matrix cmap = Matrix (mapsize, 3); // colormap 171 Matrix cmap = Matrix (mapsize, 3); // colormap
172 Matrix amap = Matrix (mapsize, 3); // alpha map 172 ColumnVector amap = ColumnVector (mapsize); // alpha map
173 for (octave_idx_type i = 0; i < mapsize; i++) 173 for (octave_idx_type i = 0; i < mapsize; i++)
174 { 174 {
175 const Magick::ColorRGB c = img.colorMap (i); 175 const Magick::ColorRGB c = img.colorMap (i);
176 cmap(i,0) = c.red (); 176 cmap(i,0) = c.red ();
177 cmap(i,1) = c.green (); 177 cmap(i,1) = c.green ();
178 cmap(i,2) = c.blue (); 178 cmap(i,2) = c.blue ();
179 amap(i,0) = c.alpha (); 179 amap(i) = c.alpha ();
180 } 180 }
181 octave_value_list maps; 181 octave_value_list maps;
182 maps(0) = cmap; 182 maps(0) = cmap;
183 maps(1) = amap; 183 maps(1) = amap;
184 return maps; 184 return maps;