changeset 24284:1ad2297f8ece stable

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 a669809df612
children f52d91f6ef80
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	Sun Nov 19 21:15:17 2017 +0100
+++ b/libinterp/corefcn/gl2ps-print.cc	Mon Jul 24 16:48:03 2017 +0200
@@ -708,7 +708,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;
@@ -723,7 +723,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;