for (dstRow = 0; dstRow < dstHeight; dstRow++) {
GLfloat srcRowF = (dstRow + 0.5F) / dstHeight * srcHeight - 0.5F;
- GLint srcRow = IROUND(srcRowF);
+ GLint srcRow = lroundf(srcRowF);
GLubyte *dstRowStart = dstMap + dstRowStride * dstRow;
assert(srcRow >= 0);
break;
}
- (*resampleRow)(srcWidth, dstWidth, srcBuffer, dstBuffer, invertX);
+ resampleRow(srcWidth, dstWidth, srcBuffer, dstBuffer, invertX);
prevY = srcRow;
}
for (dstCol = 0; dstCol < dstWidth; dstCol++) {
const GLfloat srcCol = (dstCol + 0.5F) / dstWidth * srcWidth - 0.5F;
- GLint srcCol0 = MAX2(0, IFLOOR(srcCol));
+ GLint srcCol0 = MAX2(0, util_ifloor(srcCol));
GLint srcCol1 = srcCol0 + 1;
GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */
GLfloat red, green, blue, alpha;
alpha = lerp_2d(colWeight, rowWeight,
srcColor0[srcCol0][ACOMP], srcColor0[srcCol1][ACOMP],
srcColor1[srcCol0][ACOMP], srcColor1[srcCol1][ACOMP]);
-
- dstColor[dstCol][RCOMP] = IFLOOR(red);
- dstColor[dstCol][GCOMP] = IFLOOR(green);
- dstColor[dstCol][BCOMP] = IFLOOR(blue);
- dstColor[dstCol][ACOMP] = IFLOOR(alpha);
+
+ dstColor[dstCol][RCOMP] = util_ifloor(red);
+ dstColor[dstCol][GCOMP] = util_ifloor(green);
+ dstColor[dstCol][BCOMP] = util_ifloor(blue);
+ dstColor[dstCol][ACOMP] = util_ifloor(alpha);
}
}
for (dstCol = 0; dstCol < dstWidth; dstCol++) {
const GLfloat srcCol = (dstCol + 0.5F) / dstWidth * srcWidth - 0.5F;
- GLint srcCol0 = MAX2(0, IFLOOR(srcCol));
+ GLint srcCol0 = MAX2(0, util_ifloor(srcCol));
GLint srcCol1 = srcCol0 + 1;
GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */
GLfloat red, green, blue, alpha;
alpha = lerp_2d(colWeight, rowWeight,
srcColor0[srcCol0][ACOMP], srcColor0[srcCol1][ACOMP],
srcColor1[srcCol0][ACOMP], srcColor1[srcCol1][ACOMP]);
-
+
dstColor[dstCol][RCOMP] = red;
dstColor[dstCol][GCOMP] = green;
dstColor[dstCol][BCOMP] = blue;
for (dstRow = 0; dstRow < dstHeight; dstRow++) {
const GLint dstY = dstYpos + dstRow;
GLfloat srcRow = (dstRow + 0.5F) / dstHeight * srcHeight - 0.5F;
- GLint srcRow0 = MAX2(0, IFLOOR(srcRow));
+ GLint srcRow0 = MAX2(0, util_ifloor(srcRow));
GLint srcRow1 = srcRow0 + 1;
GLfloat rowWeight = srcRow - srcRow0; /* fractional part of srcRow */