implement platform-agnostic comparison without abs()
parent
9e9b1a3a35
commit
97380f009b
|
@ -1658,11 +1658,9 @@ Image *Image::Highlight( unsigned int n_images, Image *images[], const Rgb thres
|
|||
{
|
||||
uint8_t *psrc = images[j]->buffer+c;
|
||||
|
||||
#ifndef SOLARIS
|
||||
if ( (unsigned)abs((*psrc)-RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) )
|
||||
#else
|
||||
if ( (unsigned)std::abs((*psrc)-RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) )
|
||||
#endif
|
||||
unsigned int diff = ((*psrc)-RGB_VAL(ref_colour,c)) > 0 ? (*psrc)-RGB_VAL(ref_colour,c) : RGB_VAL(ref_colour,c) - (*psrc);
|
||||
|
||||
if (diff >= RGB_VAL(threshold,c))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue