[Top][All Lists]

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

[Octave-patch-tracker] [patch #8709] fixes to color conversion functions

From: Carnë Draug
Subject: [Octave-patch-tracker] [patch #8709] fixes to color conversion functions (mainly rgb2ntsc and ntsc2rgb)
Date: Mon, 26 Oct 2015 02:17:50 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.3.0

Follow-up Comment #6, patch #8709 (project octave):

Regarding the last part of this patch (conversion of the output back to the
original class), Matlab 2010b seems to have the following behaviour:

* ntsc2rgb
** input of any class
** output always double

* hsv2rgb
** input of floating point class only
** output matches input (double or single)

* rgb2hsv
** input of any class
** output always double (except when input is single)

* rgb2hsv
** input of any class
** output always double

For Matlab compatibility, the only function where we could return the same
class as the input is hsv2rgb (and then, only because Matlab does not accept
other classes as input giving us freedom to choose).  So for sake of
consistency, I'm thinking of also always returning a floating point for that.
This means that instead of adding a "keep_class" option, I'll just remove the
code that converted the values back to the original class.

I am also thinking of introducing a small Matlab incompatibility on purpose.
The functions ntsc2rgb and rgb2ntsc seem to always return an image of class
double, even when input is of class single. This seems a very odd behaviour, I
would argue it's a Matlab bug, so I'm planning on always returning double
unless the input is single.

Unless someone thinks otherwise, I'll push such change later this week.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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