Re: [GRASS-dev] How to: if undefined, set to NULL?

2016-09-05 Thread Nikos Alexandris
Nikos Alexandris: > Updated in sandbox, see: https://trac.osgeo.org/grass/changeset/69365 > Is it though correct? Vaclav Petras wrote: I was not looking at the logic but if (hue == -1.0) { is not safe. Although it will probably work most of the time if you set it to the exactly same value

Re: [GRASS-dev] How to: if undefined, set to NULL?

2016-09-05 Thread Glynn Clements
Vaclav Petras wrote: > > Updated in sandbox, see: https://trac.osgeo.org/grass/changeset/69365 > > > > Is it though correct? > > > > I was not looking at the logic but > > if (hue == -1.0) { > > is not safe. Although it will probably work most of the time if you set it > to the exactly same

Re: [GRASS-dev] How to: if undefined, set to NULL?

2016-09-05 Thread Nikos Alexandris
Nikos Alexandris: Updated in sandbox, see: https://trac.osgeo.org/grass/changeset/69365 Is it though correct? Vaclav Petras: I was not looking at the logic but if (hue == -1.0) { is not safe. Although it will probably work most of the time if you set it to the exactly same value (`hue =

Re: [GRASS-dev] How to: if undefined, set to NULL?

2016-09-04 Thread Vaclav Petras
On Sun, Sep 4, 2016 at 9:45 AM, Nikos Alexandris wrote: > Updated in sandbox, see: https://trac.osgeo.org/grass/changeset/69365 > > Is it though correct? > I was not looking at the logic but if (hue == -1.0) { is not safe. Although it will probably work most of the

Re: [GRASS-dev] How to: if undefined, set to NULL?

2016-09-04 Thread Nikos Alexandris
Nikos Alexandris: if (chroma == 0.0) { saturation = 0.0; /* undefined -- (how to) set to NULL? */ hue = 0.0; I'd like to set hue to NULL, whenever the condition is met. How do I do that? Markus Neteler: Something like: for (row = 0; row < nrows; row++) {

Re: [GRASS-dev] How to: if undefined, set to NULL?

2016-09-04 Thread Nikos Alexandris
* Markus Neteler [2016-08-27 15:37:35 +0200]: On Sat, Aug 27, 2016 at 3:26 PM, Nikos Alexandris wrote: While modifying i.rgb.his, if (chroma == 0.0) { saturation = 0.0; /* undefined -- (how to) set to NULL? */ hue = 0.0;

Re: [GRASS-dev] How to: if undefined, set to NULL?

2016-08-27 Thread Markus Neteler
On Sat, Aug 27, 2016 at 3:26 PM, Nikos Alexandris wrote: > While modifying i.rgb.his, > >if (chroma == 0.0) { > >saturation = 0.0; > >/* undefined -- (how to) set to NULL? */ >hue = 0.0; > >rowbuffer[0][sample] = (FCELL)hue; >