code cleanup: reduce float/double promotion

This commit is contained in:
2012-06-09 19:57:14 +00:00
parent 2c1abe1f58
commit 8e7d7d5ea5
24 changed files with 345 additions and 345 deletions

View File

@@ -57,16 +57,16 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y
this->inputImage1Program->read(inColor1, x, y, sampler, inputBuffers);
this->inputImage2Program->read(inColor2, x, y, sampler, inputBuffers);
difference = (fabs(inColor2[0] - inColor1[0]) +
fabs(inColor2[1] - inColor1[1]) +
fabs(inColor2[2] - inColor1[2]));
difference = (fabsf(inColor2[0] - inColor1[0]) +
fabsf(inColor2[1] - inColor1[1]) +
fabsf(inColor2[2] - inColor1[2]));
/*average together the distances*/
difference=difference/3.0;
/* average together the distances */
difference = difference / 3.0f;
/*make 100% transparent*/
if (difference < tolerence) {
outputValue[0]=0.0;
outputValue[0] = 0.0f;
}
/*in the falloff region, make partially transparent */
else if (difference < falloff+tolerence) {