Mercurial > octave-nkf
changeset 13020:58d704d3283c stable
Fix ambigous call to int pow (int, unsigned int&)
* __magick_read__.cc: Use bitshift rather than pow
to compute integer powers of two.
author | Carlo de Falco <kingcrimson@tiscali.it> |
---|---|
date | Mon, 29 Aug 2011 09:15:43 +0200 |
parents | 1653d3a86fca |
children | 9b191d0e547f |
files | src/DLD-FUNCTIONS/__magick_read__.cc |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/__magick_read__.cc Sun Aug 28 20:30:41 2011 -0700 +++ b/src/DLD-FUNCTIONS/__magick_read__.cc Mon Aug 29 09:15:43 2011 +0200 @@ -663,8 +663,7 @@ octave_idx_type rows = m.rows (); octave_idx_type columns = m.columns (); - // FIXME -- maybe simply using bit shifting would be better? - unsigned int div_factor = pow (2.0, static_cast<int> (bitdepth)) - 1; + unsigned int div_factor = (1 << bitdepth) - 1; for (unsigned int ii = 0; ii < nframes; ii++) { @@ -753,7 +752,7 @@ } im.quantizeColorSpace (Magick::GRAYColorspace); - im.quantizeColors (pow (2, bitdepth)); + im.quantizeColors (1 << bitdepth); im.quantize (); }