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

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

[Octave-bug-tracker] [bug #59242] ind2rgb/ind2gray errors with uint inpu


From: Rik
Subject: [Octave-bug-tracker] [bug #59242] ind2rgb/ind2gray errors with uint input containing the maximum integer value outside of colormap range
Date: Fri, 9 Oct 2020 12:01:52 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36

Follow-up Comment #6, bug #59242 (project octave):

Just so we stay Matlab compatible, ind2gray should clip the input based on the
number of colors in the colormap.  The documentation is:


If you specify X as an array of integer data type, then the value 0
corresponds to the first color in the colormap map. For a colormap containing
c colors, values of image X are clipped to the range [0, c-1].

If you specify X as an array of data type single or double, then the value 1
corresponds to the first color in the colormap. For a colormap containing c
colors, values of image X are clipped to the range [1, c].


At least in Matlab, only single, double, uint8, or uint16 inputs are
documented as allowed.  But, uint32 and uint64 *do* seem to work.  I wouldn't
get too caught up in trying to get this to work for strange combinations like
uint64 with more than flintmax entries.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59242>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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