Mercurial > hg > octave-max
comparison src/DLD-FUNCTIONS/__magick_read__.cc @ 12044:8dcae1dfc9a0 release-3-2-x
determine correct image bitwidth in __magick_read__.cc
author | Benjamin Lindner <lindnerb@users.sourceforge.net> |
---|---|
date | Sat, 25 Jul 2009 16:20:05 +0200 |
parents | 1d4212b80713 |
children | 33c46d112b05 |
comparison
equal
deleted
inserted
replaced
12043:2246eadc1bb3 | 12044:8dcae1dfc9a0 |
---|---|
414 if (klass == Magick::PseudoClass && nargout > 1) | 414 if (klass == Magick::PseudoClass && nargout > 1) |
415 output = read_indexed_images (imvec, frameidx, (nargout == 3)); | 415 output = read_indexed_images (imvec, frameidx, (nargout == 3)); |
416 else | 416 else |
417 { | 417 { |
418 unsigned int depth = imvec[0].modulusDepth (); | 418 unsigned int depth = imvec[0].modulusDepth (); |
419 int i = 0; | 419 if (depth > 1) |
420 while (depth >>= 1) | 420 { |
421 i++; | 421 --depth; |
422 depth = 1 << i; | 422 int i = 1; |
423 | 423 while (depth >>= 1) |
424 i++; | |
425 depth = 1 << i; | |
426 } | |
427 | |
424 switch (depth) | 428 switch (depth) |
425 { | 429 { |
426 case 1: | 430 case 1: |
427 output = read_images<boolNDArray> (imvec, frameidx, depth); | 431 output = read_images<boolNDArray> (imvec, frameidx, depth); |
428 break; | 432 break; |