octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49130] uint8 images are not shown correctly b


From: Rik
Subject: [Octave-bug-tracker] [bug #49130] uint8 images are not shown correctly by imshow with gnuplot
Date: Tue, 27 Sep 2016 23:40:45 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #11, bug #49130 (project octave):

In "direct" mode the clamping is done to the size of the colormap (LUT)
itself.  Something like this is correct.


if (strcmp ("mode", "direct"))
  cmin = 1;
  cmax = numel (colormap ());
  cdata(cdata < cmin) = cmin;
  cdata(cdata > cmax) = cmax;
else  # scaled data
  clim = caxis ();
  cmin = clim(1);
  cmax = clim(2);
  cdata(cdata < cmin) = cmin;
  cdata(cdata > cmax) = cmax;
endif


For "direct", the example above is correct for floating point variables
(double or single).  For the integer type variables (uint8, int8, ...) the
value '0' is supposed to map to the first color in the colormap.  This may
have already been taken care of by the time you reach this point in the
rendering code.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49130>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]