forked from bartvdbraak/blender
use BLI math length functions for distance compositor operations.
This commit is contained in:
parent
48eb27791b
commit
58ab8d5c0a
@ -46,9 +46,7 @@ void DistanceRGBMatteOperation::deinitExecution()
|
||||
|
||||
float DistanceRGBMatteOperation::calculateDistance(float key[4], float image[4])
|
||||
{
|
||||
return sqrt(pow((key[0] - image[0]), 2) +
|
||||
pow((key[1] - image[1]), 2) +
|
||||
pow((key[2] - image[2]), 2));
|
||||
return len_v3v3(key, image);
|
||||
}
|
||||
|
||||
void DistanceRGBMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
||||
|
@ -29,7 +29,7 @@ DistanceYCCMatteOperation::DistanceYCCMatteOperation() : DistanceRGBMatteOperati
|
||||
|
||||
float DistanceYCCMatteOperation::calculateDistance(float key[4], float image[4])
|
||||
{
|
||||
return sqrt(pow((key[1] - image[1]), 2) +
|
||||
pow((key[2] - image[2]), 2));
|
||||
/* only measure the second 2 values */
|
||||
return len_v2v2(key + 1, image + 1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user