Mercurial > octave
changeset 23794:7a1097510439
Fix printing integer type images (bug #51558)
*gl2ps-print.cc(gl2ps_renderer::draw_pixels): get the correct maximum value for
uint8_t and uint16_t types.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Mon, 24 Jul 2017 16:48:03 +0200 |
parents | 2641a0196176 |
children | 980f39c3ab90 |
files | libinterp/corefcn/gl2ps-print.cc |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc Mon Jul 24 14:08:37 2017 -0400 +++ b/libinterp/corefcn/gl2ps-print.cc Mon Jul 24 16:48:03 2017 +0200 @@ -763,7 +763,7 @@ OCTAVE_LOCAL_BUFFER (float, tmp_data, 3*w*h); - static const float maxval = std::numeric_limits<float>::max (); + static const float maxval = std::numeric_limits<uint8_t>::max (); for (int i = 0; i < 3*w*h; i++) tmp_data[i] = data[i] / maxval; @@ -778,7 +778,7 @@ OCTAVE_LOCAL_BUFFER (float, tmp_data, 3*w*h); - static const float maxval = std::numeric_limits<float>::max (); + static const float maxval = std::numeric_limits<uint16_t>::max (); for (int i = 0; i < 3*w*h; i++) tmp_data[i] = data[i] / maxval;